]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
75bd9771 | 2 | # "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $" |
ef416fc2 | 3 | # |
4 | # Top-level Makefile for the Common UNIX Printing System (CUPS). | |
5 | # | |
91c84a35 | 6 | # Copyright 2007-2008 by Apple Inc. |
f7deaa1a | 7 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | # |
9 | # These coded instructions, statements, and computer programs are the | |
bc44d920 | 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/". | |
ef416fc2 | 14 | # |
15 | ||
16 | include Makedefs | |
17 | ||
18 | # | |
19 | # Directories to make... | |
20 | # | |
21 | ||
ac884b6a MS |
22 | DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \ |
23 | notifier ppdc scheduler systemv test \ | |
757d2cad | 24 | $(PHPDIR) \ |
634763e8 | 25 | conf data doc $(FONTS) templates |
bd7854cb | 26 | |
ef416fc2 | 27 | |
28 | # | |
29 | # Make all targets... | |
30 | # | |
31 | ||
32 | all: | |
33 | chmod +x cups-config | |
c9fc04c6 | 34 | echo Using ARCHFLAGS="$(ARCHFLAGS)" |
ac884b6a MS |
35 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" |
36 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
c9fc04c6 | 37 | echo Using DSOFLAGS="$(DSOFLAGS)" |
ac884b6a MS |
38 | echo Using LDFLAGS="$(LDFLAGS)" |
39 | echo Using LIBS="$(LIBS)" | |
ef416fc2 | 40 | for dir in $(DIRS); do\ |
41 | echo Making all in $$dir... ;\ | |
c9fc04c6 MS |
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\ | |
8922323b | 58 | echo Making libraries in $$dir... ;\ |
c9fc04c6 | 59 | (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\ |
ef416fc2 | 60 | done |
61 | ||
bd7854cb | 62 | |
ef416fc2 | 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 | ||
bd7854cb | 73 | |
a9252913 | 74 | # |
75 | # Remove all non-distribution files... | |
76 | # | |
77 | ||
78 | distclean: clean | |
79 | $(RM) Makedefs config.h config.log config.status | |
0a682745 MS |
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 | |
b94498cf | 84 | $(RM) man/client.conf.man |
a9252913 | 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 | |
f7deaa1a | 88 | $(RM) packaging/cups.list |
db1f069b | 89 | $(RM) templates/header.tmpl |
a9252913 | 90 | -$(RM) doc/*/index.html |
a9252913 | 91 | -$(RM) templates/*/header.tmpl |
92 | -$(RM) -r autom4te*.cache | |
93 | ||
94 | ||
ef416fc2 | 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 | ||
1f0275e3 MS |
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)" clean all | |
118 | ||
119 | ||
b94498cf | 120 | # |
121 | # Generate a ctags file... | |
122 | # | |
123 | ||
124 | ctags: | |
125 | ctags -R . | |
126 | ||
127 | ||
ef416fc2 | 128 | # |
50fe7201 | 129 | # Install everything... |
ef416fc2 | 130 | # |
131 | ||
50fe7201 MS |
132 | install: install-data install-headers install-libs install-exec |
133 | ||
134 | ||
135 | # | |
136 | # Install data files... | |
137 | # | |
138 | ||
139 | install-data: | |
ef416fc2 | 140 | for dir in $(DIRS); do\ |
50fe7201 MS |
141 | echo Installing data files in $$dir... ;\ |
142 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
ef416fc2 | 143 | done |
ef416fc2 | 144 | echo Installing cups-config script... |
757d2cad | 145 | $(INSTALL_DIR) -m 755 $(BINDIR) |
ef416fc2 | 146 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config |
e1d6a774 | 147 | if test "x$(INITDIR)" != x; then \ |
f301802f | 148 | echo Installing init scripts...; \ |
757d2cad | 149 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ |
fa73b229 | 150 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ |
f7deaa1a | 151 | for level in $(RCLEVELS); do \ |
152 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
153 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \ | |
154 | if test `uname` = HP-UX; then \ | |
155 | level=`expr $$level - 1`; \ | |
156 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
157 | fi; \ | |
158 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \ | |
159 | done; \ | |
757d2cad | 160 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \ |
f7deaa1a | 161 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \ |
ef416fc2 | 162 | fi |
e1d6a774 | 163 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ |
ef416fc2 | 164 | $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ |
a41f09e2 | 165 | if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ |
d09495fa | 166 | echo Installing LaunchDaemons configuration files...; \ |
e00b005a | 167 | $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ |
d09495fa | 168 | $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \ |
3d8365b8 | 169 | case `uname -r` in \ |
170 | 8.*) \ | |
171 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
172 | $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ | |
173 | $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ | |
174 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ | |
175 | $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ | |
176 | ;; \ | |
177 | esac \ | |
ef416fc2 | 178 | else \ |
f301802f | 179 | echo Installing RC script...; \ |
fa73b229 | 180 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ |
ef416fc2 | 181 | fi \ |
182 | fi | |
e1d6a774 | 183 | if test "x$(DBUSDIR)" != x; then \ |
b423cd4c | 184 | echo Installing cups.conf in $(DBUSDIR)...;\ |
f7deaa1a | 185 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \ |
186 | $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \ | |
bd7854cb | 187 | fi |
e1d6a774 | 188 | if test "x$(XINETD)" != x; then \ |
189 | echo Installing xinetd configuration file for cups-lpd...; \ | |
190 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \ | |
191 | $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \ | |
192 | fi | |
f7deaa1a | 193 | if test "x$(MENUDIR)" != x; then \ |
194 | echo Installing desktop menu...; \ | |
195 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \ | |
196 | $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \ | |
197 | fi | |
198 | if test "x$(ICONDIR)" != x; then \ | |
e1d6a774 | 199 | echo Installing desktop icons...; \ |
f7deaa1a | 200 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \ |
201 | $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ | |
202 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \ | |
203 | $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ | |
204 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \ | |
205 | $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ | |
206 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \ | |
207 | $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ | |
e1d6a774 | 208 | fi |
ef416fc2 | 209 | |
50fe7201 MS |
210 | # |
211 | # Install header files... | |
212 | # | |
213 | ||
214 | install-headers: | |
215 | for dir in $(DIRS); do\ | |
216 | echo Installing header files in $$dir... ;\ | |
217 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
218 | done | |
219 | ||
ef416fc2 | 220 | |
221 | # | |
50fe7201 | 222 | # Install programs... |
ef416fc2 | 223 | # |
224 | ||
c9fc04c6 | 225 | install-exec: all |
50fe7201 MS |
226 | for dir in $(DIRS); do\ |
227 | echo Installing programs in $$dir... ;\ | |
c9fc04c6 | 228 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ |
50fe7201 | 229 | done |
ef416fc2 | 230 | |
50fe7201 MS |
231 | |
232 | # | |
233 | # Install libraries... | |
234 | # | |
235 | ||
c9fc04c6 | 236 | install-libs: libs |
50fe7201 MS |
237 | for dir in $(DIRS); do\ |
238 | echo Installing libraries in $$dir... ;\ | |
c9fc04c6 | 239 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ |
50fe7201 | 240 | done |
ef416fc2 | 241 | |
242 | ||
757d2cad | 243 | # |
244 | # Uninstall object and target files... | |
245 | # | |
246 | ||
247 | uninstall: | |
248 | for dir in $(DIRS); do\ | |
249 | echo Uninstalling in $$dir... ;\ | |
250 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
251 | done | |
252 | echo Uninstalling cups-config script... | |
253 | $(RM) $(BINDIR)/cups-config | |
254 | -$(RMDIR) $(BINDIR) | |
255 | echo Uninstalling startup script... | |
e1d6a774 | 256 | if test "x$(INITDIR)" != x; then \ |
757d2cad | 257 | $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \ |
258 | $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \ | |
259 | $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ | |
260 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
261 | $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ | |
262 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ | |
263 | $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ | |
264 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ | |
265 | $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ | |
266 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ | |
267 | fi | |
e1d6a774 | 268 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ |
757d2cad | 269 | if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ |
270 | $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \ | |
271 | $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ | |
272 | $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ | |
273 | $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ | |
274 | elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
3d8365b8 | 275 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \ |
276 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \ | |
277 | $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
757d2cad | 278 | else \ |
279 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
280 | fi \ | |
281 | $(RMDIR) $(BUILDROOT)$(INITDDIR); \ | |
282 | fi | |
e1d6a774 | 283 | if test "x$(DBUSDIR)" != x; then \ |
757d2cad | 284 | echo Uninstalling cups.conf in $(DBUSDIR)...;\ |
285 | $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ | |
286 | $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ | |
287 | fi | |
e1d6a774 | 288 | $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd |
289 | $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop | |
290 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png | |
291 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png | |
292 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png | |
293 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png | |
757d2cad | 294 | |
295 | ||
ef416fc2 | 296 | # |
297 | # Run the test suite... | |
298 | # | |
299 | ||
d09495fa | 300 | test: all |
ef416fc2 | 301 | echo Running CUPS test suite... |
302 | cd test; ./run-stp-tests.sh | |
303 | ||
304 | ||
d09495fa | 305 | check: all |
306 | echo Running CUPS test suite with defaults... | |
307 | cd test; ./run-stp-tests.sh 1 0 n | |
308 | ||
309 | ||
ef416fc2 | 310 | # |
4744bd90 | 311 | # Make software distributions using EPM (http://www.easysw.com/epm/)... |
ef416fc2 | 312 | # |
313 | ||
d09495fa | 314 | EPMFLAGS = -v --output-dir dist $(EPMARCH) |
ef416fc2 | 315 | |
b86bc4cf | 316 | aix bsd deb depot inst pkg setld slackware swinstall tardist: |
4744bd90 | 317 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list |
ef416fc2 | 318 | |
319 | epm: | |
d09495fa | 320 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list |
321 | ||
322 | osx: | |
323 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
324 | ||
b86bc4cf | 325 | rpm: |
326 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
327 | ||
d09495fa | 328 | .PHONEY: dist |
329 | dist: all | |
330 | $(RM) -r dist | |
331 | $(MAKE) $(MFLAGS) epm | |
332 | case `uname` in \ | |
333 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
334 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
335 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
336 | Linux*) $(MAKE) $(MFLAGS) rpm;; \ | |
337 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
338 | esac | |
ef416fc2 | 339 | |
bd7854cb | 340 | |
ef416fc2 | 341 | # |
75bd9771 | 342 | # End of "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $". |
ef416fc2 | 343 | # |