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