Makefile
author fabien
Thu, 05 Jan 2006 17:46:47 -0500
branchecjdr
changeset 19 22590956d131
parent 14 acb2e646be22
child 23 c6be3fab4e26
permissions -rw-r--r--
[svn] r2077@freebird: fabien | 2006-01-05 17:40:43 -0500 Ajout de dri-aido jdrdef et jdrl dans les TARGETS.

#!/usr/bin/make

# No final slash here!
# It will mess up rsync behavior.
TOP=`pwd`
TARGETS=couleurs colors jjch credo dri-aido jdrdef jdrl
UPDATE_FILES=$(TARGETS) index.en.html index.fr.html
SRC_DIR=`pwd`
INSTALL_DIR=$(TOP)/install
SGML_CATALOG_FILES=/etc/sgml/catalog
HTML_FILES=index.en.html index.fr.html

make_subdir=\
	[ -d $(2) ] || mkdir -p $(2) ; \
	$(MAKE) SRC_DIR=$(SRC_DIR) VPATH=$(SRC_DIR) \
		-C $(2) -f $(SRC_DIR)/Makefile $(1)

all: $(addsuffix -do,$(TARGETS))

install: $(addsuffix -do,$(TARGETS)) $(HTML_FILES)
	mkdir -p $(INSTALL_DIR)
	cp -a $(HTML_FILES) $(TARGETS) $(INSTALL_DIR)
	ln -sf index.fr.html $(INSTALL_DIR)/index.html

$(addsuffix -do,$(TARGETS)):
	$(call make_subdir,$(patsubst %-do,%,$@),$(patsubst %-do,%,$@))

clean:
	rm -rf *~ *.fo *.aux *.log *.out

purge:
	rm -rf $(TARGETS)

$(TARGETS): 
	$(MAKE) -f $(SRC_DIR)/Makefile $@.pdf $@.txt $@/index.html $@.html

%.fo: %.xml $(SRC_DIR)/print.xsl
	xsltproc -o $@ $(SRC_DIR)/print.xsl $< 

TEX_OPTIONS=-interaction=errorstopmode -file-line-error-style
TEXERRORLEVEL=2
MAX_TEX_RECURSION=4
%.pdf: %.fo
# 	-cp -pf prior.aux pprior.aux
# 	-cp -pf $(basename $<).aux prior.aux
# 	pdfxmltex $(TEX_OPTIONS) $< || [ $$? -lt $(TEXERRORLEVEL) ]
# 	if ! cmp $(basename $<).aux prior.aux &&	\
# 	   ! cmp $(basename $<).aux pprior.aux &&	\
# 	   expr $(MAKELEVEL) '<' $(MAX_TEX_RECURSION); then	\
# 		rm -f $@ ;					\
# 		$(MAKE) -f $(SRC_DIR)/Makefile $@ ;					\
# 	fi
# 	rm -f prior.aux pprior.aux
#	xmlto pdf $<
	fop $< $@

%.txt: %.html
	w3m -dump $< > $@

%/index.html: %.xml $(SRC_DIR)/chunk.xsl
	rm -rf $(dir $@)
	xsltproc -o $(dir $@) $(SRC_DIR)/chunk.xsl $<

%.html: %.xml $(SRC_DIR)/html.xsl
	xsltproc -o $@ $(SRC_DIR)/html.xsl $<

.PHONY: $(TARGETS) $(addsuffix -do,$(TARGETS)) update clean all install