--- manuals/trunk/standard.makefile 1998/07/09 20:39:22 623 +++ manuals/trunk/standard.makefile 1998/11/15 09:07:12 714 @@ -5,26 +5,35 @@ # called .sgml, which is the top-level file for the manual # in this directory. -# Where are we, and where are we going? -HERE := $(shell pwd) -THISDIR := $(shell basename `pwd`) -TARGET := ../../../public_html/manuals.html/$(THISDIR) -SGMLFILES := $(shell ls *.sgml) +# What is the current manual's name +MANUAL := $(shell basename $(shell pwd)) +# Where are we publishing to? +# (this can be overriden by a higher level makefile) +PUBLISHDIR := ../../../public_html/manuals.html -# What do we want? -all: html +# What do we want by default? +all: publish # This target installs the generated HTML in the published directory. -html: htmlmade - -rm $(TARGET)/*.html - cp $(THISDIR).html/*.html $(TARGET) - -htmlmade: $(SGMLFILES) - -rm htmlmade - debiandoc2html $(THISDIR).sgml - touch htmlmade +publish: $(MANUAL).html +# fail if there is no PUBLISHDIR + [ -d $(PUBLISHDIR) ] || exit 1 + rm -f $(PUBLISHDIR)/$(MANUAL)/*.html + install -d -m 755 $(PUBLISHDIR)/$(MANUAL) + install -m 644 --preserve-timestamps $(MANUAL).html/*.html \ + $(PUBLISHDIR)/$(MANUAL)/ + +$(MANUAL).html: $(wildcard *.sgml) + debiandoc2html $(MANUAL).sgml + +# ensure our SGML is valid +# (add this to $(MANUAL).html rule to prevent building if not) +validate: + nsgmls -gues $(MANUAL).sgml -clean: - -rm -rf $(THISDIR).html htmlmade +clean: + rm -rf $(MANUAL).html distclean: clean + +.PHONY: all publish clean distclean validate