]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Make sure clean and distclean remove all generated files.
[thirdparty/cups.git] / Makefile
1 #
2 # "$Id$"
3 #
4 # Top-level Makefile for CUPS.
5 #
6 # Copyright 2007-2014 by Apple Inc.
7 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
8 #
9 # These coded instructions, statements, and computer programs are the
10 # property of Apple Inc. and are protected by Federal copyright
11 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 # which should have been included with this file. If this file is
13 # file is missing or damaged, see the license at "http://www.cups.org/".
14 #
15
16 include Makedefs
17
18
19 #
20 # Directories to make...
21 #
22
23 DIRS = cups test $(BUILDDIRS)
24
25
26 #
27 # Make all targets...
28 #
29
30 all:
31 chmod +x cups-config
32 echo Using ARCHFLAGS="$(ARCHFLAGS)"
33 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
34 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
35 echo Using CC="$(CC)"
36 echo Using CXX="$(CC)"
37 echo Using DSOFLAGS="$(DSOFLAGS)"
38 echo Using LDFLAGS="$(LDFLAGS)"
39 echo Using LIBS="$(LIBS)"
40 for dir in $(DIRS); do\
41 echo Making all in $$dir... ;\
42 (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\
43 done
44
45
46 #
47 # Make library targets...
48 #
49
50 libs:
51 echo Using ARCHFLAGS="$(ARCHFLAGS)"
52 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
53 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
54 echo Using CC="$(CC)"
55 echo Using CXX="$(CC)"
56 echo Using DSOFLAGS="$(DSOFLAGS)"
57 echo Using LDFLAGS="$(LDFLAGS)"
58 echo Using LIBS="$(LIBS)"
59 for dir in $(DIRS); do\
60 echo Making libraries in $$dir... ;\
61 (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\
62 done
63
64
65 #
66 # Make unit test targets...
67 #
68
69 unittests:
70 echo Using ARCHFLAGS="$(ARCHFLAGS)"
71 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
72 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
73 echo Using CC="$(CC)"
74 echo Using CXX="$(CC)"
75 echo Using DSOFLAGS="$(DSOFLAGS)"
76 echo Using LDFLAGS="$(LDFLAGS)"
77 echo Using LIBS="$(LIBS)"
78 for dir in $(DIRS); do\
79 echo Making all in $$dir... ;\
80 (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
81 done
82
83
84 #
85 # Remove object and target files...
86 #
87
88 clean:
89 for dir in $(DIRS); do\
90 echo Cleaning in $$dir... ;\
91 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
92 done
93
94
95 #
96 # Remove all non-distribution files...
97 #
98
99 distclean: clean
100 $(RM) Makedefs config.h config.log config.status
101 $(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
102 $(RM) cups-config
103 $(RM) data/testprint
104 $(RM) desktop/cups.desktop
105 $(RM) doc/index.html
106 $(RM) man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man
107 $(RM) packaging/cups.list
108 $(RM) scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket
109 $(RM) templates/header.tmpl
110 -$(RM) doc/*/index.html
111 -$(RM) templates/*/header.tmpl
112 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
113
114
115 #
116 # Make dependencies
117 #
118
119 depend:
120 for dir in $(DIRS); do\
121 echo Making dependencies in $$dir... ;\
122 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
123 done
124
125
126 #
127 # Run the Clang static code analysis tool on the sources, available here:
128 #
129 # http://clang-analyzer.llvm.org
130 #
131 # At least checker-231 is required.
132 #
133
134 .PHONY: clang clang-changes
135 clang:
136 $(RM) -r clang
137 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
138 clang-changes:
139 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
140
141
142 #
143 # Run the STACK tool on the sources, available here:
144 #
145 # http://css.csail.mit.edu/stack/
146 #
147 # Do the following to pass options to configure:
148 #
149 # make CONFIGFLAGS="--foo --bar" stack
150 #
151
152 .PHONY: stack
153 stack:
154 stack-build ./configure $(CONFIGFLAGS)
155 stack-build $(MAKE) $(MFLAGS) clean all
156 poptck
157 $(MAKE) $(MFLAGS) distclean
158 $(RM) */*.ll
159 $(RM) */*.ll.out
160
161
162 #
163 # Generate a ctags file...
164 #
165
166 ctags:
167 ctags -R .
168
169
170 #
171 # Install everything...
172 #
173
174 install: install-data install-headers install-libs install-exec
175
176
177 #
178 # Install data files...
179 #
180
181 install-data:
182 echo Making all in cups...
183 (cd cups; $(MAKE) $(MFLAGS) all)
184 for dir in $(DIRS); do\
185 echo Installing data files in $$dir... ;\
186 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
187 done
188 echo Installing cups-config script...
189 $(INSTALL_DIR) -m 755 $(BINDIR)
190 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
191
192
193 #
194 # Install header files...
195 #
196
197 install-headers:
198 for dir in $(DIRS); do\
199 echo Installing header files in $$dir... ;\
200 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
201 done
202 if test "x$(privateinclude)" != x; then \
203 echo Installing config.h into $(PRIVATEINCLUDE)...; \
204 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
205 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
206 fi
207
208
209 #
210 # Install programs...
211 #
212
213 install-exec: all
214 for dir in $(DIRS); do\
215 echo Installing programs in $$dir... ;\
216 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
217 done
218
219
220 #
221 # Install libraries...
222 #
223
224 install-libs: libs
225 for dir in $(DIRS); do\
226 echo Installing libraries in $$dir... ;\
227 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
228 done
229
230
231 #
232 # Uninstall object and target files...
233 #
234
235 uninstall:
236 for dir in $(DIRS); do\
237 echo Uninstalling in $$dir... ;\
238 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
239 done
240 echo Uninstalling cups-config script...
241 $(RM) $(BINDIR)/cups-config
242 -$(RMDIR) $(BINDIR)
243
244
245 #
246 # Run the test suite...
247 #
248
249 test: all unittests
250 echo Running CUPS test suite...
251 cd test; ./run-stp-tests.sh
252
253
254 check: all unittests
255 echo Running CUPS test suite with defaults...
256 cd test; ./run-stp-tests.sh 1 0 n n
257
258 debugcheck: all unittests
259 echo Running CUPS test suite with debug printfs...
260 cd test; ./run-stp-tests.sh 1 0 n y
261
262
263 #
264 # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
265 #
266
267 apihelp:
268 for dir in cgi-bin cups filter ppdc scheduler; do\
269 echo Generating API help in $$dir... ;\
270 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
271 done
272
273 framedhelp:
274 for dir in cgi-bin cups filter ppdc scheduler; do\
275 echo Generating framed API help in $$dir... ;\
276 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
277 done
278
279
280 #
281 # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
282 #
283
284 docset: apihelp
285 echo Generating docset directory tree...
286 $(RM) -r org.cups.docset
287 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
288 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
289 cd man; $(MAKE) $(MFLAGS) html
290 cd doc; $(MAKE) $(MFLAGS) docset
291 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
292 cgi-bin/makedocset org.cups.docset \
293 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
294 doc/help/api-*.tokens
295 $(RM) doc/help/api-*.tokens
296 echo Indexing docset...
297 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
298 echo Generating docset archive and feed...
299 $(RM) org.cups.docset.atom
300 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
301 --atom org.cups.docset.atom \
302 --download-url http://www.cups.org/org.cups.docset.xar \
303 org.cups.docset
304
305
306 #
307 # Lines of code computation...
308 #
309
310 sloc:
311 for dir in cups scheduler; do \
312 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
313 done
314
315
316 #
317 # Make software distributions using EPM (http://www.msweet.org/)...
318 #
319
320 EPMFLAGS = -v --output-dir dist $(EPMARCH)
321
322 bsd deb pkg slackware:
323 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
324
325 epm:
326 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
327
328 rpm:
329 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
330
331 .PHONEY: dist
332 dist: all
333 $(RM) -r dist
334 $(MAKE) $(MFLAGS) epm
335 case `uname` in \
336 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
337 Darwin*) $(MAKE) $(MFLAGS) osx;; \
338 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
339 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
340 esac
341
342
343 #
344 # Don't run top-level build targets in parallel...
345 #
346
347 .NOTPARALLEL:
348
349
350 #
351 # End of "$Id$".
352 #