]> git.ipfire.org Git - thirdparty/cups.git/blame - Makefile
What the heck, make it the full 1.3.3 release code - we've already got all of
[thirdparty/cups.git] / Makefile
CommitLineData
ef416fc2 1#
db1f069b 2# "$Id: Makefile 6945 2007-09-12 17:08:32Z mike $"
ef416fc2 3#
4# Top-level Makefile for the Common UNIX Printing System (CUPS).
5#
bc44d920 6# Copyright 2007 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
bd7854cb 22DIRS = cups backend berkeley cgi-bin filter locale man monitor \
e1d6a774 23 notifier $(PDFTOPS) 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
34 for dir in $(DIRS); do\
35 echo Making all in $$dir... ;\
36 (cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\
37 done
38
bd7854cb 39
ef416fc2 40#
41# Remove object and target files...
42#
43
44clean:
45 for dir in $(DIRS); do\
46 echo Cleaning in $$dir... ;\
47 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
48 done
49
bd7854cb 50
a9252913 51#
52# Remove all non-distribution files...
53#
54
55distclean: clean
56 $(RM) Makedefs config.h config.log config.status
57 $(RM) cups-config conf/cupsd.conf conf/pam.std
b94498cf 58 $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
59 $(RM) doc/index.html
a9252913 60 $(RM) init/cups.sh init/cups-lpd
b94498cf 61 $(RM) man/client.conf.man
a9252913 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
f7deaa1a 65 $(RM) packaging/cups.list
db1f069b 66 $(RM) templates/header.tmpl
a9252913 67 -$(RM) doc/*/index.html
a9252913 68 -$(RM) templates/*/header.tmpl
69 -$(RM) -r autom4te*.cache
70
71
ef416fc2 72#
73# Make dependencies
74#
75
76depend:
77 for dir in $(DIRS); do\
78 echo Making dependencies in $$dir... ;\
79 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
80 done
81
82
b94498cf 83#
84# Generate a ctags file...
85#
86
87ctags:
88 ctags -R .
89
90
ef416fc2 91#
92# Install object and target files...
93#
94
95install: installhdrs
96 for dir in $(DIRS); do\
97 echo Installing in $$dir... ;\
98 (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\
99 done
ef416fc2 100 echo Installing cups-config script...
757d2cad 101 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 102 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
e1d6a774 103 if test "x$(INITDIR)" != x; then \
f301802f 104 echo Installing init scripts...; \
757d2cad 105 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
fa73b229 106 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
f7deaa1a 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; \
757d2cad 116 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
f7deaa1a 117 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
ef416fc2 118 fi
e1d6a774 119 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
ef416fc2 120 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
121 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
f301802f 122 echo Installing StartupItems files...; \
e00b005a 123 $(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
124 $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
3d8365b8 125 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
e00b005a 126 $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
a4d04587 127 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
d09495fa 128 echo Installing LaunchDaemons configuration files...; \
e00b005a 129 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
d09495fa 130 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
3d8365b8 131 case `uname -r` in \
132 8.*) \
133 $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
134 $(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
135 $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
136 $(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
137 $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
138 ;; \
139 esac \
ef416fc2 140 else \
f301802f 141 echo Installing RC script...; \
fa73b229 142 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
ef416fc2 143 fi \
144 fi
e1d6a774 145 if test "x$(DBUSDIR)" != x; then \
b423cd4c 146 echo Installing cups.conf in $(DBUSDIR)...;\
f7deaa1a 147 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
148 $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
bd7854cb 149 fi
e1d6a774 150 if test "x$(XINETD)" != x; then \
151 echo Installing xinetd configuration file for cups-lpd...; \
152 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
153 $(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
154 fi
f7deaa1a 155 if test "x$(MENUDIR)" != x; then \
156 echo Installing desktop menu...; \
157 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
158 $(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
159 fi
160 if test "x$(ICONDIR)" != x; then \
e1d6a774 161 echo Installing desktop icons...; \
f7deaa1a 162 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \
163 $(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
164 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \
165 $(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
166 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \
167 $(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
168 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \
169 $(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
e1d6a774 170 fi
ef416fc2 171
172
173#
174# Install source and header files...
175#
176
177installsrc:
bd7854cb 178 gnutar --dereference --exclude=.svn -cf - . | gnutar -C $(SRCROOT) -xf -
ef416fc2 179
180installhdrs:
181 (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\
182 (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;
183
184
757d2cad 185#
186# Uninstall object and target files...
187#
188
189uninstall:
190 for dir in $(DIRS); do\
191 echo Uninstalling in $$dir... ;\
192 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
193 done
194 echo Uninstalling cups-config script...
195 $(RM) $(BINDIR)/cups-config
196 -$(RMDIR) $(BINDIR)
197 echo Uninstalling startup script...
e1d6a774 198 if test "x$(INITDIR)" != x; then \
757d2cad 199 $(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
200 $(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
201 $(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
202 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
203 $(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
204 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
205 $(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
206 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
207 $(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
208 $(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
209 fi
e1d6a774 210 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
757d2cad 211 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
212 $(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
213 $(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
214 $(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
215 $(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
216 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
3d8365b8 217 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
218 $(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
219 $(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
757d2cad 220 else \
221 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
222 fi \
223 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
224 fi
e1d6a774 225 if test "x$(DBUSDIR)" != x; then \
757d2cad 226 echo Uninstalling cups.conf in $(DBUSDIR)...;\
227 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
228 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
229 fi
e1d6a774 230 $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd
231 $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop
232 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png
233 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png
234 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png
235 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png
757d2cad 236
237
ef416fc2 238#
239# Run the test suite...
240#
241
d09495fa 242test: all
ef416fc2 243 echo Running CUPS test suite...
244 cd test; ./run-stp-tests.sh
245
246
d09495fa 247check: all
248 echo Running CUPS test suite with defaults...
249 cd test; ./run-stp-tests.sh 1 0 n
250
251
ef416fc2 252#
4744bd90 253# Make software distributions using EPM (http://www.easysw.com/epm/)...
ef416fc2 254#
255
d09495fa 256EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 257
b86bc4cf 258aix bsd deb depot inst pkg setld slackware swinstall tardist:
4744bd90 259 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 260
261epm:
d09495fa 262 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
263
264osx:
265 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
266
b86bc4cf 267rpm:
268 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
269
d09495fa 270.PHONEY: dist
271dist: all
272 $(RM) -r dist
273 $(MAKE) $(MFLAGS) epm
274 case `uname` in \
275 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
276 Darwin*) $(MAKE) $(MFLAGS) osx;; \
277 IRIX*) $(MAKE) $(MFLAGS) tardist;; \
278 Linux*) $(MAKE) $(MFLAGS) rpm;; \
279 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
280 esac
ef416fc2 281
bd7854cb 282
ef416fc2 283#
db1f069b 284# End of "$Id: Makefile 6945 2007-09-12 17:08:32Z mike $".
ef416fc2 285#