Merge changes from CUPS 1.4svn-r7386.
[thirdparty/cups.git] / Makefile
CommitLineData
ef416fc2 1#
2e4ff8af 2# "$Id: Makefile 6897 2007-08-30 06:11:59Z 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
16include Makedefs
17
18#
19# Directories to make...
20#
21
ac884b6a
MS
22DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \
23 notifier ppdc scheduler systemv test \
757d2cad 24 $(PHPDIR) \
09a101d6 25 conf data doc $(FONTS) ppd templates
bd7854cb 26
ef416fc2 27
28#
29# Make all targets...
30#
31
32all:
33 chmod +x cups-config
ac884b6a
MS
34 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
35 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
36 echo Using LDFLAGS="$(LDFLAGS)"
37 echo Using LIBS="$(LIBS)"
ef416fc2 38 for dir in $(DIRS); do\
39 echo Making all in $$dir... ;\
40 (cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\
41 done
42
bd7854cb 43
ef416fc2 44#
45# Remove object and target files...
46#
47
48clean:
49 for dir in $(DIRS); do\
50 echo Cleaning in $$dir... ;\
51 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
52 done
53
bd7854cb 54
a9252913 55#
56# Remove all non-distribution files...
57#
58
59distclean: clean
60 $(RM) Makedefs config.h config.log config.status
0a682745
MS
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
b94498cf 65 $(RM) man/client.conf.man
a9252913 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
f7deaa1a 69 $(RM) packaging/cups.list
db1f069b 70 $(RM) templates/header.tmpl
a9252913 71 -$(RM) doc/*/index.html
a9252913 72 -$(RM) templates/*/header.tmpl
73 -$(RM) -r autom4te*.cache
74
75
ef416fc2 76#
77# Make dependencies
78#
79
80depend:
81 for dir in $(DIRS); do\
82 echo Making dependencies in $$dir... ;\
83 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
84 done
85
86
b94498cf 87#
88# Generate a ctags file...
89#
90
91ctags:
92 ctags -R .
93
94
ef416fc2 95#
96# Install object and target files...
97#
98
99install: installhdrs
100 for dir in $(DIRS); do\
101 echo Installing in $$dir... ;\
102 (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\
103 done
ef416fc2 104 echo Installing cups-config script...
757d2cad 105 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 106 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
e1d6a774 107 if test "x$(INITDIR)" != x; then \
f301802f 108 echo Installing init scripts...; \
757d2cad 109 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
fa73b229 110 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
f7deaa1a 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; \
757d2cad 120 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
f7deaa1a 121 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
ef416fc2 122 fi
e1d6a774 123 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
ef416fc2 124 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
a41f09e2 125 if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
d09495fa 126 echo Installing LaunchDaemons configuration files...; \
e00b005a 127 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
d09495fa 128 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
3d8365b8 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 \
ef416fc2 138 else \
f301802f 139 echo Installing RC script...; \
fa73b229 140 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
ef416fc2 141 fi \
142 fi
e1d6a774 143 if test "x$(DBUSDIR)" != x; then \
b423cd4c 144 echo Installing cups.conf in $(DBUSDIR)...;\
f7deaa1a 145 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
146 $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
bd7854cb 147 fi
e1d6a774 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
f7deaa1a 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 \
e1d6a774 159 echo Installing desktop icons...; \
f7deaa1a 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; \
e1d6a774 168 fi
ef416fc2 169
170
171#
172# Install source and header files...
173#
174
175installsrc:
bd7854cb 176 gnutar --dereference --exclude=.svn -cf - . | gnutar -C $(SRCROOT) -xf -
ef416fc2 177
178installhdrs:
179 (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\
180 (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;
181
182
757d2cad 183#
184# Uninstall object and target files...
185#
186
187uninstall:
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...
e1d6a774 196 if test "x$(INITDIR)" != x; then \
757d2cad 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
e1d6a774 208 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
757d2cad 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 \
3d8365b8 215 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
216 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
217 $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
757d2cad 218 else \
219 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
220 fi \
221 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
222 fi
e1d6a774 223 if test "x$(DBUSDIR)" != x; then \
757d2cad 224 echo Uninstalling cups.conf in $(DBUSDIR)...;\
225 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
226 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
227 fi
e1d6a774 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
757d2cad 234
235
ef416fc2 236#
237# Run the test suite...
238#
239
d09495fa 240test: all
ef416fc2 241 echo Running CUPS test suite...
242 cd test; ./run-stp-tests.sh
243
244
d09495fa 245check: all
246 echo Running CUPS test suite with defaults...
247 cd test; ./run-stp-tests.sh 1 0 n
248
249
ef416fc2 250#
4744bd90 251# Make software distributions using EPM (http://www.easysw.com/epm/)...
ef416fc2 252#
253
d09495fa 254EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 255
b86bc4cf 256aix bsd deb depot inst pkg setld slackware swinstall tardist:
4744bd90 257 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 258
259epm:
d09495fa 260 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
261
262osx:
263 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
264
b86bc4cf 265rpm:
266 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
267
d09495fa 268.PHONEY: dist
269dist: 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
ef416fc2 279
bd7854cb 280
ef416fc2 281#
2e4ff8af 282# End of "$Id: Makefile 6897 2007-08-30 06:11:59Z mike $".
ef416fc2 283#