]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / Makefile
1 #
2 # "$Id: Makefile 6500 2007-04-30 21:47:48Z mike $"
3 #
4 # Top-level Makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
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
25 include Makedefs
26
27 #
28 # Directories to make...
29 #
30
31 DIRS = cups backend berkeley cgi-bin filter locale man monitor \
32 notifier $(PDFTOPS) scheduler systemv test \
33 $(PHPDIR) \
34 conf data doc fonts ppd templates
35
36
37 #
38 # Make all targets...
39 #
40
41 all:
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
48
49 #
50 # Remove object and target files...
51 #
52
53 clean:
54 for dir in $(DIRS); do\
55 echo Cleaning in $$dir... ;\
56 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
57 done
58
59
60 #
61 # Remove all non-distribution files...
62 #
63
64 distclean: clean
65 $(RM) Makedefs config.h config.log config.status
66 $(RM) cups-config conf/cupsd.conf conf/pam.std
67 $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html
68 $(RM) doc/index.html
69 $(RM) init/cups.sh init/cups-lpd
70 $(RM) man/client.conf.man
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
74 $(RM) packaging/cups.list
75 $(RM) templates/edit-config.tmpl templates/header.tmpl
76 -$(RM) doc/*/index.html
77 -$(RM) templates/*/edit-config.tmpl
78 -$(RM) templates/*/header.tmpl
79 -$(RM) -r autom4te*.cache
80
81
82 #
83 # Make dependencies
84 #
85
86 depend:
87 for dir in $(DIRS); do\
88 echo Making dependencies in $$dir... ;\
89 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
90 done
91
92
93 #
94 # Generate a ctags file...
95 #
96
97 ctags:
98 ctags -R .
99
100
101 #
102 # Install object and target files...
103 #
104
105 install: installhdrs
106 for dir in $(DIRS); do\
107 echo Installing in $$dir... ;\
108 (cd $$dir; $(MAKE) $(MFLAGS) install) || exit 1;\
109 done
110 echo Installing cups-config script...
111 $(INSTALL_DIR) -m 755 $(BINDIR)
112 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
113 if test "x$(INITDIR)" != x; then \
114 echo Installing init scripts...; \
115 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
116 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
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; \
126 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
127 $(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
128 fi
129 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
130 $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
131 if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
132 echo Installing StartupItems files...; \
133 $(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
134 $(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
135 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
136 $(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
137 elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
138 echo Installing LaunchDaemons configuration files...; \
139 $(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
140 $(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
141 else \
142 echo Installing RC script...; \
143 $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
144 fi \
145 fi
146 if test "x$(DBUSDIR)" != x; then \
147 echo Installing cups.conf in $(DBUSDIR)...;\
148 $(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
149 $(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
150 fi
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
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 \
162 echo Installing desktop icons...; \
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; \
171 fi
172
173
174 #
175 # Install source and header files...
176 #
177
178 installsrc:
179 gnutar --dereference --exclude=.svn -cf - . | gnutar -C $(SRCROOT) -xf -
180
181 installhdrs:
182 (cd cups ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;\
183 (cd filter ; $(MAKE) $(MFLAGS) installhdrs) || exit 1;
184
185
186 #
187 # Uninstall object and target files...
188 #
189
190 uninstall:
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...
199 if test "x$(INITDIR)" != x; then \
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
211 if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
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
224 if test "x$(DBUSDIR)" != x; then \
225 echo Uninstalling cups.conf in $(DBUSDIR)...;\
226 $(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
227 $(RMDIR) $(BUILDROOT)$(DBUSDIR); \
228 fi
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
235
236
237 #
238 # Run the test suite...
239 #
240
241 test: all
242 echo Running CUPS test suite...
243 cd test; ./run-stp-tests.sh
244
245
246 check: all
247 echo Running CUPS test suite with defaults...
248 cd test; ./run-stp-tests.sh 1 0 n
249
250
251 #
252 # Make software distributions using EPM (http://www.easysw.com/epm/)...
253 #
254
255 EPMFLAGS = -v --output-dir dist $(EPMARCH)
256
257 aix bsd deb depot inst pkg setld slackware swinstall tardist:
258 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
259
260 epm:
261 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
262
263 osx:
264 epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
265
266 rpm:
267 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
268
269 .PHONEY: dist
270 dist: 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
280
281
282 #
283 # End of "$Id: Makefile 6500 2007-04-30 21:47:48Z mike $".
284 #