]> git.decadent.org.uk Git - dak.git/blob - tools/dsync-0.0/buildlib/debiandoc.mak
debianqueued: remove current directory from @INC
[dak.git] / tools / dsync-0.0 / buildlib / debiandoc.mak
1 # -*- make -*-
2
3 # This processes debian-doc sgml to produce html and plain text output
4
5 # Input
6 # $(SOURCE) - The documents to use
7
8 # All output is writtin to files in the build doc directory
9
10 # See defaults.mak for information about LOCAL
11
12 # Some local definitions
13 LOCAL := debiandoc-$(firstword $(SOURCE))
14 $(LOCAL)-HTML := $(addsuffix .html,$(addprefix $(DOC)/,$(basename $(SOURCE))))
15 $(LOCAL)-TEXT := $(addsuffix .text,$(addprefix $(DOC)/,$(basename $(SOURCE))))
16
17 #---------
18
19 # Rules to build HTML documentations
20 ifdef DEBIANDOC_HTML
21
22 # Install generation hooks
23 doc: $($(LOCAL)-HTML)
24 veryclean: veryclean/html/$(LOCAL)
25
26 vpath %.sgml $(SUBDIRS)
27 $(DOC)/%.html: %.sgml
28         echo Creating html for $< to $@
29         -rm -rf $@
30         (HERE=`pwd`; cd $(@D) && debiandoc2html $$HERE/$<)
31
32 # Clean rule
33 .PHONY: veryclean/html/$(LOCAL)
34 veryclean/html/$(LOCAL):
35         -rm -rf $($(@F)-HTML)
36         
37 endif
38
39 #---------
40
41 # Rules to build Text documentations
42 ifdef DEBIANDOC_TEXT
43
44 # Install generation hooks
45 doc: $($(LOCAL)-TEXT)
46 veryclean: veryclean/text/$(LOCAL)
47
48 vpath %.sgml $(SUBDIRS)
49 $(DOC)/%.text: %.sgml
50         echo Creating text for $< to $@
51         debiandoc2text -O $< > $@
52
53 # Clean rule
54 .PHONY: veryclean/text/$(LOCAL)
55 veryclean/text/$(LOCAL):
56         -rm -rf $($(@F)-TEXT)
57         
58 endif