-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
95 lines (73 loc) · 3.27 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
SOURCES := io.i.md introduction.i.md cheminfo.i.md atomsbonds.i.md index.i.md \
chemobject.i.md ctr.i.md stereo.i.md salts.i.md appatomtypes.i.md \
migration.i.md unpairedelectrons.i.md protein.i.md reaction.i.md \
substructure.i.md missing.i.md atomtype.i.md inchi.i.md builders.i.md \
properties.i.md appisotopes.i.md descriptor.i.md graph.i.md \
appmoldescs.i.md protein.i.md appfileformats.i.md writingApps.i.md \
depiction.i.md
TARGETS := io.md introduction.md cheminfo.md atomsbonds.md index.md \
chemobject.md ctr.md stereo.md indexList.md salts.md appatomtypes.md \
migration.md unpairedelectrons.md protein.md reaction.md \
substructure.md missing.md atomtype.md inchi.md builders.md \
properties.md appisotopes.md descriptor.md graph.md appmoldescs.md \
appfileformats.md ioclasseslist.md writingApps.md depiction.md
METAS := scriptcount.tex references.dat cdk.version minor.version \
sections.txt figures.txt toc.txt indexList.i.md topics.tsv \
ioclasseslist.md
SUBDIRS := code
all: cdk.version ${SUBDIRS} ${METAS} classinfo.tsv ${TARGETS}
clean:
@rm -f ${TARGETS} ${METAS}
cdk.version: README.md
@grep "^\[Edition" README.md | cut -d' ' -f2 | cut -d'-' -f1 > cdk.version
minor.version: README.md
@grep "^\[Edition" README.md | cut -d' ' -f2 | cut -d'-' -f2 | cut -d']' -f1 > minor.version
sections.txt: order.txt ${SOURCES}
@echo "Indexing the sections"
@groovy findSections.groovy > sections.txt
figures.txt: order.txt ${SOURCES}
@echo "Indexing the figures"
@groovy findFigures.groovy > figures.txt
scripts.txt: order.txt ${SOURCES}
@echo "Indexing the scripts"
@groovy numberScripts.groovy > scripts.txt
toc.txt: makeToC.groovy order.txt ${SOURCES}
@echo "Making the ToC"
@groovy makeToC.groovy > toc.txt
classinfo.tsv: classes.lst updateClassInfo.groovy
@echo "Updating the class info TSV..."
@groovy updateClassInfo.groovy . > classinfo.tsv.new
@mv classinfo.tsv.new classinfo.tsv
classes.lst: ${SOURCES} findClasses.groovy foo.sh
@groovy findClasses.groovy . | sort | uniq > classes.lst
@bash foo.sh | sed -r 's/..\/cdk\/[^\/]*\/([^\/]*)\/src\/main\/java\/(.*)\/(.*)\.java/\3\t\2\t\1/' | grep "org/openscience" | grep -v "\.\./cdk" | sed 's/\//\./g' > classes.lst2
@mv classes.lst2 classes.lst
indexList.i.md: topics.tsv makeIndex.groovy
@echo "Making the index"
@groovy makeIndex.groovy > indexList.i.md
topics.tsv: ${SOURCES} findTopics.groovy
@echo "Extracting the topics"
@groovy findTopics.groovy . | sort > topics.tsv
references.qids: findCitations.groovy
@echo "Finding the citations"
@groovy findCitations.groovy . | grep "^Q" | sort | uniq > references.qids
references.dat: references.qids references.js references.extra.dat
#@nodejs references.js
#@cat references.extra.dat >> references.dat
scriptcount.tex: code/scriptCount.tex
@mv code/scriptCount.tex scriptcount.tex
code/scriptCount.tex:
@cd code; make scriptCount.tex
index.md: index.i.md toc.txt createMarkdown.groovy
@echo "Creating $@"
@groovy createMarkdown.groovy index.i.md > index.md
%.md : %.i.md createMarkdown.groovy references.dat
@echo "Creating $@"
@groovy createMarkdown.groovy $< > $@
install:
@cp README.md ${TARGETS} live/.
@cp code/*.code.md live/code/.
@cp images/*.png live/images/.
@cp images/generated/*.png live/images/generated/.
$(SUBDIRS):
@$(MAKE) -C $@