Makefile 1.22 KB
Newer Older
1
# Force rebuilds
2 3 4 5
.PHONY: progspell docs progdocs userdocs

doc-srcdir := $(shell cd $(s) && pwd)
sgml2 := $(doc-srcdir)/sgml2
6 7 8

docs: progdocs userdocs

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
doc-fmt = $(1): $(o)prog.$(1) $(o)bird.$(1)
$(call doc-fmt,html)
$(call doc-fmt,dvi)
$(call doc-fmt,ps)
$(call doc-fmt,pdf)

progdocs: $(o)prog.html $(o)prog.pdf
userdocs: $(o)bird.html $(o)bird.pdf
progspell: $(o)prog.spell

$(o)prog.sgml: $(srcdir)/tools/progdoc $(objdir)/.dir-stamp
	$(srcdir)/tools/progdoc $(srcdir) $@

$(o)%.sgml: $(s)%.sgml $(objdir)/.dir-stamp
	cp $< $@
24

25 26
$(o)%.html: $(o)%.sgml
	cd $(dir $@) && $(sgml2)html $(notdir $<)
27

28 29 30
$(o)%.tex: $(o)%.sgml
	cd $(dir $@) && $(sgml2)latex --output=tex $(notdir $<)

31 32 33
$(o)%.dvi: $(o)%.tex
	cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<)
	cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<)
34

35
$(o)%.ps: $(o)%.dvi
36
	dvips -D600 -ta4 -o $@ $<
37

38 39 40
$(o)%.pdf: $(o)%.tex
	pdflatex -output-directory=$(dir $@) $<
	pdflatex -output-directory=$(dir $@) $<
41

42 43
$(o)%.txt: $(o)%.sgml
	cd $(dir $@) && $(sgml2)txt $(notdir $<)
44

45 46 47
$(o)prog.spell: $(o)prog.sgml $(s)prog-spell.sed
	sed -f $(lastword $^) <$< >$@
	ispell $@
48

49
$(call clean,prog.spell $(addprefix *.,html dvi ps pdf sgml tex txt aux log toc))