File: Makefile

package info (click to toggle)
maint-guide 1.0.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 652 kB
  • ctags: 12
  • sloc: makefile: 104; sh: 8
file content (56 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Makefile for the Debian New Maintainers' Guide
#
# Should work both for a manual in the Debian Documentation Project
# manuals.sgml tree, and for maint-guide package build.

MANUAL :=	$(shell echo $(notdir $(CURDIR)) | perl -pe 's/-[\d.]+$$//')

foo:
	@echo $(MANUAL)

# this can and will be overriden by a higher level makefile
PUBLISHDIR := ../../../public_html/manuals.html

all: html txt ps

# generating HTML
html: $(patsubst %.sgml,%.html/index.html,$(wildcard *.sgml))

$(MANUAL).html/index.html: $(MANUAL).sgml
	debiandoc2html $<

$(MANUAL).%.html/index.html: $(MANUAL).%.sgml
	debiandoc2html -c -l $* $<

# generating plain text
txt text: $(patsubst %.sgml,%.txt,$(wildcard *.sgml))

$(MANUAL).txt: $(MANUAL).sgml
	debiandoc2text $<

$(MANUAL).%.txt: $(MANUAL).%.sgml
	debiandoc2text -l $* $<

# generating PostScript
ps: $(MANUAL).ps

$(MANUAL).ps: $(MANUAL).sgml
	debiandoc2latexps $<

# publishing to the DDP web pages
publish: html
	test -d $(PUBLISHDIR)/$(MANUAL) || install -d -m 755 $(PUBLISHDIR)/$(MANUAL)
	rm -f $(PUBLISHDIR)/$(MANUAL)/*.html
	install -p -m 644 $(MANUAL)*.html/*.html $(PUBLISHDIR)/$(MANUAL)/

# validating SGML
validate:
	set -x; for i in $(wildcard *.sgml); do nsgmls -ges -wall $$i; done

# cleaning up
clean distclean:
	rm -f $(MANUAL)*.{txt,ps,dvi,pdf,info*,log,tex,aux,toc,sasp*} *~
	rm -rf $(MANUAL)*.html

.PHONY: all publish clean distclean validate