1 #!/usr/bin/make |
1 #!/usr/bin/make |
2 |
2 |
3 # No final slash here! |
3 # No final slash here! |
4 # It will mess up rsync behavior. |
4 # It will mess up rsync behavior. |
5 TOP=`pwd` |
5 TOP=`pwd` |
6 TARGETS=couleurs colors jjch credo dri-aido jdrdef jdrl resolution |
6 FR_ARTICLES=couleurs jjch credo systemes |
|
7 EN_ARTICLES=colors |
|
8 UNPUBLISHED=dri-aido jdrdef jdrl resolution |
|
9 TARGETS=jeuderologie rpgtheory $(FR_ARTICLES) $(EN_ARTICLES) $(UNPUBLISHED) |
|
10 |
7 UPDATE_FILES=$(TARGETS) index.en.html index.fr.html |
11 UPDATE_FILES=$(TARGETS) index.en.html index.fr.html |
8 SRC_DIR=`pwd` |
12 SRC_DIR=`pwd` |
9 INSTALL_DIR=$(TOP)/install |
13 INSTALL_DIR=$(TOP)/install |
10 SGML_CATALOG_FILES=/etc/sgml/catalog |
14 SGML_CATALOG_FILES=/etc/sgml/catalog |
11 HTML_FILES=index.en.html index.fr.html |
15 HTML_FILES=index.en.html index.fr.html |
12 |
16 |
13 make_subdir=\ |
17 make_subdir= \ |
14 [ -d $(2) ] || mkdir -p $(2) ; \ |
18 [ -d $(2) ] || mkdir -p $(2) ; \ |
15 $(MAKE) SRC_DIR=$(SRC_DIR) VPATH=$(SRC_DIR) \ |
19 $(MAKE) SRC_DIR=$(SRC_DIR) VPATH=$(SRC_DIR) \ |
16 -C $(2) -f $(SRC_DIR)/Makefile $(1) |
20 -C $(2) -f $(SRC_DIR)/Makefile $(1) |
17 |
21 |
18 all: $(addsuffix -do,$(TARGETS)) |
22 all: $(addsuffix -do,$(TARGETS)) |
|
23 |
|
24 jeuderologie.xml: $(addsuffix .xml, $(FR_ARTICLES)) |
|
25 rpgtheory.xml: $(addsuffix .xml, $(EN_ARTICLES)) |
19 |
26 |
20 install: $(addsuffix -do,$(TARGETS)) $(HTML_FILES) |
27 install: $(addsuffix -do,$(TARGETS)) $(HTML_FILES) |
21 mkdir -p $(INSTALL_DIR) |
28 mkdir -p $(INSTALL_DIR) |
22 cp -a $(HTML_FILES) $(TARGETS) $(INSTALL_DIR) |
29 cp -a $(HTML_FILES) $(TARGETS) $(INSTALL_DIR) |
23 ln -sf index.fr.html $(INSTALL_DIR)/index.html |
30 ln -sf index.fr.html $(INSTALL_DIR)/index.html |
33 |
40 |
34 $(TARGETS): |
41 $(TARGETS): |
35 $(MAKE) -f $(SRC_DIR)/Makefile $@.pdf $@.txt $@/index.html $@.html |
42 $(MAKE) -f $(SRC_DIR)/Makefile $@.pdf $@.txt $@/index.html $@.html |
36 |
43 |
37 %.fo: %.xml $(SRC_DIR)/print.xsl |
44 %.fo: %.xml $(SRC_DIR)/print.xsl |
38 xsltproc -o $@ $(SRC_DIR)/print.xsl $< |
45 xsltproc --xinclude -o $@ $(SRC_DIR)/print.xsl $< |
39 |
46 |
40 TEX_OPTIONS=-interaction=errorstopmode -file-line-error-style |
47 TEX_OPTIONS=-interaction=errorstopmode -file-line-error-style |
41 TEXERRORLEVEL=2 |
48 TEXERRORLEVEL=2 |
42 MAX_TEX_RECURSION=4 |
49 MAX_TEX_RECURSION=4 |
43 %.pdf: %.fo |
50 %.pdf: %.fo |
44 # -cp -pf prior.aux pprior.aux |
51 # -cp -pf prior.aux pprior.aux |
45 # -cp -pf $(basename $<).aux prior.aux |
52 # -cp -pf $(basename $<).aux prior.aux |
46 # pdfxmltex $(TEX_OPTIONS) $< || [ $$? -lt $(TEXERRORLEVEL) ] |
53 # pdfxmltex $(TEX_OPTIONS) $< || [ $$? -lt $(TEXERRORLEVEL) ] |
47 # if ! cmp $(basename $<).aux prior.aux && \ |
54 # if ! cmp $(basename $<).aux prior.aux && \ |
48 # ! cmp $(basename $<).aux pprior.aux && \ |
55 # ! cmp $(basename $<).aux pprior.aux && \ |
49 # expr $(MAKELEVEL) '<' $(MAX_TEX_RECURSION); then \ |
56 # expr $(MAKELEVEL) '<' $(MAX_TEX_RECURSION); then \ |
50 # rm -f $@ ; \ |
57 # rm -f $@ ; \ |
51 # $(MAKE) -f $(SRC_DIR)/Makefile $@ ; \ |
58 # $(MAKE) -f $(SRC_DIR)/Makefile $@ ; \ |
52 # fi |
59 # fi |
53 # rm -f prior.aux pprior.aux |
60 # rm -f prior.aux pprior.aux |
54 # xmlto pdf $< |
61 # xmlto pdf $< |
55 fop $< $@ |
62 fop $< $@ |
56 |
63 |
57 %.txt: %.html |
64 %.txt: %.html |
58 w3m -dump $< > $@ |
65 w3m -dump $< > $@ |
59 |
66 |
60 %/index.html: %.xml $(SRC_DIR)/chunk.xsl |
67 %/index.html: %.xml $(SRC_DIR)/chunk.xsl |
61 rm -rf $(dir $@) |
68 rm -rf $(dir $@) |
62 xsltproc -o $(dir $@) $(SRC_DIR)/chunk.xsl $< |
69 xsltproc --xinclude -o $(dir $@) $(SRC_DIR)/chunk.xsl $< |
63 |
70 |
64 %.html: %.xml $(SRC_DIR)/html.xsl |
71 %.html: %.xml $(SRC_DIR)/html.xsl |
65 xsltproc -o $@ $(SRC_DIR)/html.xsl $< |
72 xsltproc --xinclude -o $@ $(SRC_DIR)/html.xsl $< |
66 |
73 |
67 .PHONY: $(TARGETS) $(addsuffix -do,$(TARGETS)) update clean all install |
74 .PHONY: $(TARGETS) $(addsuffix -do,$(TARGETS)) update clean all install |