summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-06-30 19:21:29 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-06-30 19:21:29 -0400
commit57266bea1b5fd82c6cc199c538783306c668b661 (patch)
tree07da8db5c95c3a081e6afa20530666ff5e2c962e /Makefile
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14db651
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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: