]>
Commit | Line | Data |
---|---|---|
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) templates/header.tmpl | |
121 | $(RM) desktop/cups.desktop | |
122 | $(RM) init/cups.xml | |
123 | -$(RM) doc/*/index.html | |
124 | -$(RM) templates/*/header.tmpl | |
125 | -$(RM) -r autom4te*.cache | |
126 | ||
127 | ||
128 | # | |
129 | # Make dependencies | |
130 | # | |
131 | ||
132 | depend: | |
133 | for dir in $(DIRS); do\ | |
134 | echo Making dependencies in $$dir... ;\ | |
135 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
136 | done | |
137 | ||
138 | ||
139 | # | |
140 | # Run the clang.llvm.org static code analysis tool on the C sources. | |
141 | # | |
142 | ||
143 | .PHONY: clang | |
144 | clang: | |
145 | $(RM) -r clang | |
146 | scan-build -k -o `pwd`/clang $(MAKE) $(MFLAGS) \ | |
147 | CC=ccc-analyzer CXX=ccc-analyzer clean all | |
148 | ||
149 | ||
150 | # | |
151 | # Generate a ctags file... | |
152 | # | |
153 | ||
154 | ctags: | |
155 | ctags -R . | |
156 | ||
157 | ||
158 | # | |
159 | # Install everything... | |
160 | # | |
161 | ||
162 | install: install-data install-headers install-libs install-exec | |
163 | ||
164 | ||
165 | # | |
166 | # Install data files... | |
167 | # | |
168 | ||
169 | install-data: | |
170 | for dir in $(DIRS); do\ | |
171 | echo Installing data files in $$dir... ;\ | |
172 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
173 | done | |
174 | echo Installing cups-config script... | |
175 | $(INSTALL_DIR) -m 755 $(BINDIR) | |
176 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config | |
177 | if test "x$(INITDIR)" != x; then \ | |
178 | echo Installing init scripts...; \ | |
179 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ | |
180 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ | |
181 | for level in $(RCLEVELS); do \ | |
182 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
183 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \ | |
184 | if test `uname` = HP-UX; then \ | |
185 | level=`expr $$level - 1`; \ | |
186 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
187 | fi; \ | |
188 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \ | |
189 | done; \ | |
190 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
191 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \ | |
192 | fi | |
193 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ | |
194 | $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ | |
195 | if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
196 | echo Installing LaunchDaemons configuration files...; \ | |
197 | $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ | |
198 | $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \ | |
199 | case `uname -r` in \ | |
200 | 8.*) \ | |
201 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
202 | $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ | |
203 | $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ | |
204 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ | |
205 | $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ | |
206 | ;; \ | |
207 | esac \ | |
208 | else \ | |
209 | echo Installing RC script...; \ | |
210 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
211 | fi \ | |
212 | fi | |
213 | if test "x$(SMFMANIFESTDIR)" != x; then \ | |
214 | echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\ | |
215 | $(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \ | |
216 | $(INSTALL_SCRIPT) init/cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \ | |
217 | fi | |
218 | if test "x$(DBUSDIR)" != x; then \ | |
219 | echo Installing cups.conf in $(DBUSDIR)...;\ | |
220 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \ | |
221 | $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \ | |
222 | fi | |
223 | if test "x$(XINETD)" != x; then \ | |
224 | echo Installing xinetd configuration file for cups-lpd...; \ | |
225 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \ | |
226 | $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \ | |
227 | fi | |
228 | if test "x$(MENUDIR)" != x; then \ | |
229 | echo Installing desktop menu...; \ | |
230 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \ | |
231 | $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \ | |
232 | fi | |
233 | if test "x$(ICONDIR)" != x; then \ | |
234 | echo Installing desktop icons...; \ | |
235 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \ | |
236 | $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ | |
237 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \ | |
238 | $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ | |
239 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \ | |
240 | $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ | |
241 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \ | |
242 | $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ | |
243 | fi | |
244 | ||
245 | # | |
246 | # Install header files... | |
247 | # | |
248 | ||
249 | install-headers: | |
250 | for dir in $(DIRS); do\ | |
251 | echo Installing header files in $$dir... ;\ | |
252 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
253 | done | |
254 | ||
255 | ||
256 | # | |
257 | # Install programs... | |
258 | # | |
259 | ||
260 | install-exec: all | |
261 | for dir in $(DIRS); do\ | |
262 | echo Installing programs in $$dir... ;\ | |
263 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ | |
264 | done | |
265 | ||
266 | ||
267 | # | |
268 | # Install libraries... | |
269 | # | |
270 | ||
271 | install-libs: libs | |
272 | for dir in $(DIRS); do\ | |
273 | echo Installing libraries in $$dir... ;\ | |
274 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ | |
275 | done | |
276 | ||
277 | ||
278 | # | |
279 | # Uninstall object and target files... | |
280 | # | |
281 | ||
282 | uninstall: | |
283 | for dir in $(DIRS); do\ | |
284 | echo Uninstalling in $$dir... ;\ | |
285 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
286 | done | |
287 | echo Uninstalling cups-config script... | |
288 | $(RM) $(BINDIR)/cups-config | |
289 | -$(RMDIR) $(BINDIR) | |
290 | echo Uninstalling startup script... | |
291 | if test "x$(INITDIR)" != x; then \ | |
292 | $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \ | |
293 | $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \ | |
294 | $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ | |
295 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
296 | $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ | |
297 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ | |
298 | $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ | |
299 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ | |
300 | $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ | |
301 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ | |
302 | fi | |
303 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ | |
304 | if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ | |
305 | $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \ | |
306 | $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ | |
307 | $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ | |
308 | $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ | |
309 | elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
310 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \ | |
311 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \ | |
312 | $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
313 | else \ | |
314 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
315 | fi \ | |
316 | $(RMDIR) $(BUILDROOT)$(INITDDIR); \ | |
317 | fi | |
318 | if test "x$(DBUSDIR)" != x; then \ | |
319 | echo Uninstalling cups.conf in $(DBUSDIR)...;\ | |
320 | $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ | |
321 | $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ | |
322 | fi | |
323 | $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd | |
324 | $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop | |
325 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png | |
326 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png | |
327 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png | |
328 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png | |
329 | ||
330 | ||
331 | # | |
332 | # Run the test suite... | |
333 | # | |
334 | ||
335 | test: all | |
336 | echo Running CUPS test suite... | |
337 | cd test; ./run-stp-tests.sh | |
338 | ||
339 | ||
340 | check: all | |
341 | echo Running CUPS test suite with defaults... | |
342 | cd test; ./run-stp-tests.sh 1 0 n | |
343 | ||
344 | ||
345 | # | |
346 | # Make software distributions using EPM (http://www.easysw.com/epm/)... | |
347 | # | |
348 | ||
349 | EPMFLAGS = -v --output-dir dist $(EPMARCH) | |
350 | ||
351 | aix bsd deb depot inst pkg setld slackware swinstall tardist: | |
352 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list | |
353 | ||
354 | epm: | |
355 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list | |
356 | ||
357 | osx: | |
358 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
359 | ||
360 | rpm: | |
361 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
362 | ||
363 | .PHONEY: dist | |
364 | dist: all | |
365 | $(RM) -r dist | |
366 | $(MAKE) $(MFLAGS) epm | |
367 | case `uname` in \ | |
368 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
369 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
370 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
371 | Linux*) $(MAKE) $(MFLAGS) rpm;; \ | |
372 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
373 | esac | |
374 | ||
375 | ||
376 | # | |
377 | # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $". | |
378 | # |