From: Mark Wooding Date: Mon, 14 Mar 2022 17:57:02 +0000 (+0000) Subject: Makefile: Add rules for saving output references. X-Git-Url: https://git.distorted.org.uk/~mdw/epls/commitdiff_plain/c8746a3651c905b56aaba5b5f94492588542a79e Makefile: Add rules for saving output references. --- diff --git a/Makefile b/Makefile index 8cfecb5..257b254 100644 --- a/Makefile +++ b/Makefile @@ -159,3 +159,24 @@ $(LINKS): link/%: ln -frs $*.m3u8 "$$t.new" && mv "$$t.new" "$$t" ;; \ esac .PHONY: link $(LINKS) + +SAVE = $(foreach p,$(PLAYLISTS), save/$p) +FORCE_SAVE = $(foreach p,$(PLAYLISTS), force-save/$p) +save: $(SAVE) +force-save: $(FORCE_SAVE) +$(SAVE): save/%: %.m3u8 + $(V_AT) \ + ok=nil; \ + if ! [ -f "ref/$*.m3u8" ]; then \ + $(call v-print,SAVE,$*); \ + cp $< ref/$*.m3u8.new && mv ref/$*.m3u8.new ref/$*.m3u8; \ + fi +.PHONY: save $(SAVE) +$(FORCE_SAVE): force-save/%: %.m3u8 + $(V_AT) \ + ok=nil; \ + if ! [ -f "ref/$*.m3u8" ] || ! cmp -s $< ref/$*.m3u8; then \ + $(call v-print,SAVE,$*); \ + cp $< ref/$*.m3u8.new && mv ref/$*.m3u8.new ref/$*.m3u8; \ + fi +.PHONY: save $(SAVE)