Debian Codegraph @

doc/developer/Makefile.am

raw
1 ## Copyright (C) 2001 Andy Stewart and Roger Leigh
2 ##
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2, or (at your option)
6 ## any later version.
7 ##
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
12 ##
13 ## You should have received a copy of the GNU General Public License
14 ## along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16 ## Process this file with automake to produce Makefile.in.
17
18 @SET_MAKE@
19
20 include $(top_srcdir)/scripts/global.mk
21
22
23 ## Variables
24
25 MANUAL_SRC_FILES = \
26 copying.xml \
27 dither.xml \
28 escp2.xml \
29 gutenprint.xml \
30 gpl-appendix.xml \
31 introduction.xml \
32 new-printer.xml \
33 problems.xml \
34 using.xml \
35 weave.xml
36
37 HTMLDIR = reference-html
38
39 if BUILD_DOC
40 STANDARD_TARGETS = html
41 endif
42
43 DISTHOOKDIRS = $(HTMLDIR)
44
45
46 if MAINTAINER_MODE
47 MAINT_MODE = true
48 else
49 MAINT_MODE = false
50 endif
51
52 if MAINTAINER_MODE
53 if BUILD_DOC
54 ALL_LOCAL_TARGETS = docs
55 endif
56 else
57 if BUILD_DOC
58 ALL_LOCAL_TARGETS = $(STANDARD_TARGETS)
59 endif
60 endif
61
62 all-local: $(ALL_LOCAL_TARGETS)
63
64
65 ## Rules
66
67 dist-hook: html-stamp
68 for dir in $(DISTHOOKDIRS) ; do \
69 if test -d $(srcdir)/$$dir ; then \
70 mkdir $(distdir)/$$dir; \
71 for dirfile in $(srcdir)/$$dir/*; do \
72 if test -f $$dirfile ; then \
73 cp -p $$dirfile $(distdir)/$$dir ; \
74 fi ; \
75 if test -d $$dirfile ; then \
76 cp -pR $$dirfile $(distdir)/$$dir ; \
77 fi ; \
78 done \
79 fi \
80 done
81 for file in $(DISTHOOKFILES) ; do \
82 if test -f $$file ; then \
83 cp -p $$file $(distdir) ; \
84 fi ; \
85 done
86
87 docs: html pdf
88
89 pdf: gutenprint.pdf
90
91 gutenprint.pdf: $(MANUAL_SRC_FILES)
92 @if [ -z "$(DB2PDF)" ] ; then \
93 echo "No db2pdf: cannot build documentation!"; \
94 exit 1; \
95 fi
96 if test $(srcdir) = '.' ; then \
97 : ; \
98 else \
99 for file in $(MANUAL_SRC_FILES) ; do \
100 if test -L $$file ; then \
101 $(RM) -f $$file ; \
102 fi ; \
103 $(LN_S) -f $(srcdir)/$$file $$file ; \
104 done ; \
105 fi ; \
106 $(DB2PDF) gutenprint.xml 2>&1 | $(PERL) ./cleanwarnings.pl
107
108 html: html-stamp
109
110 # This ugly workaround with SOURCE is because db2html doesn't seem to like
111 # "./users-guide.sgml". Note that db2ps does not have the same limitation.
112 # html-stamp should *only* be called by html--it's just a timestamp!
113
114 html-stamp: $(MANUAL_SRC_FILES)
115 @if [ -z "$(DB2HTML)" ] ; then \
116 echo "No db2html: cannot build documentation!"; \
117 exit 1; \
118 fi
119 if test $(srcdir) = '.' ; then \
120 : ; \
121 else \
122 for file in $(MANUAL_SRC_FILES) ; do \
123 if test -L $$file ; then \
124 $(RM) -f $$file ; \
125 fi ; \
126 $(LN_S) -f $(srcdir)/$$file $$file ; \
127 done ; \
128 fi
129 -$(RM) -rf gutenprint
130 $(MKDIR_P) gutenprint
131 cd gutenprint && $(DB2HTML) ../gutenprint.xml
132 -$(RM) -rf $(HTMLDIR)
133 mv gutenprint $(HTMLDIR)
134 chmod a+rx $(HTMLDIR)
135 touch html-stamp
136
137 install-data-local: $(STANDARD_TARGETS)
138 if test -n '$(STANDARD_TARGETS)' ; then \
139 $(MKDIR_P) $(DESTDIR)$(datadir)/$(PACKAGE)/doc/$(HTMLDIR) ; \
140 if test -f gutenprint.pdf ; then \
141 $(INSTALL_DATA) gutenprint.pdf $(DESTDIR)$(datadir)/$(PACKAGE)/doc ; \
142 elif test -f $(srcdir)/gutenprint.pdf ; then \
143 $(INSTALL_DATA) $(srcdir)/gutenprint.pdf $(DESTDIR)$(datadir)/$(PACKAGE)/doc ; \
144 fi ; \
145 if test -d $(HTMLDIR) ; then \
146 HTMLGENDIR="$(HTMLDIR)" ; \
147 elif test -d $(srcdir)/$(HTMLDIR) ; then \
148 HTMLGENDIR="$(srcdir)/$(HTMLDIR)" ; \
149 else \
150 exit 1 ; \
151 fi ; \
152 for file in $$HTMLGENDIR/*.html $$HTMLGENDIR/*.css ; do \
153 if test -f $$file ; then \
154 $(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/$(PACKAGE)/doc/$(HTMLDIR) ; \
155 fi ; \
156 done ; \
157 fi
158
159 uninstall-local:
160 -$(RM) -r $(DESTDIR)$(datadir)/$(PACKAGE)/doc
161
162 CLEAN_MANUALS = \
163 $(RM) -f gutenprint.pdf gutenprint.ps; \
164 $(RM) -rf *html-stamp $(HTMLDIR)
165
166 clean-local:
167 if test $(srcdir) = "." -a $(MAINT_MODE) = false ; then \
168 echo "clean-local: Not removing $(HTMLDIR)" ; \
169 echo 'clean-local: Not removing gutenprint.pdf' ; \
170 echo 'clean-local: Not removing gutenprint.ps' ; \
171 else \
172 $(CLEAN_MANUALS) ; \
173 fi
174 if test $(srcdir) = "." ; then \
175 : ; \
176 else \
177 $(RM) -f $(MANUAL_SRC_FILES) ; \
178 fi
179 -$(RM) -rf *.tex *.log *.aux *.dvi *.gz *.out *.junk *.out *.fot
180 -$(RM) -rf db2html* DB2HTML* CATALOG.local
181
182 veryclean:
183 $(MAKE) MAINT_MODE=true clean
184
185 maintainer-clean-local:
186 $(CLEAN_MANUALS)
187
188
189 ## Clean
190
191 MAINTAINERCLEANFILES = Makefile.in *html-stamp
192
193
194 EXTRA_DIST = \
195 $(MANUAL_SRC_FILES) \
196 gutenprint.pdf \
197 html-stamp
198
199 .PHONY: docs html ps pdf