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)"
37 echo Using DSOFLAGS
="$(DSOFLAGS)"
38 echo Using LDFLAGS
="$(LDFLAGS)"
39 echo Using LIBS
="$(LIBS)"
40 for
dir in
$(DIRS
); do\
41 echo Making
all in
$$dir...
;\
42 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all) || exit
1;\
47 # Make library targets...
51 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
52 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
53 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
54 echo Using DSOFLAGS
="$(DSOFLAGS)"
55 echo Using LDFLAGS
="$(LDFLAGS)"
56 echo Using LIBS
="$(LIBS)"
57 for
dir in
$(DIRS
); do\
58 echo Making libraries in
$$dir...
;\
59 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
64 # Remove object and target files...
68 for
dir in
$(DIRS
); do\
69 echo Cleaning in
$$dir...
;\
70 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
75 # Remove all non-distribution files...
79 $(RM
) Makedefs config.h config.log config.status
81 $(RM
) conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
82 $(RM
) doc
/help
/ref-cupsd-conf.html doc
/help
/standard.html doc
/index.html
83 $(RM
) init
/cups.sh init
/cups-lpd init
/org.cups.cups-lpd.plist
84 $(RM
) man
/client.conf.man
85 $(RM
) man
/cups-deviced.man man
/cups-driverd.man
86 $(RM
) man
/cups-lpd.man man
/cupsaddsmb.man man
/cupsd.man
87 $(RM
) man
/cupsd.conf.man man
/lpoptions.man
88 $(RM
) packaging
/cups.list
89 $(RM
) templates
/header.tmpl
90 -$(RM
) doc
/*/index.html
91 -$(RM
) templates
/*/header.tmpl
92 -$(RM
) -r autom4te
*.cache
100 for
dir in
$(DIRS
); do\
101 echo Making dependencies in
$$dir...
;\
102 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
107 # Generate a ctags file...
115 # Install everything...
118 install: install-data install-headers install-libs install-exec
122 # Install data files...
126 for
dir in
$(DIRS
); do\
127 echo Installing data files in
$$dir...
;\
128 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
130 echo Installing cups-config script...
131 $(INSTALL_DIR
) -m
755 $(BINDIR
)
132 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
133 if
test "x$(INITDIR)" != x
; then \
134 echo Installing init scripts...
; \
135 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/init.d
; \
136 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
137 for level in
$(RCLEVELS
); do \
138 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
139 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/S
$(RCSTART
)cups
; \
140 if
test `uname` = HP-UX
; then \
141 level
=`expr $$level - 1`; \
142 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
144 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/K
$(RCSTOP
)cups
; \
146 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
147 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc0.d
/K
$(RCSTOP
)cups
; \
149 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
150 $(INSTALL_DIR
) $(BUILDROOT
)$(INITDDIR
); \
151 if
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
152 echo Installing LaunchDaemons configuration files...
; \
153 $(INSTALL_DATA
) init
/org.cups.cupsd.plist
$(BUILDROOT
)$(DEFAULT_LAUNCHD_CONF
); \
154 $(INSTALL_DATA
) init
/org.cups.cups-lpd.plist
$(BUILDROOT
)/System
/Library
/LaunchDaemons
; \
157 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
158 $(INSTALL_SCRIPT
) init
/PrintingServices.launchd
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/PrintingServices
; \
159 $(INSTALL_DATA
) init
/StartupParameters.plist
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/StartupParameters.plist
; \
160 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
; \
161 $(INSTALL_DATA
) init
/Localizable.strings
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
/Localizable.strings
; \
165 echo Installing RC script...
; \
166 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
169 if
test "x$(DBUSDIR)" != x
; then \
170 echo Installing cups.conf in
$(DBUSDIR
)...
;\
171 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(DBUSDIR
)/system.d
; \
172 $(INSTALL_DATA
) packaging
/cups-dbus.conf
$(BUILDROOT
)$(DBUSDIR
)/system.d
/cups.conf
; \
174 if
test "x$(XINETD)" != x
; then \
175 echo Installing xinetd configuration file for cups-lpd...
; \
176 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(XINETD
); \
177 $(INSTALL_DATA
) init
/cups-lpd
$(BUILDROOT
)$(XINETD
)/cups-lpd
; \
179 if
test "x$(MENUDIR)" != x
; then \
180 echo Installing desktop menu...
; \
181 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(MENUDIR
); \
182 $(INSTALL_DATA
) desktop
/cups.desktop
$(BUILDROOT
)$(MENUDIR
); \
184 if
test "x$(ICONDIR)" != x
; then \
185 echo Installing desktop icons...
; \
186 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
; \
187 $(INSTALL_DATA
) desktop
/cups-16.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
/cups.png
; \
188 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
; \
189 $(INSTALL_DATA
) desktop
/cups-32.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
/cups.png
; \
190 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
; \
191 $(INSTALL_DATA
) desktop
/cups-64.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
/cups.png
; \
192 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
; \
193 $(INSTALL_DATA
) desktop
/cups-128.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
/cups.png
; \
197 # Install header files...
201 for
dir in
$(DIRS
); do\
202 echo Installing header files in
$$dir...
;\
203 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
208 # Install programs...
212 for
dir in
$(DIRS
); do\
213 echo Installing programs in
$$dir...
;\
214 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
219 # Install libraries...
223 for
dir in
$(DIRS
); do\
224 echo Installing libraries in
$$dir...
;\
225 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
230 # Uninstall object and target files...
234 for
dir in
$(DIRS
); do\
235 echo Uninstalling in
$$dir...
;\
236 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
238 echo Uninstalling cups-config script...
239 $(RM
) $(BINDIR
)/cups-config
241 echo Uninstalling startup script...
242 if
test "x$(INITDIR)" != x
; then \
243 $(RM
) $(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
244 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/init.d
; \
245 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc0.d
/K00cups
; \
246 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
247 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc2.d
/S99cups
; \
248 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc2.d
; \
249 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc3.d
/S99cups
; \
250 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc3.d
; \
251 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc5.d
/S99cups
; \
252 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc5.d
; \
254 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
255 if
test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
256 $(RM
) $(BUILDROOT
)$(INITDDIR
)/PrintingServices
; \
257 $(RM
) $(BUILDROOT
)$(INITDDIR
)/StartupParameters.plist
; \
258 $(RM
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
/Localizable.strings
; \
259 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
; \
260 elif
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
261 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cupsd.plist
; \
262 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cups-lpd.plist
; \
263 $(RMDIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
265 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
267 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
); \
269 if
test "x$(DBUSDIR)" != x
; then \
270 echo Uninstalling cups.conf in
$(DBUSDIR
)...
;\
271 $(RM
) $(BUILDROOT
)$(DBUSDIR
)/cups.conf
; \
272 $(RMDIR
) $(BUILDROOT
)$(DBUSDIR
); \
274 $(RM
) $(BUILDROOT
)/etc
/xinetd.d
/cups-lpd
275 $(RM
) $(BUILDROOT
)/usr
/share
/applications
/cups.desktop
276 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/16x16
/apps
/cups.png
277 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/32x32
/apps
/cups.png
278 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/64x64
/apps
/cups.png
279 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/128x128
/apps
/cups.png
283 # Run the test suite...
287 echo Running CUPS
test suite...
288 cd
test; .
/run-stp-tests.sh
292 echo Running CUPS
test suite with defaults...
293 cd
test; .
/run-stp-tests.sh
1 0 n
297 # Make software distributions using EPM (http://www.easysw.com/epm/)...
300 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
302 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
303 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
306 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
309 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
312 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
317 $(MAKE
) $(MFLAGS
) epm
319 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
320 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
321 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
322 Linux
*) $(MAKE
) $(MFLAGS
) rpm
;; \
323 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
328 # End of "$Id: Makefile 7613 2008-05-22 23:27:52Z mike $".