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