X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=developers-reference.git;a=blobdiff_plain;f=Makefile;h=1a49f3946cd29d148f9be5e06295329a5352dd4b;hp=43c602c5f35febc27064ff400feb44195fddd43e;hb=1bd681f99a7b307ebb5e5ab4759e63c7f58675af;hpb=818a68b4b558e80f2478305c7682b40daacbdf6f diff --git a/Makefile b/Makefile index 43c602c..1a49f39 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,110 @@ # Makefile, used for the DDP manuals.sgml area MANUAL := $(notdir $(shell pwd)) -PUBLISHDIR := ../../../public_html/manuals.html +PUBLISHDIR := /org/www.debian.org/www/doc/manuals -publish: build +SOURCES := $(wildcard *.sgml) + +TARGETS := $(foreach fmt,html txt pdf,developers-reference.$(fmt)) \ + $(filter-out developers-reference.ja.pdf, \ + $(foreach langext,.ja .fr, \ + $(foreach fmt,html txt pdf,developers-reference$(langext).$(fmt)))) + +# programs for creating output +DEBIANDOC2HTML := debiandoc2html -c +DEBIANDOC2TEXT := debiandoc2text +DEBIANDOC2LATEX := debiandoc2latex +DEBIANDOC2PS := debiandoc2latexps +DEBIANDOC2PDF := debiandoc2latexpdf + +make_directory := install -d -m 755 +install_file := install -m 644 -p + +MAX_TEX_RECURSION := 5 + +.PHONY: all +all: $(TARGETS) + +.PHONY: validate +validate: $(addsuffix .validate,$(SOURCES)) + +# hmmm, this rule may need to be revised/tested +publish: all [ -d $(PUBLISHDIR) ] || exit 1 rm -f $(PUBLISHDIR)/$(MANUAL)/*.html - install -d -m 755 $(PUBLISHDIR)/$(MANUAL) - install -m 644 --preserve-timestamps $(MANUAL).html/*.html \ + $(make_directory) $(PUBLISHDIR)/$(MANUAL) + $(install_file) developers-reference*.html/*.html \ $(PUBLISHDIR)/$(MANUAL) -.PHONY: build -build: - debian/rules build +developers-reference.html: developers-reference.sgml + $(DEBIANDOC2HTML) -l C $< + +developers-reference.html/*: developers-reference.html + +developers-reference.%.html: developers-reference.%.sgml + $(DEBIANDOC2HTML) -l $* $< + +developers-reference.txt: developers-reference.sgml + $(DEBIANDOC2TEXT) -l C -O $< > $@ + +developers-reference.%.txt: developers-reference.%.sgml + $(DEBIANDOC2TEXT) -l $* -O $< > $@ + +developers-reference.tex: developers-reference.sgml + $(DEBIANDOC2LATEX) -l C -O $< > $@ +developers-reference.%.tex: developers-reference.%.sgml + $(DEBIANDOC2LATEX) -l $* -O $< > $@ + +developers-reference.ps: developers-reference.sgml + $(DEBIANDOC2PS) -l C $< + +developers-reference.%.ps: developers-reference.%.sgml + $(DEBIANDOC2PS) -l $* $< + +developers-reference.pdf: developers-reference.sgml + $(DEBIANDOC2PDF) -l C $< + +developers-reference.%.pdf: developers-reference.%.sgml + $(DEBIANDOC2PDF) -l $* $< + +version.ent: debian/changelog + ./debian/rules $@ + +%.validate : % version.ent + nsgmls -wall -gues $< + touch $@ + +USERMAP := ../../ddp/CVSROOT/users +.PHONY: prepare +prepare: + @[ -f CVS/Root -a -f $(USERMAP) ] || \ + ( echo "silly rabbit, prepare is for Adam" 1>&2; exit 1 ) + cvs2cl -r --usermap $(USERMAP) + cvs ci -m "update for next release" ChangeLog + +.PHONY: clean clean: - debian/rules clean + rm -rf developers-reference*.html + rm -f developers-reference*.txt developers-reference*.pdf \ + developers-reference*.ps developers-reference*.lout* lout.li \ + developers-reference*.sasp* developers-reference*.tex \ + developers-reference*.aux developers-reference*.toc \ + developers-reference*.idx developers-reference*.log \ + developers-reference*.out developers-reference*.dvi \ + developers-reference*.tpt + rm -f version.ent + rm -f `find . -name "*~" -o -name "*.bak"` + rm -f *.validate + rm -f *~ *.bak .#* core + +.PHONY: distclean +distclean: clean + rm -f *.rej *.orig + +developers-reference$(SRCEXT).sgml: version.ent common.ent + +html: $(MANUAL).html +# if rule bomb out, delete the target +.DELETE_ON_ERROR: