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