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