]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Merge changes from CUPS 1.4svn-r8033.
[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-2008 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 $(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 -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$(DBUSDIR)" != x; then \
320 echo Uninstalling cups.conf in $(DBUSDIR)...;\
321 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
322 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
323 fi
324 $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd
325 $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop
326 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png
327 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png
328 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png
329 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png
330
331
332 #
333 # Run the test suite...
334 #
335
336 test: all
337 echo Running CUPS test suite...
338 cd test; ./run-stp-tests.sh
339
340
341 check: all
342 echo Running CUPS test suite with defaults...
343 cd test; ./run-stp-tests.sh 1 0 n
344
345
346 #
347 # Make software distributions using EPM (http://www.easysw.com/epm/)...
348 #
349
350 EPMFLAGS = -v --output-dir dist $(EPMARCH)
351
352 aix bsd deb depot inst pkg setld slackware swinstall tardist:
353 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
354
355 epm:
356 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
357
358 osx:
359 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
360
361 rpm:
362 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
363
364 .PHONEY: dist
365 dist: all
366 $(RM) -r dist
367 $(MAKE) $(MFLAGS) epm
368 case `uname` in \
369 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
370 Darwin*) $(MAKE) $(MFLAGS) osx;; \
371 IRIX*) $(MAKE) $(MFLAGS) tardist;; \
372 Linux*) $(MAKE) $(MFLAGS) rpm;; \
373 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
374 esac
375
376
377 #
378 # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $".
379 #