equal
deleted
inserted
replaced
|
1 #/usr/bin/make |
|
2 |
|
3 targets=$(addprefix $(1), .html .pdf .txt /index.html) |
|
4 output=$(addprefix $(1), .html .pdf .txt) $(1) |
|
5 |
|
6 TOP=`pwd` |
|
7 INSTALL_DIR=$(TOP)/install |
|
8 SRCS=cthulhu_19e.xml |
|
9 FOP=fop |
|
10 NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh |
|
11 OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target))) |
|
12 UPLOAD=$(OUTPUT) |
|
13 |
|
14 all: $(basename $(SRCS)) |
|
15 |
|
16 cthulhu_19e: $(call targets,cthulhu_19e) |
|
17 |
|
18 # title.xsl: title.xml |
|
19 # xsltproc -o $@ $(NWALSH_XSL_DIR)/template/titlepage.xsl $< |
|
20 |
|
21 %.fo: %.xml print.xsl common.xsl |
|
22 xsltproc -o $@ print.xsl $< |
|
23 |
|
24 %.pdf: %.fo |
|
25 # xsltproc -o $@.tmp.fo strip-attributes.xsl $< |
|
26 # xmlto pdf -o $(dir $@) $< |
|
27 fop $< $@ |
|
28 # rm $@.tmp.fo |
|
29 |
|
30 %.pdf: %.sxw |
|
31 xvfb-run -a oowriter2 -pt PDF $< |
|
32 mv $(OO_PDF_OUTPUT_DIR)/$@ $@ |
|
33 |
|
34 %.pdf: %.sxi |
|
35 xvfb-run -a ooimpress2 -pt PDF $< |
|
36 mv $(OO_PDF_OUTPUT_DIR)/$@ $@ |
|
37 |
|
38 %.html: %.xml html.xsl common.xsl |
|
39 xsltproc --xinclude -o $@ html.xsl $< |
|
40 # recode u8..l1 $@ |
|
41 |
|
42 %/index.html: %.xml chunk.xsl common.xsl |
|
43 rm -rf $(dir $@) |
|
44 mkdir -p $(dir $@) |
|
45 xsltproc --xinclude -o $(dir $@) chunk.xsl $< |
|
46 |
|
47 %.txt: %.html |
|
48 w3m -dump $< > $@ |
|
49 |
|
50 install: $(UPLOAD) |
|
51 -mkdir -p $(INSTALL_DIR) |
|
52 cp -a $^ $(INSTALL_DIR) |
|
53 |
|
54 clean: |
|
55 rm -f *~ *.fo |
|
56 |
|
57 purge: clean |
|
58 rm -rf $(OUTPUT) |