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