-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
62 lines (51 loc) · 1.75 KB
/
Makefile
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
L10N := nl ja es pt
LANGS ?= en ${L10N}
SOURCES := $(shell find src -name "*.md")
TARGETS := $(shell find src -name "*.md" | sed -e 's/src/docs/' )
METAS := references.dat toc.txt indexList.i.md sections.txt
SUBDIRS := sparql
all: ${SUBDIRS} ${METAS} ${TARGETS} docs/index.md docs/urlList.txt
@cp sparql/*.code.en.md docs/sparql
@rename -f "s/\.en.md/\.md/" docs/sparql/*.en.md
@for lang in $(L10N) ; do \
echo "Moving files for $$lang..." ; \
cp sparql/*.code.$$lang.md docs/$$lang/sparql ; \
rename -f "s/\.$$lang\.md/\.md/" docs/$$lang/sparql/*.$$lang.md ; \
done
docs/urlList.txt: urlList.txt
@sort urlList.txt | uniq > docs/urlList.txt
sections.txt: order.txt ${SOURCES}
@echo "Indexing the sections"
@groovy findSections.groovy > sections.txt
toc.txt: makeToC.groovy order.txt ${SOURCES}
@echo -n "Making the ToC ... "
@for lang in $(LANGS) ; do \
echo -n "$$lang " ; \
groovy makeToC.groovy $$lang > toc.$$lang.txt ; \
done
@echo ""
@touch toc.txt
indexList.i.md: topics.tsv makeIndex.groovy
@echo -n "Making the index ... "
@for lang in $(LANGS) ; do \
echo -n "$$lang " ; \
groovy makeIndex.groovy $$lang > indexList.$$lang.md ; \
done
@echo ""
@touch indexList.i.md
topics.tsv: ${SOURCES} findTopics.groovy
@echo -n "Extracting the topics ... "
@for lang in $(LANGS) ; do \
echo -n "$$lang " ; \
groovy findTopics.groovy src $$lang | sort > topics.$$lang.tsv ; \
done
@echo ""
@touch topics.tsv
references.qids: findCitations.groovy
@echo "Finding the citations"
@groovy findCitations.groovy src | grep "^Q" | sort | uniq > references.qids
references.dat: references.qids references.js
@nodejs references.js
docs/%.md : src/%.md createMarkdown.groovy sparql/*.out
@echo "Creating $@ ... "
@groovy createMarkdown.groovy $< > $@