| 1 |
# Makefile for a manual in the Debian Documentation Project manuals.sgml
|
| 2 |
# tree.
|
| 3 |
|
| 4 |
# The directory in which this makefile resides must also contain a file
|
| 5 |
# called <directoryname>.sgml, which is the top-level file for the manual
|
| 6 |
# in this directory.
|
| 7 |
|
| 8 |
# What is the current manual's name
|
| 9 |
MANUAL := $(shell basename $(shell pwd))
|
| 10 |
# Where are we publishing to?
|
| 11 |
# (this can be overriden by a higher level makefile)
|
| 12 |
PUBLISHDIR := ../../../public_html/manuals.html
|
| 13 |
|
| 14 |
# What do we want by default?
|
| 15 |
all: publish
|
| 16 |
|
| 17 |
# This target installs the generated HTML in the published directory.
|
| 18 |
publish: $(MANUAL).html
|
| 19 |
# fail if there is no PUBLISHDIR
|
| 20 |
[ -d $(PUBLISHDIR) ] || exit 1
|
| 21 |
rm -f $(PUBLISHDIR)/$(MANUAL)/*.html
|
| 22 |
install -d -m 755 $(PUBLISHDIR)/$(MANUAL)
|
| 23 |
install -m 644 --preserve-timestamps $(MANUAL).html/*.html \
|
| 24 |
$(PUBLISHDIR)/$(MANUAL)/
|
| 25 |
|
| 26 |
$(MANUAL).html: $(wildcard *.sgml)
|
| 27 |
debiandoc2html $(MANUAL).sgml
|
| 28 |
|
| 29 |
# ensure our SGML is valid
|
| 30 |
# (add this to $(MANUAL).html rule to prevent building if not)
|
| 31 |
validate:
|
| 32 |
nsgmls -gues $(MANUAL).sgml
|
| 33 |
|
| 34 |
clean:
|
| 35 |
rm -rf $(MANUAL).html
|
| 36 |
|
| 37 |
distclean: clean
|
| 38 |
|
| 39 |
.PHONY: all publish clean distclean validate
|