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