]>
Commit | Line | Data |
---|---|---|
6be16022 | 1 | # |
b2e10895 | 2 | # "$Id$" |
6be16022 | 3 | # |
4 | # Top-level Makefile for the Common UNIX Printing System (CUPS). | |
5 | # | |
e1c806ac | 6 | # Copyright 2007-2008 by Apple Inc. |
a10618de | 7 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. |
6be16022 | 8 | # |
9 | # These coded instructions, statements, and computer programs are the | |
4e8d321f | 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/". | |
6be16022 | 14 | # |
15 | ||
3e7eb9bb | 16 | include Makedefs |
17 | ||
6be16022 | 18 | # |
3e7eb9bb | 19 | # Directories to make... |
6be16022 | 20 | # |
21 | ||
d5cfdccb | 22 | DIRS = cups backend berkeley cgi-bin filter locale man monitor \ |
4bc98872 | 23 | notifier ppdc scheduler systemv test \ |
ad0f4a13 | 24 | $(PHPDIR) \ |
b9daaaa3 | 25 | conf data doc $(FONTS) ppd templates |
d5cfdccb | 26 | |
6be16022 | 27 | |
28 | # | |
29 | # Make all targets... | |
30 | # | |
31 | ||
32 | all: | |
d3d79f52 | 33 | chmod +x cups-config |
6be16022 | 34 | for dir in $(DIRS); do\ |
8391453b | 35 | echo Making all in $$dir... ;\ |
7c06d0fc | 36 | (cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\ |
6be16022 | 37 | done |
38 | ||
d5cfdccb | 39 | |
6be16022 | 40 | # |
41 | # Remove object and target files... | |
42 | # | |
43 | ||
44 | clean: | |
45 | for dir in $(DIRS); do\ | |
8391453b | 46 | echo Cleaning in $$dir... ;\ |
7c06d0fc | 47 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ |
6be16022 | 48 | done |
3e7eb9bb | 49 | |
d5cfdccb | 50 | |
1071b72e | 51 | # |
52 | # Remove all non-distribution files... | |
53 | # | |
54 | ||
55 | distclean: clean | |
56 | $(RM) Makedefs config.h config.log config.status | |
41838424 | 57 | $(RM) cups-config |
58 | $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf | |
59 | $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html | |
60 | $(RM) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist | |
7afc1c1a | 61 | $(RM) man/client.conf.man |
1071b72e | 62 | $(RM) man/cups-deviced.man man/cups-driverd.man |
63 | $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man | |
64 | $(RM) man/cupsd.conf.man man/lpoptions.man | |
a10618de | 65 | $(RM) packaging/cups.list |
cfb34cad | 66 | $(RM) templates/header.tmpl |
1071b72e | 67 | -$(RM) doc/*/index.html |
1071b72e | 68 | -$(RM) templates/*/header.tmpl |
69 | -$(RM) -r autom4te*.cache | |
70 | ||
71 | ||
f915b00f | 72 | # |
73 | # Make dependencies | |
74 | # | |
75 | ||
76 | depend: | |
77 | for dir in $(DIRS); do\ | |
78 | echo Making dependencies in $$dir... ;\ | |
79 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
80 | done | |
81 | ||
82 | ||
96b23c16 | 83 | # |
84 | # Generate a ctags file... | |
85 | # | |
86 | ||
87 | ctags: | |
88 | ctags -R . | |
89 | ||
90 | ||
6be16022 | 91 | # |
92 | # Install object and target files... | |
93 | # | |
94 | ||
f915b00f | 95 | install: installhdrs |
6be16022 | 96 | for dir in $(DIRS); do\ |
8391453b | 97 | echo Installing in $$dir... ;\ |
7c06d0fc | 98 | (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\ |
6be16022 | 99 | done |
753453e4 | 100 | echo Installing cups-config script... |
ad0f4a13 | 101 | $(INSTALL_DIR) -m 755 $(BINDIR) |
753453e4 | 102 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config |
3926d957 | 103 | if test "x$(INITDIR)" != x; then \ |
9a308367 | 104 | echo Installing init scripts...; \ |
ad0f4a13 | 105 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \ |
2d20037d | 106 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ |
4f254b44 | 107 | for level in $(RCLEVELS); do \ |
108 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
109 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \ | |
110 | if test `uname` = HP-UX; then \ | |
111 | level=`expr $$level - 1`; \ | |
112 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \ | |
113 | fi; \ | |
114 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \ | |
115 | done; \ | |
ad0f4a13 | 116 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \ |
4f254b44 | 117 | $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \ |
4ed570e1 | 118 | fi |
3926d957 | 119 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ |
753453e4 | 120 | $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ |
9dc672e9 | 121 | if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ |
865ae39d | 122 | echo Installing LaunchDaemons configuration files...; \ |
09a48dfa | 123 | $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \ |
865ae39d | 124 | $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \ |
fd59c148 | 125 | case `uname -r` in \ |
126 | 8.*) \ | |
127 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
128 | $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \ | |
129 | $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \ | |
130 | $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \ | |
131 | $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \ | |
132 | ;; \ | |
133 | esac \ | |
753453e4 | 134 | else \ |
9a308367 | 135 | echo Installing RC script...; \ |
2d20037d | 136 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ |
753453e4 | 137 | fi \ |
f6fb02d3 | 138 | fi |
3926d957 | 139 | if test "x$(DBUSDIR)" != x; then \ |
ca8e1fc2 | 140 | echo Installing cups.conf in $(DBUSDIR)...;\ |
a10618de | 141 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \ |
142 | $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \ | |
bebab6d6 | 143 | fi |
3926d957 | 144 | if test "x$(XINETD)" != x; then \ |
069587e3 | 145 | echo Installing xinetd configuration file for cups-lpd...; \ |
3926d957 | 146 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \ |
147 | $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \ | |
069587e3 | 148 | fi |
a10618de | 149 | if test "x$(MENUDIR)" != x; then \ |
150 | echo Installing desktop menu...; \ | |
151 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \ | |
152 | $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \ | |
153 | fi | |
154 | if test "x$(ICONDIR)" != x; then \ | |
069587e3 | 155 | echo Installing desktop icons...; \ |
a10618de | 156 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \ |
157 | $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \ | |
158 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \ | |
159 | $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \ | |
160 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \ | |
161 | $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \ | |
162 | $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \ | |
163 | $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \ | |
069587e3 | 164 | fi |
6be16022 | 165 | |
3f5dfefd | 166 | |
f915b00f | 167 | # |
168 | # Install source and header files... | |
169 | # | |
170 | ||
171 | installsrc: | |
bebab6d6 | 172 | gnutar --dereference --exclude=.svn -cf - . | gnutar -C $(SRCROOT) -xf - |
f915b00f | 173 | |
174 | installhdrs: | |
175 | (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\ | |
176 | (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1; | |
177 | ||
43fe1146 | 178 | |
ad0f4a13 | 179 | # |
180 | # Uninstall object and target files... | |
181 | # | |
182 | ||
183 | uninstall: | |
184 | for dir in $(DIRS); do\ | |
185 | echo Uninstalling in $$dir... ;\ | |
186 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
187 | done | |
188 | echo Uninstalling cups-config script... | |
189 | $(RM) $(BINDIR)/cups-config | |
190 | -$(RMDIR) $(BINDIR) | |
191 | echo Uninstalling startup script... | |
3926d957 | 192 | if test "x$(INITDIR)" != x; then \ |
ad0f4a13 | 193 | $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \ |
194 | $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \ | |
195 | $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ | |
196 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ | |
197 | $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ | |
198 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ | |
199 | $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ | |
200 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ | |
201 | $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ | |
202 | $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ | |
203 | fi | |
3926d957 | 204 | if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \ |
ad0f4a13 | 205 | if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ |
206 | $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \ | |
207 | $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ | |
208 | $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ | |
209 | $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ | |
210 | elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \ | |
fd59c148 | 211 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \ |
212 | $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \ | |
213 | $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \ | |
ad0f4a13 | 214 | else \ |
215 | $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ | |
216 | fi \ | |
217 | $(RMDIR) $(BUILDROOT)$(INITDDIR); \ | |
218 | fi | |
3926d957 | 219 | if test "x$(DBUSDIR)" != x; then \ |
ad0f4a13 | 220 | echo Uninstalling cups.conf in $(DBUSDIR)...;\ |
221 | $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \ | |
222 | $(RMDIR) $(BUILDROOT)$(DBUSDIR); \ | |
223 | fi | |
069587e3 | 224 | $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd |
225 | $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop | |
226 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png | |
227 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png | |
228 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png | |
229 | $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png | |
ad0f4a13 | 230 | |
231 | ||
43fe1146 | 232 | # |
233 | # Run the test suite... | |
234 | # | |
235 | ||
98bbb2f9 | 236 | test: all |
43fe1146 | 237 | echo Running CUPS test suite... |
74464516 | 238 | cd test; ./run-stp-tests.sh |
43fe1146 | 239 | |
240 | ||
98bbb2f9 | 241 | check: all |
242 | echo Running CUPS test suite with defaults... | |
243 | cd test; ./run-stp-tests.sh 1 0 n | |
244 | ||
245 | ||
6be16022 | 246 | # |
84ff190a | 247 | # Make software distributions using EPM (http://www.easysw.com/epm/)... |
bdfee4a2 | 248 | # |
249 | ||
d35c4511 | 250 | EPMFLAGS = -v --output-dir dist $(EPMARCH) |
753453e4 | 251 | |
282ab0c1 | 252 | aix bsd deb depot inst pkg setld slackware swinstall tardist: |
84ff190a | 253 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list |
7c06d0fc | 254 | |
bdfee4a2 | 255 | epm: |
837ec037 | 256 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list |
257 | ||
258 | osx: | |
259 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
260 | ||
282ab0c1 | 261 | rpm: |
262 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
263 | ||
837ec037 | 264 | .PHONEY: dist |
265 | dist: all | |
266 | $(RM) -r dist | |
267 | $(MAKE) $(MFLAGS) epm | |
268 | case `uname` in \ | |
1fa9cf93 | 269 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ |
270 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
271 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
272 | Linux*) $(MAKE) $(MFLAGS) rpm;; \ | |
273 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
837ec037 | 274 | esac |
bdfee4a2 | 275 | |
d5cfdccb | 276 | |
bdfee4a2 | 277 | # |
b2e10895 | 278 | # End of "$Id$". |
6be16022 | 279 | # |