Makefile: Move the `Doctor Who' entries into the main block.
[epls] / Makefile
index 33136ba..d6b2cfa 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,9 @@ all:
 clean::; rm -f $(CLEANFILES)
 realclean::; rm -f $(REALCLEANFILES)
 force:
-.PHONY: all clean
+.PHONY: all clean force
 .SECONDEXPANSION: # not sorry
+SHELL = bash
 
 V                      ?= 0
 V_AT                    = $(V_AT_$V)
@@ -96,6 +97,20 @@ $(call declare-playlist, danger-mouse, D/Danger Mouse)
 $(call declare-playlist, dark-angel, D/Dark Angel)
 $(call declare-playlist, the-day-today, D/The Day Today)
 $(call declare-playlist, dexter, D/Dexter)
+$(call declare-playlist, drwho-marco-polo, D/Doctor Who/S01E04 D. Marco Polo)
+$(call declare-playlist, drwho-crusade, D/Doctor Who/S02E06 P. The Crusade)
+$(call declare-playlist, drwho-masterplan, D/Doctor Who/S03E04 V. The Daleks' Master Plan) #'
+$(call declare-playlist, drwho-massacre, D/Doctor Who/S03E05 W. The Massacre of St Bartholomew's Eve) #'
+$(call declare-playlist, drwho-toymaker, D/Doctor Who/S03E07 Y. The Celestial Toymaker)
+$(call declare-playlist, drwho-savages, D/Doctor Who/S03E09 AA. The Savages)
+$(call declare-playlist, drwho-smugglers, D/Doctor Who/S04E01 CC. The Smugglers)
+$(call declare-playlist, drwho-highlanders, D/Doctor Who/S04E04 FF. The Highlanders)
+$(call declare-playlist, drwho-snowmen, D/Doctor Who/S05E02 NN. The Abominable Snowmen)
+$(call declare-playlist, drwho-wheel, D/Doctor Who/S05E07 SS. The Wheel in Space)
+$(call declare-playlist, drwho-invasion, D/Doctor Who/S06E03 VV. The Invasion)
+$(call declare-playlist, drwho-pirates, D/Doctor Who/S06E06 YY. The Space Pirates)
+$(call declare-playlist, drwho-war-games, D/Doctor Who/S06E07 ZZ. The War Games)
+$(call declare-playlist, drwho-silurians, D/Doctor Who/S07E02 BBB. Doctor Who and the Silurians)
 $(call declare-playlist, dollhouse, D/Dollhouse)
 $(call declare-playlist, engrenages, E/Engrenages)
 $(call declare-playlist, equalizer, E/The Equalizer (1985))
@@ -162,23 +177,10 @@ $(call declare-playlist, wonder-woman-1975, W/Wonder Woman (1975))
 $(call declare-playlist, yes-minister, Y/Yes Minister)
 $(call declare-playlist, the-young-ones, Y/The Young Ones)
 
-$(call declare-playlist, drwho-marco-polo, D/Doctor Who/S01E04 D. Marco Polo)
-$(call declare-playlist, drwho-crusade, D/Doctor Who/S02E06 P. The Crusade)
-$(call declare-playlist, drwho-masterplan, D/Doctor Who/S03E04 V. The Daleks' Master Plan) #'
-$(call declare-playlist, drwho-massacre, D/Doctor Who/S03E05 W. The Massacre of St Bartholomew's Eve) #'
-$(call declare-playlist, drwho-toymaker, D/Doctor Who/S03E07 Y. The Celestial Toymaker)
-$(call declare-playlist, drwho-savages, D/Doctor Who/S03E09 AA. The Savages)
-$(call declare-playlist, drwho-smugglers, D/Doctor Who/S04E01 CC. The Smugglers)
-$(call declare-playlist, drwho-highlanders, D/Doctor Who/S04E04 FF. The Highlanders)
-$(call declare-playlist, drwho-snowmen, D/Doctor Who/S05E02 NN. The Abominable Snowmen)
-$(call declare-playlist, drwho-wheel, D/Doctor Who/S05E07 SS. The Wheel in Space)
-$(call declare-playlist, drwho-invasion, D/Doctor Who/S06E03 VV. The Invasion)
-$(call declare-playlist, drwho-pirates, D/Doctor Who/S06E06 YY. The Space Pirates)
-$(call declare-playlist, drwho-war-games, D/Doctor Who/S06E07 ZZ. The War Games)
-$(call declare-playlist, drwho-silurians, D/Doctor Who/S07E02 BBB. Doctor Who and the Silurians)
-
 M3US                    = $(addsuffix .m3u8,$(PLAYLISTS))
+DEPFILES               += $(addsuffix .dep,$(PLAYLISTS))
 TARGETS                        += $(M3US)
+CLEANFILES             += $(DEPFILES)
 
 CLEANFILES             += mkm3u.cache-stamp
 mkm3u.cache-stamp:
@@ -190,7 +192,7 @@ mkm3u.cache-stamp:
 CLEANFILES             += *.m3u8.new
 $(M3US): %.m3u8: $$($$*_EPLS) mkm3u mkm3u.cache-stamp
        $(call v-tag,MKM3U)./mkm3u $(MKM3UFLAGS) $($*_MKM3UFLAGS) \
-               "$<" >"$@.new" && mv "$@.new" "$@"
+               -M$*.dep -O$@ -o"$@.new" "$<" && mv "$@.new" "$@"
 
 CHECKS                  = $(foreach p,$(PLAYLISTS), check/$p)
 check: $(CHECKS)
@@ -236,6 +238,14 @@ $(FORCE_SAVE): force-save/%: %.m3u8
                fi
 .PHONY: save $(SAVE)
 
+comma                   = ,
+check-deps              = $(shell if [ -f $1 ]; then for i in $2; do \
+                                 if ! [ "$$i" -ot $1 ]; then \
+                                   echo force; break; \
+                                 fi; \
+                               done; fi)
+-include $(DEPFILES)
+
 all: $(TARGETS)
 
 p:; : $p