Makefile
branchcda
changeset 18 9765d57d1f54
parent 9 af2604ead11f
child 19 2f5255f186d6
equal deleted inserted replaced
17:95877d18fdab 18:9765d57d1f54
     6 TOP=`pwd`
     6 TOP=`pwd`
     7 INSTALL_DIR=$(TOP)/install
     7 INSTALL_DIR=$(TOP)/install
     8 SRCS=cda.xml
     8 SRCS=cda.xml
     9 FOP=fop
     9 FOP=fop
    10 NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh
    10 NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh
    11 OO_PDF_OUTPUT_DIR=$(HOME)/pdf
       
    12 
    11 
    13 PDF_OUTPUT=cda-perso.pdf cda-perso-alt.pdf presentation.pdf
    12 OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
    14 OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target))) \
    13 UPLOAD=$(OUTPUT) cda.xml cda-perso.odt cda-perso-vierge.odt presentation.odp \
    15 	$(PDF_OUTPUT)
    14 	cda-perso-vierge.pdf presentation.pdf presentation.swf \
    16 UPLOAD=$(OUTPUT) cda-perso.sxw cda-perso-alt.sxw presentation.sxi index.fr.html blason.png
    15 	index.fr.html blason.png
    17 xml_validate=xmllint --xinclude --noout $(1)
    16 xml_validate=xmllint --xinclude --noout $(1)
    18 html_validate=$(call xml_validate,$(1))
    17 html_validate=$(call xml_validate,$(1))
    19 
    18 
    20 all: $(basename $(SRCS)) $(PDF_OUTPUT)
    19 all: $(basename $(SRCS))
    21 
    20 
    22 # Should I need to validate other file? Can I?
    21 # Should I need to validate other file? Can I?
    23 validate: $(addsuffix -validate, $(SRCS) index.fr.html)
    22 validate: $(addsuffix -validate, $(SRCS) index.fr.html)
    24 
    23 
    25 %.xml-validate: %.xml
    24 %.xml-validate: %.xml
    41 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
    40 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
    42 #	xmlto pdf -o $(dir $@) $<
    41 #	xmlto pdf -o $(dir $@) $<
    43 	fop $< $@
    42 	fop $< $@
    44 #	rm $@.tmp.fo
    43 #	rm $@.tmp.fo
    45 
    44 
    46 %.pdf: %.sxw
       
    47 	xvfb-run -a oowriter2 -pt PDF $<
       
    48 	mv $(OO_PDF_OUTPUT_DIR)/$@ $@
       
    49 
       
    50 %.pdf: %.sxi
       
    51 	xvfb-run -a ooimpress2 -pt PDF $<
       
    52 	mv $(OO_PDF_OUTPUT_DIR)/$@ $@
       
    53 
       
    54 %.html: %.xml html.xsl common.xsl
    45 %.html: %.xml html.xsl common.xsl
    55 	xsltproc --xinclude -o $@ html.xsl $<
    46 	xsltproc --xinclude -o $@ html.xsl $<
    56 #	recode u8..l1 $@
    47 #	recode u8..l1 $@
    57 
    48 
    58 %/index.html: %.xml chunk.xsl common.xsl
    49 %/index.html: %.xml chunk.xsl common.xsl
    62 
    53 
    63 %.txt: %.html
    54 %.txt: %.html
    64 	w3m -dump $< > $@
    55 	w3m -dump $< > $@
    65 
    56 
    66 install: $(UPLOAD)
    57 install: $(UPLOAD)
       
    58 	-rm -rf $(INSTALL_DIR)
    67 	-mkdir -p $(INSTALL_DIR)
    59 	-mkdir -p $(INSTALL_DIR)
    68 	cp -a $^ $(INSTALL_DIR)
    60 	cp -a $^ $(INSTALL_DIR)
       
    61 
       
    62 upload: install
       
    63 	rsync -avzPc --delete install/ o.tzone.org:/var/www/harmonies/CC/cda/
       
    64 	ssh o.tzone.org ln -s index.fr.html /var/www/harmonies/CC/cda/index.html
    69 
    65 
    70 clean:
    66 clean:
    71 	rm -f *~ *.fo
    67 	rm -f *~ *.fo
    72 
    68 
    73 purge: clean
    69 purge: clean