Add the `Arrowverse' series.
[epls] / Makefile
CommitLineData
04a05f7f
MW
1### -*-makefile-*-
2
3all:
4clean::; rm -f $(CLEANFILES)
5force:
6.PHONY: all clean
151b3c4f 7.SECONDEXPANSION: # not sorry
04a05f7f
MW
8
9V ?= 0
10V_AT = $(V_AT_$V)
11V_AT_0 = @
fd176c0c
MW
12v-print = $(call v-print.$V,$1,$2)
13v-print.1 = :
14v-print.0 = printf " %-8s %s\n" "$1" "$2"
04a05f7f 15v-tag = $(call v-tag.$V,$1)
fd176c0c 16v-tag.0 = @$(call v-print.0,$1,$@);
04a05f7f
MW
17
18TARGETS =
19CLEANFILES += $(TARGETS)
20
04a05f7f
MW
21define %declare-playlist
22PLAYLISTS += $1
151b3c4f
MW
23$1_FULLNAME = $2
24endef
25
26define %declare-simple-playlist
27$1_EPLS = $1.epls
28$1_MKM3UFLAGS =
29endef
30
31define %declare-chapter-playlist
6c3e910f
MW
32$1_EPLS = $2.epls
33$1_MKM3UFLAGS = -c
151b3c4f
MW
34endef
35
36define %declare-filter-playlist
37$1_EPLS = $2.epls
38$1_MKM3UFLAGS = -s$3
04a05f7f 39endef
151b3c4f
MW
40
41declare-playlist = \
42 $(eval $(call %declare-playlist,$1,$2)) \
43 $(eval $(call %declare-simple-playlist,$1))
6c3e910f
MW
44declare-chapters-only = \
45 $(eval $(call %declare-playlist,$1,$2)) \
46 $(eval $(call %declare-chapter-playlist,$1,$1))
151b3c4f
MW
47declare-chapters = \
48 $(eval $(call %declare-playlist,$1,$2)) \
49 $(eval $(call %declare-simple-playlist,$1)) \
50 $(eval $(call %declare-playlist,$1-chap,$2 (chapters))) \
6c3e910f 51 $(eval $(call %declare-chapter-playlist,$1-chap,$1))
151b3c4f
MW
52declare-filter = \
53 $(eval $(call %declare-playlist,$1,$4)) \
54 $(eval $(call %declare-filter-playlist,$1,$2,$3))
04a05f7f
MW
55
56ARCHIVEROOT = ../archive
57
151b3c4f
MW
58$(call declare-playlist, 24, \#/24)
59$(call declare-playlist, agent-carter, A/Agent Carter)
60#$(call declare-playlist, agents-of-shield, A/Agents of SHIELD)
61#$(call declare-playlist, andromeda, A/Andromeda)
863cc6f0
MW
62$(call declare-playlist, arrowverse, A/Arrowverse)
63$(call declare-filter, arrow, arrowverse,arr, A/Arrow)
64$(call declare-filter, the-flash, arrowverse,fls, F/The Flash)
65$(call declare-filter, constantine, arrowverse,cns, C/Constantine)
66$(call declare-filter, supergirl, arrowverse,spg, S/Supergirl)
67$(call declare-filter, legends-of-tomorrow, arrowverse,lot, L/Legends of Tomorrow)
68$(call declare-filter, batwoman, arrowverse,bwm, B/Batwoman)
151b3c4f
MW
69#$(call declare-playlist, a-team, A/The A-Team)
70#$(call declare-playlist, the-americans, A/The Americans)
71$(call declare-playlist, allo-allo, A/'Allo 'Allo!)
151b3c4f
MW
72$(call declare-playlist, babylon-5, B/Babylon 5)
73#$(call declare-playlist, batman-1966, B/Batman (1966 series))
74$(call declare-playlist, bsg-1978, B/Battlestar Galactica (1978))
75#$(call declare-playlist, bsg-1980, B/Battlestar Galactica 1980)
76#$(call declare-playlist, bsg-2003, B/Battlestar Galactica (2003))
151b3c4f
MW
77$(call declare-playlist, between-the-lines, B/Between the Lines)
78$(call declare-playlist, blackadder, B/Blackadder)
79$(call declare-playlist, blakes-7, B/Blake's 7) #'
80$(call declare-playlist, brass-eye, B/Brass Eye)
81$(call declare-playlist, the-bridge, B/The Bridge)
acc98df2
MW
82$(call declare-playlist, buffyverse, B/Buffyverse)
83$(call declare-filter, btvs, buffyverse,b, B/Buffy the Vampire Slayer)
84$(call declare-filter, angel, buffyverse,a, A/Angel)
151b3c4f 85#$(call declare-playlist, caprica, C/Caprica)
151b3c4f
MW
86#$(call declare-playlist, cracker, C/Cracker)
87#$(call declare-playlist, crow-stairway, C/The Crow—Stairway to Heaven)
88#$(call declare-playlist, danger-mouse, D/Danger Mouse)
89#$(call declare-playlist, dark-angel, D/Dark Angel)
90#$(call declare-playlist, the-day-today, D/The Day Today)
91#$(call declare-playlist, dexter, D/Dexter)
92$(call declare-playlist, dollhouse, D/Dollhouse)
93#$(call declare-playlist, engrenages, E/Engrenages)
94$(call declare-playlist, equalizer, E/The Equalizer (1985))
95$(call declare-playlist, fawlty-towers, F/Fawlty Towers)
96$(call declare-playlist, firefly, F/Firefly)
151b3c4f
MW
97$(call declare-chapters, fry-and-laurie, F/A Bit of Fry and Laurie)
98$(call declare-playlist, game-of-thrones, G/Game of Thrones)
99#$(call declare-playlist, godfather-ii, G/The Godfather Trilogy/02. Part II)
100#$(call declare-playlist, gotham, G/Gotham)
101#$(call declare-playlist, hannibal, H/Hannibal)
102#$(call declare-playlist, hhgttg, H/The Hitchhiker's Guide to the Galaxy) #'
103$(call declare-playlist, sherlock-holmes, H/Sherlock Holmes (1984))
104#$(call declare-playlist, house-of-cards, H/House of Cards)
105#$(call declare-playlist, into-the-labyrinth, I/Into the Labyrinth)
106#$(call declare-playlist, it-2017, I/It (2017))
107#$(call declare-playlist, snyder-justice, J/Justice League (Snyder cut))
108#$(call declare-playlist, kill-bill, K/Kill Bill)
109#$(call declare-playlist, the-killing, K/The Killing)
110#$(call declare-playlist, kingdom-of-heaven, K/Kingdom of Heaven (Definitive Edition))
111#$(call declare-playlist, knight-rider, K/Knight Rider)
151b3c4f
MW
112#$(call declare-playlist, lexx, L/Lexx)
113#$(call declare-playlist, lois-and-clark, L/Lois and Clark—The New Adventures of Superman)
114$(call declare-playlist, morse, M/Inspector Morse)
115$(call declare-playlist, macgyver, M/MacGyver)
116#$(call declare-playlist, metallica-s-and-m, M/Metallica—S&M)
117#$(call declare-playlist, the-night-manager, N/The Night Manager)
118#$(call declare-playlist, person-of-interest, P/Person of Interest)
119#$(call declare-playlist, harry-potter, P/Harry Potter)
de8d1aed 120$(call declare-chapters-only, flying-circus-sketches, P/Monty Python's Flying Circus (sketches)) #'
151b3c4f
MW
121$(call declare-playlist, robin-of-sherwood, R/Robin of Sherwood)
122$(call declare-playlist, rome, R/Rome)
123#$(call declare-playlist, sanctuary, S/Sanctuary)
124$(call declare-playlist, shark, S/Shark)
125#$(call declare-playlist, the-shield, S/The Shield)
126#$(call declare-playlist, smallville, S/Smallville)
127#$(call declare-playlist, george-smiley, S/George Smiley)
128$(call declare-playlist, spartacus, S/Spartacus)
129#$(call declare-playlist, spooks, S/Spooks)
130#$(call declare-playlist, star-wars, S/Star Wars)
131$(call declare-playlist, stargate, S/Stargate)
132$(call declare-filter, stargate-sg1, stargate,sg1, S/Stargate SG-1)
133$(call declare-filter, stargate-atlantis, stargate,sga, S/Stargate Atlantis)
134$(call declare-filter, stargate-universe, stargate,sgu, S/Stargate Universe)
135#$(call declare-playlist, state-of-play, S/State of Play)
151b3c4f
MW
136$(call declare-playlist, terminator-scc, T/Terminator—The Sarah Connor Chronicles)
137#$(call declare-playlist, traffik, T/Traffik)
138#$(call declare-playlist, the-tripods, T/The Tripods)
139#$(call declare-playlist, tru-calling, T/Tru Calling)
140#$(call declare-playlist, ultraviolet, U/Ultraviolet)
141#$(call declare-playlist, v-1983, V/V (1983))
142$(call declare-playlist, v-2009, V/V (2009))
143$(call declare-playlist, the-wire, W/The Wire)
144$(call declare-playlist, waking-the-dead, W/Waking the Dead)
145#$(call declare-playlist, wonder-woman-1975, W/Wonder Woman (1975))
146#$(call declare-playlist, yes-minister, Y/Yes Minister)
147#$(call declare-playlist, the-young-ones, Y/The Young Ones)
04a05f7f 148
151b3c4f
MW
149$(call declare-playlist, drwho-marco-polo, D/Doctor Who/S01E04 D. Marco Polo)
150$(call declare-playlist, drwho-crusade, D/Doctor Who/S02E06 P. The Crusade)
151$(call declare-playlist, drwho-masterplan, D/Doctor Who/S03E04 V. The Daleks' Master Plan) #'
152$(call declare-playlist, drwho-massacre, D/Doctor Who/S03E05 W. The Massacre of St Bartholomew's Eve) #'
153$(call declare-playlist, drwho-toymaker, D/Doctor Who/S03E07 Y. The Celestial Toymaker)
154$(call declare-playlist, drwho-savages, D/Doctor Who/S03E09 AA. The Savages)
155$(call declare-playlist, drwho-smugglers, D/Doctor Who/S04E01 CC. The Smugglers)
156$(call declare-playlist, drwho-highlanders, D/Doctor Who/S04E04 FF. The Highlanders)
157$(call declare-playlist, drwho-snowmen, D/Doctor Who/S05E02 NN. The Abominable Snowmen)
158$(call declare-playlist, drwho-wheel, D/Doctor Who/S05E07 SS. The Wheel in Space)
159$(call declare-playlist, drwho-invasion, D/Doctor Who/S06E03 VV. The Invasion)
160$(call declare-playlist, drwho-pirates, D/Doctor Who/S06E06 YY. The Space Pirates)
161$(call declare-playlist, drwho-war-games, D/Doctor Who/S06E07 ZZ. The War Games)
162$(call declare-playlist, drwho-silurians, D/Doctor Who/S07E02 BBB. Doctor Who and the Silurians)
163
164M3US = $(addsuffix .m3u8,$(PLAYLISTS))
165TARGETS += $(M3US)
04a05f7f 166
151b3c4f
MW
167$(M3US): %.m3u8: $$($$*_EPLS) mkm3u
168 $(call v-tag,MKM3U)./mkm3u $($*_MKM3UFLAGS) "$<" >"$@.new" && mv "$@.new" "$@"
04a05f7f
MW
169
170CHECKS = $(foreach p,$(PLAYLISTS), check/$p)
171check: $(CHECKS)
172$(CHECKS): check/%: %.m3u8
fd176c0c 173 $(V_AT)diff -u $< ref/$*.m3u8
04a05f7f
MW
174.PHONY: check $(CHECKS)
175
176LINKS = $(foreach p,$(PLAYLISTS), link/$p)
177link: $(LINKS)
178$(LINKS): link/%:
fd176c0c 179 $(V_AT) \
151b3c4f 180 ok=nil t="$(ARCHIVEROOT)/$($*_FULLNAME).m3u8"; \
fd176c0c
MW
181 if [ -L "$$t" ]; then \
182 case $$(realpath "$$t") in \
183 "$(abspath $*.m3u8)") ok=t ;; \
184 esac; \
185 fi; \
186 case $$ok in \
187 t) ;; \
188 *) $(call v-print,LINK,$*); \
189 ln -frs $*.m3u8 "$$t.new" && mv "$$t.new" "$$t" ;; \
190 esac
04a05f7f 191.PHONY: link $(LINKS)
c8746a36
MW
192
193SAVE = $(foreach p,$(PLAYLISTS), save/$p)
194FORCE_SAVE = $(foreach p,$(PLAYLISTS), force-save/$p)
195save: $(SAVE)
196force-save: $(FORCE_SAVE)
197$(SAVE): save/%: %.m3u8
198 $(V_AT) \
199 ok=nil; \
200 if ! [ -f "ref/$*.m3u8" ]; then \
201 $(call v-print,SAVE,$*); \
202 cp $< ref/$*.m3u8.new && mv ref/$*.m3u8.new ref/$*.m3u8; \
203 fi
204.PHONY: save $(SAVE)
205$(FORCE_SAVE): force-save/%: %.m3u8
206 $(V_AT) \
207 ok=nil; \
208 if ! [ -f "ref/$*.m3u8" ] || ! cmp -s $< ref/$*.m3u8; then \
209 $(call v-print,SAVE,$*); \
210 cp $< ref/$*.m3u8.new && mv ref/$*.m3u8.new ref/$*.m3u8; \
211 fi
212.PHONY: save $(SAVE)
151b3c4f
MW
213
214all: $(TARGETS)
215
216p:; : $p