summaryrefslogtreecommitdiff
path: root/Makefile
blob: 14db651185f8f9e69b0c93d12c337b6d59ea8305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
all: each-cdx

ftp.json: cdx_json
	./cdx_json 'url=ftp.unicode.org/Public/*' 'collapse=urlkey' > $@
www.json: cdx_json
	./cdx_json 'url=www.unicode.org/Public/*' 'collapse=urlkey' > $@
urlkeys.txt: ftp.json www.json Makefile
	cat $^ | cut -d '"' -f2,10 | sed -n 's/"200$$//p' | cut -d '?' -f1 | sed 's/,ftp)/)/' | sort -u | grep -i -e cvtutf -e convertutf > $@
urlkeys.mk: urlkeys.txt
	sed 's/^/urlkeys+=/' < $< > $@

-include urlkeys.mk
rp = )
c = ,
all_urlkeys = $(urlkeys) $(subst $(rp),$(c)ftp$(rp),$(urlkeys))

each-cdx/%.json: cdx_json urlkey2url
	mkdir -p '$(@D)'
	./cdx_json "url=$$(./urlkey2url '$*')" 'collapse=digest' > '$@'

each-cdx: $(addprefix each-cdx/,$(addsuffix .json,$(all_urlkeys)))
.PHONY: each-cdx

.DELETE_ON_ERROR:
.SECONDARY: