2 # "$Id: Makefile 7961 2008-09-17 19:52:46Z 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 $(UNITTESTS
)) || 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
/drv.man man
/lpoptions.man
119 $(RM
) packaging
/cups.list
120 $(RM
) packaging
/cups-desc.plist packaging
/cups-info.plist
121 $(RM
) templates
/header.tmpl
122 $(RM
) desktop
/cups.desktop
124 -$(RM
) doc
/*/index.html
125 -$(RM
) templates
/*/header.tmpl
126 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale driver
/test
134 for
dir in
$(DIRS
); do\
135 echo Making dependencies in
$$dir...
;\
136 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
141 # Run the clang.llvm.org static code analysis tool on the C sources.
147 scan-build
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) \
148 CC
=ccc-analyzer CXX
=ccc-analyzer
clean all
152 # Generate a ctags file...
160 # Install everything...
163 install: install-data install-headers install-libs install-exec
167 # Install data files...
171 for
dir in
$(DIRS
); do\
172 echo Installing data files in
$$dir...
;\
173 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
175 echo Installing cups-config script...
176 $(INSTALL_DIR
) -m
755 $(BINDIR
)
177 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
178 if
test "x$(INITDIR)" != x
; then \
179 echo Installing init scripts...
; \
180 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/init.d
; \
181 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
182 for level in
$(RCLEVELS
); do \
183 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
184 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/S
$(RCSTART
)cups
; \
185 if
test `uname` = HP-UX
; then \
186 level
=`expr $$level - 1`; \
187 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
189 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/K
$(RCSTOP
)cups
; \
191 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
192 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc0.d
/K
$(RCSTOP
)cups
; \
194 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
195 $(INSTALL_DIR
) $(BUILDROOT
)$(INITDDIR
); \
196 if
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
197 echo Installing LaunchDaemons configuration files...
; \
198 $(INSTALL_DATA
) init
/org.cups.cupsd.plist
$(BUILDROOT
)$(DEFAULT_LAUNCHD_CONF
); \
199 $(INSTALL_DATA
) init
/org.cups.cups-lpd.plist
$(BUILDROOT
)/System
/Library
/LaunchDaemons
; \
202 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
203 $(INSTALL_SCRIPT
) init
/PrintingServices.launchd
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/PrintingServices
; \
204 $(INSTALL_DATA
) init
/StartupParameters.plist
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/StartupParameters.plist
; \
205 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
; \
206 $(INSTALL_DATA
) init
/Localizable.strings
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
/Localizable.strings
; \
210 echo Installing RC script...
; \
211 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
214 if
test "x$(SMFMANIFESTDIR)" != x
; then \
215 echo Installing SMF manifest in
$(SMFMANIFESTDIR
)...
;\
216 $(INSTALL_DIR
) $(BUILDROOT
)/$(SMFMANIFESTDIR
); \
217 $(INSTALL_SCRIPT
) init
/cups.xml
$(BUILDROOT
)$(SMFMANIFESTDIR
)/cups.xml
; \
219 if
test "x$(DBUSDIR)" != x
; then \
220 echo Installing cups.conf in
$(DBUSDIR
)...
;\
221 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(DBUSDIR
)/system.d
; \
222 $(INSTALL_DATA
) packaging
/cups-dbus.conf
$(BUILDROOT
)$(DBUSDIR
)/system.d
/cups.conf
; \
224 if
test "x$(XINETD)" != x
; then \
225 echo Installing xinetd configuration file for cups-lpd...
; \
226 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(XINETD
); \
227 $(INSTALL_DATA
) init
/cups-lpd
$(BUILDROOT
)$(XINETD
)/cups-lpd
; \
229 if
test "x$(MENUDIR)" != x
; then \
230 echo Installing desktop menu...
; \
231 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(MENUDIR
); \
232 $(INSTALL_DATA
) desktop
/cups.desktop
$(BUILDROOT
)$(MENUDIR
); \
234 if
test "x$(ICONDIR)" != x
; then \
235 echo Installing desktop icons...
; \
236 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
; \
237 $(INSTALL_DATA
) desktop
/cups-16.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
/cups.png
; \
238 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
; \
239 $(INSTALL_DATA
) desktop
/cups-32.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
/cups.png
; \
240 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
; \
241 $(INSTALL_DATA
) desktop
/cups-64.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
/cups.png
; \
242 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
; \
243 $(INSTALL_DATA
) desktop
/cups-128.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
/cups.png
; \
247 # Install header files...
251 for
dir in
$(DIRS
); do\
252 echo Installing header files in
$$dir...
;\
253 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
258 # Install programs...
262 for
dir in
$(DIRS
); do\
263 echo Installing programs in
$$dir...
;\
264 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
269 # Install libraries...
273 for
dir in
$(DIRS
); do\
274 echo Installing libraries in
$$dir...
;\
275 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
280 # Uninstall object and target files...
284 for
dir in
$(DIRS
); do\
285 echo Uninstalling in
$$dir...
;\
286 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
288 echo Uninstalling cups-config script...
289 $(RM
) $(BINDIR
)/cups-config
291 echo Uninstalling startup script...
292 if
test "x$(INITDIR)" != x
; then \
293 $(RM
) $(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
294 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/init.d
; \
295 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc0.d
/K00cups
; \
296 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
297 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc2.d
/S99cups
; \
298 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc2.d
; \
299 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc3.d
/S99cups
; \
300 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc3.d
; \
301 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc5.d
/S99cups
; \
302 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc5.d
; \
304 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
305 if
test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
306 $(RM
) $(BUILDROOT
)$(INITDDIR
)/PrintingServices
; \
307 $(RM
) $(BUILDROOT
)$(INITDDIR
)/StartupParameters.plist
; \
308 $(RM
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
/Localizable.strings
; \
309 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
; \
310 elif
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
311 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cupsd.plist
; \
312 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cups-lpd.plist
; \
313 $(RMDIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
315 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
317 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
); \
319 if
test "x$(DBUSDIR)" != x
; then \
320 echo Uninstalling cups.conf in
$(DBUSDIR
)...
;\
321 $(RM
) $(BUILDROOT
)$(DBUSDIR
)/cups.conf
; \
322 $(RMDIR
) $(BUILDROOT
)$(DBUSDIR
); \
324 $(RM
) $(BUILDROOT
)/etc
/xinetd.d
/cups-lpd
325 $(RM
) $(BUILDROOT
)/usr
/share
/applications
/cups.desktop
326 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/16x16
/apps
/cups.png
327 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/32x32
/apps
/cups.png
328 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/64x64
/apps
/cups.png
329 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/128x128
/apps
/cups.png
333 # Run the test suite...
337 echo Running CUPS
test suite...
338 cd
test; .
/run-stp-tests.sh
342 echo Running CUPS
test suite with defaults...
343 cd
test; .
/run-stp-tests.sh
1 0 n
347 # Make software distributions using EPM (http://www.easysw.com/epm/)...
350 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
352 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
353 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
356 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
359 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
362 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
367 $(MAKE
) $(MFLAGS
) epm
369 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
370 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
371 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
372 Linux
*) $(MAKE
) $(MFLAGS
) rpm
;; \
373 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
378 # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $".