]> granicus.if.org Git - linux-pam/blob - doc/Makefile
Relevant BUGIDs: 129644
[linux-pam] / doc / Makefile
1
2 ### $Id$
3
4 include ../Make.Rules
5
6 # These two should probably be moved into autoconf...
7 DOCDIR=/usr/doc/Linux-PAM
8 MANDIR=/usr/man
9
10 #######################################################
11
12 FILES=pam pam_appl pam_modules
13 FSRCS=pam.sgml pam_appl.sgml pam_modules.sgml
14
15 TEXTS=txts/pam.txt txts/pam_appl.txt txts/pam_modules.txt
16 HTMLS=html/pam.html html/pam_appl.html html/pam_modules.html
17 PSFILES=ps/pam.ps ps/pam_appl.ps ps/pam_modules.ps
18
19 MODULES=$(shell ls modules/*.sgml)
20
21 #######################################################
22
23 dummy:
24         @echo "Making the documentation..."
25         @make all
26
27 all: htmls texts postscript
28
29 htmls: $(HTMLS)
30
31 $(HTMLS) : $(FSRCS)
32 ifeq ($(HAVE_SGML2HTML),yes)
33         @for i in $(FILES) ; do \
34         if [ ! -f "html/$$i.html" ] || [ "$$i.sgml" -nt "html/$$i.html" ]; \
35         then \
36                 cd html ; sgml2html ../$$i ; \
37                 if [ $$? -ne 0 ]; then exit 1 ; fi ; \
38                 cd .. ; \
39         fi ; \
40         done
41 else
42         @echo XXX - you do not have the sgml2html binary installed
43 endif
44
45 texts: $(TEXTS)
46
47 $(TEXTS) : $(FSRCS)
48 ifeq ($(HAVE_SGML2TXT),yes)
49         @for i in $(FILES) ; do \
50                 if [ ! -f "txts/$$i.txt" ] \
51                                 || [ "$$i.sgml" -nt "txts/$$i.txt" ]; then \
52                         cd txts ; sgml2txt ../$$i ; cd .. ; \
53                 fi ; \
54         done
55 else
56         @echo XXX - you do not have the sgml2txt binary installed
57 endif
58
59 postscript: $(PSFILES)
60
61 $(PSFILES): $(FSRCS)
62 ifneq ($(PSER),)
63         @for i in $(FILES) ; do \
64         if [ ! -f "ps/$$i.ps" ] || [ "$$i.sgml" -nt "ps/$$i.ps" ]; then \
65                 cd ps ; $(PSER) ../$$i ; cd .. ; \
66         fi ; \
67         done
68 else
69         @echo XXX - neither sgml2ps nor sgml2latex binaries are installed
70 endif
71
72 pam.sgml: pam_source.sgml MODULES-SGML CREDITS
73         @sed -e '/^<!\-\- insert\-file MODULES\-SGML \-\->/r MODULES-SGML' pam_source.sgml | sed -e '/^<!\-\- insert\-file CREDITS \-\->/r CREDITS' > pam.sgml
74
75 MODULES-SGML: $(MODULES)
76         @echo 'Building module text from files in modules/*.sgml'
77         @rm -f MODULES-SGML
78         @echo '<!-- modules included:' > MODULES-SGML
79         @ls modules/*.sgml >> MODULES-SGML
80         @echo '  and that is all -->' >> MODULES-SGML
81         @cat modules/*.sgml >> MODULES-SGML
82
83 extraclean: clean
84
85 remove:
86         cd man && for file in *.3 ; do \
87           rm -f $(FAKEROOT)$(MANDIR)/man3/$$file ; \
88         done
89         cd man && for file in *.8 ; do \
90           rm -f $(FAKEROOT)$(MANDIR)/man8/$$file ; \
91         done
92         cd txts && for file in *.txt; do \
93           rm -f $(FAKEROOT)$(DOCDIR)/text/$$file ; \
94         done
95         cd ps && for file in *.ps; do \
96           rm -f $(FAKEROOT)$(DOCDIR)/ps/$$file  ; \
97         done
98         cd html && for file in *.html; do \
99           rm -f $(FAKEROOT)$(DOCDIR)/html/$$file ; \
100         done
101
102 install: all
103 ifeq ($(HAVE_SGML2TXT),yes)
104         mkdir -p $(FAKEROOT)$(DOCDIR)/text
105         for file in txts/*.txt; do \
106           install -m 644 $$file $(FAKEROOT)$(DOCDIR)/text ; \
107         done
108 endif
109 ifneq ($(PSER),)
110         mkdir -p $(FAKEROOT)$(DOCDIR)/ps
111         for file in ps/*.ps; do \
112           install -m 644 $$file $(FAKEROOT)$(DOCDIR)/ps  ; \
113         done
114 endif
115 ifeq ($(HAVE_SGML2HTML),yes)
116         mkdir -p $(FAKEROOT)$(DOCDIR)/html
117         for file in html/*.html; do \
118           install -m 644 $$file $(FAKEROOT)$(DOCDIR)/html ; \
119         done
120 endif
121         mkdir -p $(FAKEROOT)$(MANDIR)/man{3,8}
122         for file in man/*.3 ; do \
123           install -m 644 $$file $(FAKEROOT)$(MANDIR)/man3 ; \
124         done
125         for file in man/*.8 ; do \
126           install -m 644 $$file $(FAKEROOT)$(MANDIR)/man8 ; \
127         done
128
129 spec:
130         cd specs/formatter && make
131         specs/formatter/padout < specs/draft-morgan-pam.raw > specs/draft-morgan-pam-current.txt
132
133 releasedocs: all spec
134         tar zvfc Linux-PAM-$(MAJOR_REL).$(MINOR_REL)-docs.tar.gz --exclude CVS  html ps txts specs/draft-morgan-pam-current.txt
135
136 clean:
137         rm -f *~ *.bak
138         rm -f html/pam*.html
139         rm -f man/*~
140         rm -f $(TEXTS)
141         rm -f $(PSFILES) ps/missfont.log
142         rm -f MODULES-SGML pam.sgml
143         rm -f specs/draft-morgan-pam-current.txt
144         make -C specs/formatter clean
145