]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Merge changes from CUPS 1.4svn-r8628.
[thirdparty/cups.git] / Makefile
1 #
2 # "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $"
3 #
4 # Top-level Makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2009 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 # Don't run top-level build targets in parallel...
21 #
22
23 .NOTPARALLEL:
24
25
26 #
27 # Directories to make...
28 #
29
30 DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \
31 notifier ppdc scheduler systemv test \
32 $(PHPDIR) \
33 conf data doc examples $(FONTS) templates
34
35
36 #
37 # Make all targets...
38 #
39
40 all:
41 chmod +x cups-config
42 echo Using ARCHFLAGS="$(ARCHFLAGS)"
43 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
44 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
45 echo Using CC="$(CC)"
46 echo Using CXX="$(CC)"
47 echo Using DSOFLAGS="$(DSOFLAGS)"
48 echo Using LDFLAGS="$(LDFLAGS)"
49 echo Using LIBS="$(LIBS)"
50 for dir in $(DIRS); do\
51 echo Making all in $$dir... ;\
52 (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\
53 done
54
55
56 #
57 # Make library targets...
58 #
59
60 libs:
61 echo Using ARCHFLAGS="$(ARCHFLAGS)"
62 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
63 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
64 echo Using CC="$(CC)"
65 echo Using CXX="$(CC)"
66 echo Using DSOFLAGS="$(DSOFLAGS)"
67 echo Using LDFLAGS="$(LDFLAGS)"
68 echo Using LIBS="$(LIBS)"
69 for dir in $(DIRS); do\
70 echo Making libraries in $$dir... ;\
71 (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\
72 done
73
74
75 #
76 # Make unit test targets...
77 #
78
79 unittests:
80 echo Using ARCHFLAGS="$(ARCHFLAGS)"
81 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
82 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
83 echo Using CC="$(CC)"
84 echo Using CXX="$(CC)"
85 echo Using DSOFLAGS="$(DSOFLAGS)"
86 echo Using LDFLAGS="$(LDFLAGS)"
87 echo Using LIBS="$(LIBS)"
88 for dir in $(DIRS); do\
89 echo Making all in $$dir... ;\
90 (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
91 done
92
93
94 #
95 # Remove object and target files...
96 #
97
98 clean:
99 for dir in $(DIRS); do\
100 echo Cleaning in $$dir... ;\
101 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
102 done
103
104
105 #
106 # Remove all non-distribution files...
107 #
108
109 distclean: clean
110 $(RM) Makedefs config.h config.log config.status
111 $(RM) cups-config
112 $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
113 $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html
114 $(RM) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist
115 $(RM) man/client.conf.man
116 $(RM) man/cups-deviced.man man/cups-driverd.man
117 $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
118 $(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
119 $(RM) packaging/cups.list
120 $(RM) packaging/cups-desc.plist packaging/cups-info.plist
121 $(RM) templates/header.tmpl
122 $(RM) desktop/cups.desktop
123 $(RM) init/cups.xml
124 -$(RM) doc/*/index.html
125 -$(RM) templates/*/header.tmpl
126 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
127
128
129 #
130 # Make dependencies
131 #
132
133 depend:
134 for dir in $(DIRS); do\
135 echo Making dependencies in $$dir... ;\
136 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
137 done
138
139
140 #
141 # Run the clang.llvm.org static code analysis tool on the C sources.
142 #
143
144 .PHONY: clang
145 clang:
146 $(RM) -r clang
147 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) \
148 CC=ccc-analyzer CXX=ccc-analyzer clean all
149
150
151 #
152 # Generate a ctags file...
153 #
154
155 ctags:
156 ctags -R .
157
158
159 #
160 # Install everything...
161 #
162
163 install: install-data install-headers install-libs install-exec
164
165
166 #
167 # Install data files...
168 #
169
170 install-data:
171 for dir in $(DIRS); do\
172 echo Installing data files in $$dir... ;\
173 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
174 done
175 echo Installing cups-config script...
176 $(INSTALL_DIR) -m 755 $(BINDIR)
177 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
178 if test "x$(INITDIR)" != x; then \
179 echo Installing init scripts...; \
180 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
181 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
182 for level in $(RCLEVELS); do \
183 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
184 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
185 if test `uname` = HP-UX; then \
186 level=`expr $$level - 1`; \
187 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
188 fi; \
189 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
190 done; \
191 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
192 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
193 fi
194 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
195 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
196 if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
197 echo Installing LaunchDaemons configuration files...; \
198 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
199 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
200 case `uname -r` in \
201 8.*) \
202 $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
203 $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
204 $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
205 $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
206 $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
207 ;; \
208 esac \
209 else \
210 echo Installing RC script...; \
211 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
212 fi \
213 fi
214 if test "x$(SMFMANIFESTDIR)" != x; then \
215 echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
216 $(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
217 $(INSTALL_SCRIPT) init/cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
218 fi
219 if test "x$(DBUSDIR)" != x; then \
220 echo Installing cups.conf in $(DBUSDIR)...;\
221 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
222 $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
223 fi
224 if test "x$(XINETD)" != x; then \
225 echo Installing xinetd configuration file for cups-lpd...; \
226 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
227 $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
228 fi
229 if test "x$(MENUDIR)" != x; then \
230 echo Installing desktop menu...; \
231 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
232 $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
233 fi
234 if test "x$(ICONDIR)" != x; then \
235 echo Installing desktop icons...; \
236 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \
237 $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
238 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \
239 $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
240 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \
241 $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
242 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \
243 $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
244 fi
245
246 #
247 # Install header files...
248 #
249
250 install-headers:
251 for dir in $(DIRS); do\
252 echo Installing header files in $$dir... ;\
253 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
254 done
255
256
257 #
258 # Install programs...
259 #
260
261 install-exec: all
262 for dir in $(DIRS); do\
263 echo Installing programs in $$dir... ;\
264 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
265 done
266
267
268 #
269 # Install libraries...
270 #
271
272 install-libs: libs
273 for dir in $(DIRS); do\
274 echo Installing libraries in $$dir... ;\
275 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
276 done
277
278
279 #
280 # Uninstall object and target files...
281 #
282
283 uninstall:
284 for dir in $(DIRS); do\
285 echo Uninstalling in $$dir... ;\
286 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
287 done
288 echo Uninstalling cups-config script...
289 $(RM) $(BINDIR)/cups-config
290 -$(RMDIR) $(BINDIR)
291 echo Uninstalling startup script...
292 if test "x$(INITDIR)" != x; then \
293 $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
294 $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
295 $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
296 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
297 $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
298 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
299 $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
300 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
301 $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
302 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
303 fi
304 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
305 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
306 $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
307 $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
308 $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
309 $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
310 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
311 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
312 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
313 $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
314 else \
315 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
316 fi \
317 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
318 fi
319 if test "x$(SMFMANIFESTDIR)" != x; then \
320 echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\
321 $(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
322 fi
323 if test "x$(DBUSDIR)" != x; then \
324 echo Uninstalling cups.conf in $(DBUSDIR)...;\
325 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
326 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
327 fi
328 if test "x$(XINETD)" != x; then \
329 echo Uninstalling xinetd configuration file for cups-lpd...; \
330 $(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
331 fi
332 if test "x$(MENUDIR)" != x; then \
333 echo Uninstalling desktop menu...; \
334 $(RM) $(BUILDROOT)$(MENUDIR)/cups.desktop; \
335 fi
336 if test "x$(ICONDIR)" != x; then \
337 echo Uninstalling desktop icons...; \
338 $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
339 $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
340 $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
341 $(RM) $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
342 fi
343
344
345 #
346 # Run the test suite...
347 #
348
349 test: all unittests
350 echo Running CUPS test suite...
351 cd test; ./run-stp-tests.sh
352
353
354 check: all unittests
355 echo Running CUPS test suite with defaults...
356 cd test; ./run-stp-tests.sh 1 0 n
357
358
359 #
360 # Create HTML documentation...
361 #
362
363 apihelp:
364 for dir in cgi-bin cups filter driver ppdc scheduler; do\
365 echo Generating API help in $$dir... ;\
366 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
367 done
368
369 framedhelp:
370 for dir in cgi-bin cups filter driver ppdc scheduler; do\
371 echo Generating framed API help in $$dir... ;\
372 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
373 done
374
375
376 #
377 # Create an Xcode docset...
378 #
379
380 docset: apihelp
381 echo Generating docset directory tree...
382 $(RM) -r org.cups.docset
383 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
384 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
385 cd man; $(MAKE) $(MFLAGS) html
386 cd doc; $(MAKE) $(MFLAGS) docset
387 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
388 cgi-bin/makedocset org.cups.docset \
389 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
390 doc/help/api-*.tokens
391 $(RM) doc/help/api-*.tokens
392 echo Indexing docset...
393 /Developer/usr/bin/docsetutil index org.cups.docset
394 echo Generating docset archive and feed...
395 /Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
396 --atom org.cups.docset.atom \
397 --download-url http://www.cups.org/org.cups.docset.xar \
398 org.cups.docset
399
400
401 #
402 # Make software distributions using EPM (http://www.easysw.com/epm/)...
403 #
404
405 EPMFLAGS = -v --output-dir dist $(EPMARCH)
406
407 aix bsd deb depot inst pkg setld slackware swinstall tardist:
408 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
409
410 epm:
411 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
412
413 osx:
414 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
415
416 rpm:
417 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
418
419 .PHONEY: dist
420 dist: all
421 $(RM) -r dist
422 $(MAKE) $(MFLAGS) epm
423 case `uname` in \
424 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
425 Darwin*) $(MAKE) $(MFLAGS) osx;; \
426 IRIX*) $(MAKE) $(MFLAGS) tardist;; \
427 Linux*) $(MAKE) $(MFLAGS) rpm;; \
428 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
429 esac
430
431
432 #
433 # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $".
434 #