2 # "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $"
4 # Top-level Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 # These coded instructions, statements, and computer programs are the
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/".
19 # Directories to make...
22 DIRS
= cups
filter backend berkeley cgi-bin driver locale man monitor \
23 notifier ppdc scheduler systemv
test \
25 conf data doc
$(FONTS
) templates
34 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
35 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
36 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
38 echo Using CXX
="$(CC)"
39 echo Using DSOFLAGS
="$(DSOFLAGS)"
40 echo Using LDFLAGS
="$(LDFLAGS)"
41 echo Using LIBS
="$(LIBS)"
42 for
dir in
$(DIRS
); do\
43 echo Making
all in
$$dir...
;\
44 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all) || exit
1;\
49 # Make library targets...
53 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
54 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
55 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
57 echo Using CXX
="$(CC)"
58 echo Using DSOFLAGS
="$(DSOFLAGS)"
59 echo Using LDFLAGS
="$(LDFLAGS)"
60 echo Using LIBS
="$(LIBS)"
61 for
dir in
$(DIRS
); do\
62 echo Making libraries in
$$dir...
;\
63 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
68 # Make unit test targets...
72 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
73 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
74 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
76 echo Using CXX
="$(CC)"
77 echo Using DSOFLAGS
="$(DSOFLAGS)"
78 echo Using LDFLAGS
="$(LDFLAGS)"
79 echo Using LIBS
="$(LIBS)"
80 for
dir in
$(DIRS
); do\
81 echo Making
all in
$$dir...
;\
82 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
87 # Remove object and target files...
91 for
dir in
$(DIRS
); do\
92 echo Cleaning in
$$dir...
;\
93 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
98 # Remove all non-distribution files...
102 $(RM
) Makedefs config.h config.log config.status
104 $(RM
) conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
105 $(RM
) doc
/help
/ref-cupsd-conf.html doc
/help
/standard.html doc
/index.html
106 $(RM
) init
/cups.sh init
/cups-lpd init
/org.cups.cups-lpd.plist
107 $(RM
) man
/client.conf.man
108 $(RM
) man
/cups-deviced.man man
/cups-driverd.man
109 $(RM
) man
/cups-lpd.man man
/cupsaddsmb.man man
/cupsd.man
110 $(RM
) man
/cupsd.conf.man man
/lpoptions.man
111 $(RM
) packaging
/cups.list
112 $(RM
) templates
/header.tmpl
113 -$(RM
) doc
/*/index.html
114 -$(RM
) templates
/*/header.tmpl
115 -$(RM
) -r autom4te
*.cache
123 for
dir in
$(DIRS
); do\
124 echo Making dependencies in
$$dir...
;\
125 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
130 # Run the clang.llvm.org static code analysis tool on the C sources.
135 if
test ! -d clang
; then \
140 $(MAKE
) $(MFLAGS
) CC
="scan-build -o ../clang $(CC)" \
141 CXX
="scan-build -o ../clang $(CXX)" clean all
142 test `ls -1 clang | wc -l` = 0
146 # Generate a ctags file...
154 # Install everything...
157 install: install-data install-headers install-libs install-exec
161 # Install data files...
165 for
dir in
$(DIRS
); do\
166 echo Installing data files in
$$dir...
;\
167 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
169 echo Installing cups-config script...
170 $(INSTALL_DIR
) -m
755 $(BINDIR
)
171 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
172 if
test "x$(INITDIR)" != x
; then \
173 echo Installing init scripts...
; \
174 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/init.d
; \
175 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
176 for level in
$(RCLEVELS
); do \
177 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
178 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/S
$(RCSTART
)cups
; \
179 if
test `uname` = HP-UX
; then \
180 level
=`expr $$level - 1`; \
181 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
183 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/K
$(RCSTOP
)cups
; \
185 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
186 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc0.d
/K
$(RCSTOP
)cups
; \
188 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
189 $(INSTALL_DIR
) $(BUILDROOT
)$(INITDDIR
); \
190 if
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
191 echo Installing LaunchDaemons configuration files...
; \
192 $(INSTALL_DATA
) init
/org.cups.cupsd.plist
$(BUILDROOT
)$(DEFAULT_LAUNCHD_CONF
); \
193 $(INSTALL_DATA
) init
/org.cups.cups-lpd.plist
$(BUILDROOT
)/System
/Library
/LaunchDaemons
; \
196 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
197 $(INSTALL_SCRIPT
) init
/PrintingServices.launchd
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/PrintingServices
; \
198 $(INSTALL_DATA
) init
/StartupParameters.plist
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/StartupParameters.plist
; \
199 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
; \
200 $(INSTALL_DATA
) init
/Localizable.strings
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
/Localizable.strings
; \
204 echo Installing RC script...
; \
205 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
208 if
test "x$(SMFMANIFESTDIR)" != x
; then \
209 echo Installing SMF manifest in
$(SMFMANIFESTDIR
)...
;\
210 $(INSTALL_DIR
) $(BUILDROOT
)/$(SMFMANIFESTDIR
); \
211 $(INSTALL_SCRIPT
) init
/cups.xml
$(BUILDROOT
)$(SMFMANIFESTDIR
)/cups.xml
; \
213 if
test "x$(DBUSDIR)" != x
; then \
214 echo Installing cups.conf in
$(DBUSDIR
)...
;\
215 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(DBUSDIR
)/system.d
; \
216 $(INSTALL_DATA
) packaging
/cups-dbus.conf
$(BUILDROOT
)$(DBUSDIR
)/system.d
/cups.conf
; \
218 if
test "x$(XINETD)" != x
; then \
219 echo Installing xinetd configuration file for cups-lpd...
; \
220 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(XINETD
); \
221 $(INSTALL_DATA
) init
/cups-lpd
$(BUILDROOT
)$(XINETD
)/cups-lpd
; \
223 if
test "x$(MENUDIR)" != x
; then \
224 echo Installing desktop menu...
; \
225 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(MENUDIR
); \
226 $(INSTALL_DATA
) desktop
/cups.desktop
$(BUILDROOT
)$(MENUDIR
); \
228 if
test "x$(ICONDIR)" != x
; then \
229 echo Installing desktop icons...
; \
230 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
; \
231 $(INSTALL_DATA
) desktop
/cups-16.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
/cups.png
; \
232 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
; \
233 $(INSTALL_DATA
) desktop
/cups-32.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
/cups.png
; \
234 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
; \
235 $(INSTALL_DATA
) desktop
/cups-64.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
/cups.png
; \
236 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
; \
237 $(INSTALL_DATA
) desktop
/cups-128.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
/cups.png
; \
241 # Install header files...
245 for
dir in
$(DIRS
); do\
246 echo Installing header files in
$$dir...
;\
247 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
252 # Install programs...
256 for
dir in
$(DIRS
); do\
257 echo Installing programs in
$$dir...
;\
258 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
263 # Install libraries...
267 for
dir in
$(DIRS
); do\
268 echo Installing libraries in
$$dir...
;\
269 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
274 # Uninstall object and target files...
278 for
dir in
$(DIRS
); do\
279 echo Uninstalling in
$$dir...
;\
280 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
282 echo Uninstalling cups-config script...
283 $(RM
) $(BINDIR
)/cups-config
285 echo Uninstalling startup script...
286 if
test "x$(INITDIR)" != x
; then \
287 $(RM
) $(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
288 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/init.d
; \
289 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc0.d
/K00cups
; \
290 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
291 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc2.d
/S99cups
; \
292 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc2.d
; \
293 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc3.d
/S99cups
; \
294 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc3.d
; \
295 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc5.d
/S99cups
; \
296 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc5.d
; \
298 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
299 if
test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
300 $(RM
) $(BUILDROOT
)$(INITDDIR
)/PrintingServices
; \
301 $(RM
) $(BUILDROOT
)$(INITDDIR
)/StartupParameters.plist
; \
302 $(RM
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
/Localizable.strings
; \
303 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
; \
304 elif
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
305 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cupsd.plist
; \
306 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cups-lpd.plist
; \
307 $(RMDIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
309 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
311 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
); \
313 if
test "x$(DBUSDIR)" != x
; then \
314 echo Uninstalling cups.conf in
$(DBUSDIR
)...
;\
315 $(RM
) $(BUILDROOT
)$(DBUSDIR
)/cups.conf
; \
316 $(RMDIR
) $(BUILDROOT
)$(DBUSDIR
); \
318 $(RM
) $(BUILDROOT
)/etc
/xinetd.d
/cups-lpd
319 $(RM
) $(BUILDROOT
)/usr
/share
/applications
/cups.desktop
320 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/16x16
/apps
/cups.png
321 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/32x32
/apps
/cups.png
322 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/64x64
/apps
/cups.png
323 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/128x128
/apps
/cups.png
327 # Run the test suite...
331 echo Running CUPS
test suite...
332 cd
test; .
/run-stp-tests.sh
336 echo Running CUPS
test suite with defaults...
337 cd
test; .
/run-stp-tests.sh
1 0 n
341 # Make software distributions using EPM (http://www.easysw.com/epm/)...
344 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
346 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
347 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
350 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
353 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
356 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
361 $(MAKE
) $(MFLAGS
) epm
363 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
364 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
365 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
366 Linux
*) $(MAKE
) $(MFLAGS
) rpm
;; \
367 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
372 # End of "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $".