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/".
20 # Don't run top-level build targets in parallel...
27 # Directories to make...
30 DIRS
= cups
filter backend berkeley cgi-bin driver locale man monitor \
31 notifier ppdc scheduler systemv
test \
33 conf data doc
$(FONTS
) templates
42 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
43 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
44 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
46 echo Using CXX
="$(CC)"
47 echo Using DSOFLAGS
="$(DSOFLAGS)"
48 echo Using LDFLAGS
="$(LDFLAGS)"
49 echo Using LIBS
="$(LIBS)"
50 for
dir in
$(DIRS
); do\
51 echo Making
all in
$$dir...
;\
52 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all) || exit
1;\
57 # Make library targets...
61 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
62 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
63 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
65 echo Using CXX
="$(CC)"
66 echo Using DSOFLAGS
="$(DSOFLAGS)"
67 echo Using LDFLAGS
="$(LDFLAGS)"
68 echo Using LIBS
="$(LIBS)"
69 for
dir in
$(DIRS
); do\
70 echo Making libraries in
$$dir...
;\
71 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
76 # Make unit test targets...
80 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
81 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
82 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
84 echo Using CXX
="$(CC)"
85 echo Using DSOFLAGS
="$(DSOFLAGS)"
86 echo Using LDFLAGS
="$(LDFLAGS)"
87 echo Using LIBS
="$(LIBS)"
88 for
dir in
$(DIRS
); do\
89 echo Making
all in
$$dir...
;\
90 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
95 # Remove object and target files...
99 for
dir in
$(DIRS
); do\
100 echo Cleaning in
$$dir...
;\
101 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
106 # Remove all non-distribution files...
110 $(RM
) Makedefs config.h config.log config.status
112 $(RM
) conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
113 $(RM
) doc
/help
/ref-cupsd-conf.html doc
/help
/standard.html doc
/index.html
114 $(RM
) init
/cups.sh init
/cups-lpd init
/org.cups.cups-lpd.plist
115 $(RM
) man
/client.conf.man
116 $(RM
) man
/cups-deviced.man man
/cups-driverd.man
117 $(RM
) man
/cups-lpd.man man
/cupsaddsmb.man man
/cupsd.man
118 $(RM
) man
/cupsd.conf.man man
/lpoptions.man
119 $(RM
) packaging
/cups.list
120 $(RM
) templates
/header.tmpl
121 $(RM
) desktop
/cups.desktop
123 -$(RM
) doc
/*/index.html
124 -$(RM
) templates
/*/header.tmpl
125 -$(RM
) -r autom4te
*.cache
133 for
dir in
$(DIRS
); do\
134 echo Making dependencies in
$$dir...
;\
135 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
140 # Run the clang.llvm.org static code analysis tool on the C sources.
146 scan-build
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) \
147 CC
=ccc-analyzer CXX
=ccc-analyzer
clean all
151 # Generate a ctags file...
159 # Install everything...
162 install: install-data install-headers install-libs install-exec
166 # Install data files...
170 for
dir in
$(DIRS
); do\
171 echo Installing data files in
$$dir...
;\
172 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
174 echo Installing cups-config script...
175 $(INSTALL_DIR
) -m
755 $(BINDIR
)
176 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
177 if
test "x$(INITDIR)" != x
; then \
178 echo Installing init scripts...
; \
179 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/init.d
; \
180 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
181 for level in
$(RCLEVELS
); do \
182 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
183 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/S
$(RCSTART
)cups
; \
184 if
test `uname` = HP-UX
; then \
185 level
=`expr $$level - 1`; \
186 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
188 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/K
$(RCSTOP
)cups
; \
190 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
191 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc0.d
/K
$(RCSTOP
)cups
; \
193 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
194 $(INSTALL_DIR
) $(BUILDROOT
)$(INITDDIR
); \
195 if
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
196 echo Installing LaunchDaemons configuration files...
; \
197 $(INSTALL_DATA
) init
/org.cups.cupsd.plist
$(BUILDROOT
)$(DEFAULT_LAUNCHD_CONF
); \
198 $(INSTALL_DATA
) init
/org.cups.cups-lpd.plist
$(BUILDROOT
)/System
/Library
/LaunchDaemons
; \
201 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
202 $(INSTALL_SCRIPT
) init
/PrintingServices.launchd
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/PrintingServices
; \
203 $(INSTALL_DATA
) init
/StartupParameters.plist
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/StartupParameters.plist
; \
204 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
; \
205 $(INSTALL_DATA
) init
/Localizable.strings
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
/Localizable.strings
; \
209 echo Installing RC script...
; \
210 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
213 if
test "x$(SMFMANIFESTDIR)" != x
; then \
214 echo Installing SMF manifest in
$(SMFMANIFESTDIR
)...
;\
215 $(INSTALL_DIR
) $(BUILDROOT
)/$(SMFMANIFESTDIR
); \
216 $(INSTALL_SCRIPT
) init
/cups.xml
$(BUILDROOT
)$(SMFMANIFESTDIR
)/cups.xml
; \
218 if
test "x$(DBUSDIR)" != x
; then \
219 echo Installing cups.conf in
$(DBUSDIR
)...
;\
220 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(DBUSDIR
)/system.d
; \
221 $(INSTALL_DATA
) packaging
/cups-dbus.conf
$(BUILDROOT
)$(DBUSDIR
)/system.d
/cups.conf
; \
223 if
test "x$(XINETD)" != x
; then \
224 echo Installing xinetd configuration file for cups-lpd...
; \
225 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(XINETD
); \
226 $(INSTALL_DATA
) init
/cups-lpd
$(BUILDROOT
)$(XINETD
)/cups-lpd
; \
228 if
test "x$(MENUDIR)" != x
; then \
229 echo Installing desktop menu...
; \
230 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(MENUDIR
); \
231 $(INSTALL_DATA
) desktop
/cups.desktop
$(BUILDROOT
)$(MENUDIR
); \
233 if
test "x$(ICONDIR)" != x
; then \
234 echo Installing desktop icons...
; \
235 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
; \
236 $(INSTALL_DATA
) desktop
/cups-16.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
/cups.png
; \
237 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
; \
238 $(INSTALL_DATA
) desktop
/cups-32.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
/cups.png
; \
239 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
; \
240 $(INSTALL_DATA
) desktop
/cups-64.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
/cups.png
; \
241 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
; \
242 $(INSTALL_DATA
) desktop
/cups-128.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
/cups.png
; \
246 # Install header files...
250 for
dir in
$(DIRS
); do\
251 echo Installing header files in
$$dir...
;\
252 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
257 # Install programs...
261 for
dir in
$(DIRS
); do\
262 echo Installing programs in
$$dir...
;\
263 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
268 # Install libraries...
272 for
dir in
$(DIRS
); do\
273 echo Installing libraries in
$$dir...
;\
274 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
279 # Uninstall object and target files...
283 for
dir in
$(DIRS
); do\
284 echo Uninstalling in
$$dir...
;\
285 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
287 echo Uninstalling cups-config script...
288 $(RM
) $(BINDIR
)/cups-config
290 echo Uninstalling startup script...
291 if
test "x$(INITDIR)" != x
; then \
292 $(RM
) $(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
293 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/init.d
; \
294 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc0.d
/K00cups
; \
295 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
296 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc2.d
/S99cups
; \
297 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc2.d
; \
298 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc3.d
/S99cups
; \
299 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc3.d
; \
300 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc5.d
/S99cups
; \
301 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc5.d
; \
303 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
304 if
test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
305 $(RM
) $(BUILDROOT
)$(INITDDIR
)/PrintingServices
; \
306 $(RM
) $(BUILDROOT
)$(INITDDIR
)/StartupParameters.plist
; \
307 $(RM
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
/Localizable.strings
; \
308 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
; \
309 elif
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
310 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cupsd.plist
; \
311 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cups-lpd.plist
; \
312 $(RMDIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
314 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
316 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
); \
318 if
test "x$(DBUSDIR)" != x
; then \
319 echo Uninstalling cups.conf in
$(DBUSDIR
)...
;\
320 $(RM
) $(BUILDROOT
)$(DBUSDIR
)/cups.conf
; \
321 $(RMDIR
) $(BUILDROOT
)$(DBUSDIR
); \
323 $(RM
) $(BUILDROOT
)/etc
/xinetd.d
/cups-lpd
324 $(RM
) $(BUILDROOT
)/usr
/share
/applications
/cups.desktop
325 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/16x16
/apps
/cups.png
326 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/32x32
/apps
/cups.png
327 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/64x64
/apps
/cups.png
328 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/128x128
/apps
/cups.png
332 # Run the test suite...
336 echo Running CUPS
test suite...
337 cd
test; .
/run-stp-tests.sh
341 echo Running CUPS
test suite with defaults...
342 cd
test; .
/run-stp-tests.sh
1 0 n
346 # Make software distributions using EPM (http://www.easysw.com/epm/)...
349 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
351 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
352 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
355 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
358 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
361 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
366 $(MAKE
) $(MFLAGS
) epm
368 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
369 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
370 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
371 Linux
*) $(MAKE
) $(MFLAGS
) rpm
;; \
372 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
377 # End of "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $".