Makefile
branchcda
changeset 0 ff2810600648
child 3 dca5a75d3c0e
equal deleted inserted replaced
-1:000000000000 0:ff2810600648
       
     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=cda.xml
       
     9 FOP=fop
       
    10 NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh
       
    11 OO_PDF_OUTPUT_DIR=$(HOME)/pdf
       
    12 
       
    13 PDF_OUTPUT=cda-perso.pdf cda-perso-alt.pdf presentation.pdf
       
    14 OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target))) \
       
    15 	$(PDF_OUTPUT)
       
    16 UPLOAD=$(OUTPUT) cda-perso.sxw cda-perso-alt.sxw presentation.sxi index.fr.html blason.png
       
    17 
       
    18 all: $(basename $(SRCS)) $(PDF_OUTPUT)
       
    19 
       
    20 cda: $(call targets,cda)
       
    21 
       
    22 # title.xsl: title.xml
       
    23 #	xsltproc -o $@ $(NWALSH_XSL_DIR)/template/titlepage.xsl $<
       
    24 
       
    25 %.fo: %.xml print.xsl titlepage.xsl common.xsl
       
    26 	xsltproc -o $@ print.xsl $<
       
    27 
       
    28 %.pdf: %.fo
       
    29 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
       
    30 #	xmlto pdf -o $(dir $@) $<
       
    31 	fop $< $@
       
    32 #	rm $@.tmp.fo
       
    33 
       
    34 %.pdf: %.sxw
       
    35 	xvfb-run -a oowriter2 -pt PDF $<
       
    36 	mv $(OO_PDF_OUTPUT_DIR)/$@ $@
       
    37 
       
    38 %.pdf: %.sxi
       
    39 	xvfb-run -a ooimpress2 -pt PDF $<
       
    40 	mv $(OO_PDF_OUTPUT_DIR)/$@ $@
       
    41 
       
    42 %.html: %.xml html.xsl common.xsl
       
    43 	xsltproc --xinclude -o $@ html.xsl $<
       
    44 #	recode u8..l1 $@
       
    45 
       
    46 %/index.html: %.xml chunk.xsl common.xsl
       
    47 	rm -rf $(dir $@)
       
    48 	mkdir -p $(dir $@)
       
    49 	xsltproc --xinclude -o $(dir $@) chunk.xsl $<
       
    50 
       
    51 %.txt: %.html
       
    52 	w3m -dump $< > $@
       
    53 
       
    54 install: $(UPLOAD)
       
    55 	-mkdir -p $(INSTALL_DIR)
       
    56 	cp -a $^ $(INSTALL_DIR)
       
    57 
       
    58 clean:
       
    59 	rm -f *~ *.fo
       
    60 
       
    61 purge: clean
       
    62 	rm -rf $(OUTPUT)