Load cups into easysw/current.
[thirdparty/cups.git] / Makefile
CommitLineData
ef416fc2 1#
b94498cf 2# "$Id: Makefile 6500 2007-04-30 21:47:48Z mike $"
ef416fc2 3#
4# Top-level Makefile for the Common UNIX Printing System (CUPS).
5#
f7deaa1a 6# Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 7#
8# These coded instructions, statements, and computer programs are the
9# property of Easy Software Products and are protected by Federal
10# copyright law. Distribution and use rights are outlined in the file
11# "LICENSE.txt" which should have been included with this file. If this
12# file is missing or damaged please contact Easy Software Products
13# at:
14#
15# Attn: CUPS Licensing Information
16# Easy Software Products
17# 44141 Airport View Drive, Suite 204
18# Hollywood, Maryland 20636-3142 USA
19#
20# Voice: (301) 373-9600
21# EMail: cups-info@cups.org
22# WWW: http://www.cups.org
23#
24
25include Makedefs
26
27#
28# Directories to make...
29#
30
bd7854cb 31DIRS = cups backend berkeley cgi-bin filter locale man monitor \
e1d6a774 32 notifier $(PDFTOPS) scheduler systemv test \
757d2cad 33 $(PHPDIR) \
34 conf data doc fonts ppd templates
bd7854cb 35
ef416fc2 36
37#
38# Make all targets...
39#
40
41all:
42 chmod +x cups-config
43 for dir in $(DIRS); do\
44 echo Making all in $$dir... ;\
45 (cd $$dir ; $(MAKE) $(MFLAGS)) || exit 1;\
46 done
47
bd7854cb 48
ef416fc2 49#
50# Remove object and target files...
51#
52
53clean:
54 for dir in $(DIRS); do\
55 echo Cleaning in $$dir... ;\
56 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
57 done
58
bd7854cb 59
a9252913 60#
61# Remove all non-distribution files...
62#
63
64distclean: clean
65 $(RM) Makedefs config.h config.log config.status
66 $(RM) cups-config conf/cupsd.conf conf/pam.std
b94498cf 67 $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
68 $(RM) doc/index.html
a9252913 69 $(RM) init/cups.sh init/cups-lpd
b94498cf 70 $(RM) man/client.conf.man
a9252913 71 $(RM) man/cups-deviced.man man/cups-driverd.man
72 $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
73 $(RM) man/cupsd.conf.man man/lpoptions.man
f7deaa1a 74 $(RM) packaging/cups.list
75 $(RM) templates/edit-config.tmpl templates/header.tmpl
a9252913 76 -$(RM) doc/*/index.html
77 -$(RM) templates/*/edit-config.tmpl
78 -$(RM) templates/*/header.tmpl
79 -$(RM) -r autom4te*.cache
80
81
ef416fc2 82#
83# Make dependencies
84#
85
86depend:
87 for dir in $(DIRS); do\
88 echo Making dependencies in $$dir... ;\
89 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
90 done
91
92
b94498cf 93#
94# Generate a ctags file...
95#
96
97ctags:
98 ctags -R .
99
100
ef416fc2 101#
102# Install object and target files...
103#
104
105install: installhdrs
106 for dir in $(DIRS); do\
107 echo Installing in $$dir... ;\
108 (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\
109 done
ef416fc2 110 echo Installing cups-config script...
757d2cad 111 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 112 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
e1d6a774 113 if test "x$(INITDIR)" != x; then \
f301802f 114 echo Installing init scripts...; \
757d2cad 115 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
fa73b229 116 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
f7deaa1a 117 for level in $(RCLEVELS); do \
118 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
119 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
120 if test `uname` = HP-UX; then \
121 level=`expr $$level - 1`; \
122 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
123 fi; \
124 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
125 done; \
757d2cad 126 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
f7deaa1a 127 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
ef416fc2 128 fi
e1d6a774 129 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
ef416fc2 130 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
131 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
f301802f 132 echo Installing StartupItems files...; \
e00b005a 133 $(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
134 $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
757d2cad 135 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
e00b005a 136 $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
a4d04587 137 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
d09495fa 138 echo Installing LaunchDaemons configuration files...; \
e00b005a 139 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
d09495fa 140 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
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 \
218 $(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
219 else \
220 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
221 fi \
222 $(RMDIR) $(BUILDROOT)$(INITDDIR); \
223 fi
e1d6a774 224 if test "x$(DBUSDIR)" != x; then \
757d2cad 225 echo Uninstalling cups.conf in $(DBUSDIR)...;\
226 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
227 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
228 fi
e1d6a774 229 $(RM) $(BUILDROOT)/etc/xinetd.d/cups-lpd
230 $(RM) $(BUILDROOT)/usr/share/applications/cups.desktop
231 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/16x16/apps/cups.png
232 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/32x32/apps/cups.png
233 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/64x64/apps/cups.png
234 $(RM) $(BUILDROOT)/usr/share/icons/hicolor/128x128/apps/cups.png
757d2cad 235
236
ef416fc2 237#
238# Run the test suite...
239#
240
d09495fa 241test: all
ef416fc2 242 echo Running CUPS test suite...
243 cd test; ./run-stp-tests.sh
244
245
d09495fa 246check: all
247 echo Running CUPS test suite with defaults...
248 cd test; ./run-stp-tests.sh 1 0 n
249
250
ef416fc2 251#
4744bd90 252# Make software distributions using EPM (http://www.easysw.com/epm/)...
ef416fc2 253#
254
d09495fa 255EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 256
b86bc4cf 257aix bsd deb depot inst pkg setld slackware swinstall tardist:
4744bd90 258 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 259
260epm:
d09495fa 261 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
262
263osx:
264 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
265
b86bc4cf 266rpm:
267 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
268
d09495fa 269.PHONEY: dist
270dist: all
271 $(RM) -r dist
272 $(MAKE) $(MFLAGS) epm
273 case `uname` in \
274 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
275 Darwin*) $(MAKE) $(MFLAGS) osx;; \
276 IRIX*) $(MAKE) $(MFLAGS) tardist;; \
277 Linux*) $(MAKE) $(MFLAGS) rpm;; \
278 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
279 esac
ef416fc2 280
bd7854cb 281
ef416fc2 282#
b94498cf 283# End of "$Id: Makefile 6500 2007-04-30 21:47:48Z mike $".
ef416fc2 284#