]>
Commit | Line | Data |
---|---|---|
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) ppd 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 object and target files... | |
97 | # | |
98 | ||
99 | install: installhdrs | |
100 | for dir in $(DIRS); do\ | |
101 | echo Installing in $$dir... ;\ | |
102 | (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\ | |
103 | done | |
104 | echo Installing cups-config script... | |
105 | $(INSTALL_DIR) -m 755 $(BINDIR) | |
106 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config | |
107 | if test "x$(INITDIR)" != x; then \ | |
108 | echo Installing init scripts...; \ | |
109 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ | |
110 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ | |
111 | for level in $(RCLEVELS); do \ | |
112 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
113 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \ | |
114 | if test `uname` = HP-UX; then \ | |
115 | level=`expr $$level - 1`; \ | |
116 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
117 | fi; \ | |
118 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \ | |
119 | done; \ | |
120 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
121 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \ | |
122 | fi | |
123 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ | |
124 | $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ | |
125 | if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
126 | echo Installing LaunchDaemons configuration files...; \ | |
127 | $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ | |
128 | $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \ | |
129 | case `uname -r` in \ | |
130 | 8.*) \ | |
131 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
132 | $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ | |
133 | $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ | |
134 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ | |
135 | $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ | |
136 | ;; \ | |
137 | esac \ | |
138 | else \ | |
139 | echo Installing RC script...; \ | |
140 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
141 | fi \ | |
142 | fi | |
143 | if test "x$(DBUSDIR)" != x; then \ | |
144 | echo Installing cups.conf in $(DBUSDIR)...;\ | |
145 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \ | |
146 | $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \ | |
147 | fi | |
148 | if test "x$(XINETD)" != x; then \ | |
149 | echo Installing xinetd configuration file for cups-lpd...; \ | |
150 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \ | |
151 | $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \ | |
152 | fi | |
153 | if test "x$(MENUDIR)" != x; then \ | |
154 | echo Installing desktop menu...; \ | |
155 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \ | |
156 | $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \ | |
157 | fi | |
158 | if test "x$(ICONDIR)" != x; then \ | |
159 | echo Installing desktop icons...; \ | |
160 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \ | |
161 | $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ | |
162 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \ | |
163 | $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ | |
164 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \ | |
165 | $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ | |
166 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \ | |
167 | $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ | |
168 | fi | |
169 | ||
170 | ||
171 | # | |
172 | # Install source and header files... | |
173 | # | |
174 | ||
175 | installsrc: | |
176 | gnutar --dereference --exclude=.svn -cf - . | gnutar -C $(SRCROOT) -xf - | |
177 | ||
178 | installhdrs: | |
179 | (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\ | |
180 | (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1; | |
181 | ||
182 | ||
183 | # | |
184 | # Uninstall object and target files... | |
185 | # | |
186 | ||
187 | uninstall: | |
188 | for dir in $(DIRS); do\ | |
189 | echo Uninstalling in $$dir... ;\ | |
190 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
191 | done | |
192 | echo Uninstalling cups-config script... | |
193 | $(RM) $(BINDIR)/cups-config | |
194 | -$(RMDIR) $(BINDIR) | |
195 | echo Uninstalling startup script... | |
196 | if test "x$(INITDIR)" != x; then \ | |
197 | $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \ | |
198 | $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \ | |
199 | $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ | |
200 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
201 | $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ | |
202 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ | |
203 | $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ | |
204 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ | |
205 | $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ | |
206 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ | |
207 | fi | |
208 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ | |
209 | if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ | |
210 | $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \ | |
211 | $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ | |
212 | $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ | |
213 | $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ | |
214 | elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
215 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \ | |
216 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \ | |
217 | $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
218 | else \ | |
219 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
220 | fi \ | |
221 | $(RMDIR) $(BUILDROOT)$(INITDDIR); \ | |
222 | fi | |
223 | if test "x$(DBUSDIR)" != x; then \ | |
224 | echo Uninstalling cups.conf in $(DBUSDIR)...;\ | |
225 | $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ | |
226 | $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ | |
227 | fi | |
228 | $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd | |
229 | $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop | |
230 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png | |
231 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png | |
232 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png | |
233 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png | |
234 | ||
235 | ||
236 | # | |
237 | # Run the test suite... | |
238 | # | |
239 | ||
240 | test: all | |
241 | echo Running CUPS test suite... | |
242 | cd test; ./run-stp-tests.sh | |
243 | ||
244 | ||
245 | check: all | |
246 | echo Running CUPS test suite with defaults... | |
247 | cd test; ./run-stp-tests.sh 1 0 n | |
248 | ||
249 | ||
250 | # | |
251 | # Make software distributions using EPM (http://www.easysw.com/epm/)... | |
252 | # | |
253 | ||
254 | EPMFLAGS = -v --output-dir dist $(EPMARCH) | |
255 | ||
256 | aix bsd deb depot inst pkg setld slackware swinstall tardist: | |
257 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list | |
258 | ||
259 | epm: | |
260 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list | |
261 | ||
262 | osx: | |
263 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
264 | ||
265 | rpm: | |
266 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
267 | ||
268 | .PHONEY: dist | |
269 | dist: all | |
270 | $(RM) -r dist | |
271 | $(MAKE) $(MFLAGS) epm | |
272 | case `uname` in \ | |
273 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
274 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
275 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
276 | Linux*) $(MAKE) $(MFLAGS) rpm;; \ | |
277 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
278 | esac | |
279 | ||
280 | ||
281 | # | |
282 | # End of "$Id: Makefile 6897 2007-08-30 06:11:59Z mike $". | |
283 | # |