Merge fixes from CUPS 1.4svn-r7555.
[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) \
634763e8 25 conf data doc $(FONTS) 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#
50fe7201 96# Install everything...
ef416fc2 97#
98
50fe7201
MS
99install: install-data install-headers install-libs install-exec
100
101
102#
103# Install data files...
104#
105
106install-data:
ef416fc2 107 for dir in $(DIRS); do\
50fe7201
MS
108 echo Installing data files in $$dir... ;\
109 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
ef416fc2 110 done
ef416fc2 111 echo Installing cups-config script...
757d2cad 112 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 113 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
e1d6a774 114 if test "x$(INITDIR)" != x; then \
f301802f 115 echo Installing init scripts...; \
757d2cad 116 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
fa73b229 117 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
f7deaa1a 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; \
757d2cad 127 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
f7deaa1a 128 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
ef416fc2 129 fi
e1d6a774 130 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
ef416fc2 131 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
a41f09e2 132 if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
d09495fa 133 echo Installing LaunchDaemons configuration files...; \
e00b005a 134 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
d09495fa 135 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
3d8365b8 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 \
ef416fc2 145 else \
f301802f 146 echo Installing RC script...; \
fa73b229 147 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
ef416fc2 148 fi \
149 fi
e1d6a774 150 if test "x$(DBUSDIR)" != x; then \
b423cd4c 151 echo Installing cups.conf in $(DBUSDIR)...;\
f7deaa1a 152 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
153 $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
bd7854cb 154 fi
e1d6a774 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
f7deaa1a 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 \
e1d6a774 166 echo Installing desktop icons...; \
f7deaa1a 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; \
e1d6a774 175 fi
ef416fc2 176
50fe7201
MS
177#
178# Install header files...
179#
180
181install-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
ef416fc2 187
188#
50fe7201 189# Install programs...
ef416fc2 190#
191
50fe7201
MS
192install-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
ef416fc2 197
50fe7201
MS
198
199#
200# Install libraries...
201#
202
203install-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
ef416fc2 208
209
757d2cad 210#
211# Uninstall object and target files...
212#
213
214uninstall:
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...
e1d6a774 223 if test "x$(INITDIR)" != x; then \
757d2cad 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
e1d6a774 235 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
757d2cad 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 \
3d8365b8 242 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
243 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
244 $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
757d2cad 245 else \
246 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
247 fi \
248 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
249 fi
e1d6a774 250 if test "x$(DBUSDIR)" != x; then \
757d2cad 251 echo Uninstalling cups.conf in $(DBUSDIR)...;\
252 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
253 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
254 fi
e1d6a774 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
757d2cad 261
262
ef416fc2 263#
264# Run the test suite...
265#
266
d09495fa 267test: all
ef416fc2 268 echo Running CUPS test suite...
269 cd test; ./run-stp-tests.sh
270
271
d09495fa 272check: all
273 echo Running CUPS test suite with defaults...
274 cd test; ./run-stp-tests.sh 1 0 n
275
276
ef416fc2 277#
4744bd90 278# Make software distributions using EPM (http://www.easysw.com/epm/)...
ef416fc2 279#
280
d09495fa 281EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 282
b86bc4cf 283aix bsd deb depot inst pkg setld slackware swinstall tardist:
4744bd90 284 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 285
286epm:
d09495fa 287 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
288
289osx:
290 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
291
b86bc4cf 292rpm:
293 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
294
d09495fa 295.PHONEY: dist
296dist: 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
ef416fc2 306
bd7854cb 307
ef416fc2 308#
2e4ff8af 309# End of "$Id: Makefile 6897 2007-08-30 06:11:59Z mike $".
ef416fc2 310#