2 # "$Id: Makefile 6897 2007-08-30 06:11:59Z 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 ALL_CFLAGS
="$(ALL_CFLAGS)"
35 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
36 echo Using LDFLAGS
="$(LDFLAGS)"
37 echo Using LIBS
="$(LIBS)"
38 for
dir in
$(DIRS
); do\
39 echo Making
all in
$$dir...
;\
40 (cd
$$dir ; $(MAKE
) $(MFLAGS
)) || exit
1;\
45 # Remove object and target files...
49 for
dir in
$(DIRS
); do\
50 echo Cleaning in
$$dir...
;\
51 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
56 # Remove all non-distribution files...
60 $(RM
) Makedefs config.h config.log config.status
62 $(RM
) conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
63 $(RM
) doc
/help
/ref-cupsd-conf.html doc
/help
/standard.html doc
/index.html
64 $(RM
) init
/cups.sh init
/cups-lpd init
/org.cups.cups-lpd.plist
65 $(RM
) man
/client.conf.man
66 $(RM
) man
/cups-deviced.man man
/cups-driverd.man
67 $(RM
) man
/cups-lpd.man man
/cupsaddsmb.man man
/cupsd.man
68 $(RM
) man
/cupsd.conf.man man
/lpoptions.man
69 $(RM
) packaging
/cups.list
70 $(RM
) templates
/header.tmpl
71 -$(RM
) doc
/*/index.html
72 -$(RM
) templates
/*/header.tmpl
73 -$(RM
) -r autom4te
*.cache
81 for
dir in
$(DIRS
); do\
82 echo Making dependencies in
$$dir...
;\
83 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
88 # Generate a ctags file...
96 # Install everything...
99 install: install-data install-headers install-libs install-exec
103 # Install data files...
107 for
dir in
$(DIRS
); do\
108 echo Installing data files in
$$dir...
;\
109 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
111 echo Installing cups-config script...
112 $(INSTALL_DIR
) -m
755 $(BINDIR
)
113 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
114 if
test "x$(INITDIR)" != x
; then \
115 echo Installing init scripts...
; \
116 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/init.d
; \
117 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
118 for level in
$(RCLEVELS
); do \
119 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
120 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/S
$(RCSTART
)cups
; \
121 if
test `uname` = HP-UX
; then \
122 level
=`expr $$level - 1`; \
123 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
; \
125 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc
$${level}.d
/K
$(RCSTOP
)cups
; \
127 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
128 $(LN
) ..
/init.d
/cups
$(BUILDROOT
)$(INITDIR
)/rc0.d
/K
$(RCSTOP
)cups
; \
130 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
131 $(INSTALL_DIR
) $(BUILDROOT
)$(INITDDIR
); \
132 if
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
133 echo Installing LaunchDaemons configuration files...
; \
134 $(INSTALL_DATA
) init
/org.cups.cupsd.plist
$(BUILDROOT
)$(DEFAULT_LAUNCHD_CONF
); \
135 $(INSTALL_DATA
) init
/org.cups.cups-lpd.plist
$(BUILDROOT
)/System
/Library
/LaunchDaemons
; \
138 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
139 $(INSTALL_SCRIPT
) init
/PrintingServices.launchd
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/PrintingServices
; \
140 $(INSTALL_DATA
) init
/StartupParameters.plist
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/StartupParameters.plist
; \
141 $(INSTALL_DIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
; \
142 $(INSTALL_DATA
) init
/Localizable.strings
$(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
/Resources
/English.lproj
/Localizable.strings
; \
146 echo Installing RC script...
; \
147 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
150 if
test "x$(DBUSDIR)" != x
; then \
151 echo Installing cups.conf in
$(DBUSDIR
)...
;\
152 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(DBUSDIR
)/system.d
; \
153 $(INSTALL_DATA
) packaging
/cups-dbus.conf
$(BUILDROOT
)$(DBUSDIR
)/system.d
/cups.conf
; \
155 if
test "x$(XINETD)" != x
; then \
156 echo Installing xinetd configuration file for cups-lpd...
; \
157 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(XINETD
); \
158 $(INSTALL_DATA
) init
/cups-lpd
$(BUILDROOT
)$(XINETD
)/cups-lpd
; \
160 if
test "x$(MENUDIR)" != x
; then \
161 echo Installing desktop menu...
; \
162 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(MENUDIR
); \
163 $(INSTALL_DATA
) desktop
/cups.desktop
$(BUILDROOT
)$(MENUDIR
); \
165 if
test "x$(ICONDIR)" != x
; then \
166 echo Installing desktop icons...
; \
167 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
; \
168 $(INSTALL_DATA
) desktop
/cups-16.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/16x16
/apps
/cups.png
; \
169 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
; \
170 $(INSTALL_DATA
) desktop
/cups-32.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/32x32
/apps
/cups.png
; \
171 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
; \
172 $(INSTALL_DATA
) desktop
/cups-64.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/64x64
/apps
/cups.png
; \
173 $(INSTALL_DIR
) -m
755 $(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
; \
174 $(INSTALL_DATA
) desktop
/cups-128.png
$(BUILDROOT
)$(ICONDIR
)/hicolor
/128x128
/apps
/cups.png
; \
178 # Install header files...
182 for
dir in
$(DIRS
); do\
183 echo Installing header files in
$$dir...
;\
184 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
189 # Install programs...
193 for
dir in
$(DIRS
); do\
194 echo Installing programs in
$$dir...
;\
195 (cd
$$dir; $(MAKE
) $(MFLAGS
) all install-exec
) || exit
1;\
200 # Install libraries...
204 for
dir in
$(DIRS
); do\
205 echo Installing libraries in
$$dir...
;\
206 (cd
$$dir; $(MAKE
) $(MFLAGS
) all install-libs
) || exit
1;\
211 # Uninstall object and target files...
215 for
dir in
$(DIRS
); do\
216 echo Uninstalling in
$$dir...
;\
217 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
219 echo Uninstalling cups-config script...
220 $(RM
) $(BINDIR
)/cups-config
222 echo Uninstalling startup script...
223 if
test "x$(INITDIR)" != x
; then \
224 $(RM
) $(BUILDROOT
)$(INITDIR
)/init.d
/cups
; \
225 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/init.d
; \
226 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc0.d
/K00cups
; \
227 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc0.d
; \
228 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc2.d
/S99cups
; \
229 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc2.d
; \
230 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc3.d
/S99cups
; \
231 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc3.d
; \
232 $(RM
) $(BUILDROOT
)$(INITDIR
)/rc5.d
/S99cups
; \
233 $(RMDIR
) $(BUILDROOT
)$(INITDIR
)/rc5.d
; \
235 if
test "x$(INITDIR)" = x
-a
"x$(INITDDIR)" != x
; then \
236 if
test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
237 $(RM
) $(BUILDROOT
)$(INITDDIR
)/PrintingServices
; \
238 $(RM
) $(BUILDROOT
)$(INITDDIR
)/StartupParameters.plist
; \
239 $(RM
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
/Localizable.strings
; \
240 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
)/Resources
/English.lproj
; \
241 elif
test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
242 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cupsd.plist
; \
243 $(RM
) $(BUILDROOT
)$(INITDDIR
)/org.cups.cups-lpd.plist
; \
244 $(RMDIR
) $(BUILDROOT
)/System
/Library
/StartupItems
/PrintingServices
; \
246 $(INSTALL_SCRIPT
) init
/cups.sh
$(BUILDROOT
)$(INITDDIR
)/cups
; \
248 $(RMDIR
) $(BUILDROOT
)$(INITDDIR
); \
250 if
test "x$(DBUSDIR)" != x
; then \
251 echo Uninstalling cups.conf in
$(DBUSDIR
)...
;\
252 $(RM
) $(BUILDROOT
)$(DBUSDIR
)/cups.conf
; \
253 $(RMDIR
) $(BUILDROOT
)$(DBUSDIR
); \
255 $(RM
) $(BUILDROOT
)/etc
/xinetd.d
/cups-lpd
256 $(RM
) $(BUILDROOT
)/usr
/share
/applications
/cups.desktop
257 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/16x16
/apps
/cups.png
258 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/32x32
/apps
/cups.png
259 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/64x64
/apps
/cups.png
260 $(RM
) $(BUILDROOT
)/usr
/share
/icons
/hicolor
/128x128
/apps
/cups.png
264 # Run the test suite...
268 echo Running CUPS
test suite...
269 cd
test; .
/run-stp-tests.sh
273 echo Running CUPS
test suite with defaults...
274 cd
test; .
/run-stp-tests.sh
1 0 n
278 # Make software distributions using EPM (http://www.easysw.com/epm/)...
281 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
283 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
284 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
287 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
290 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
293 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
298 $(MAKE
) $(MFLAGS
) epm
300 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
301 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
302 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
303 Linux
*) $(MAKE
) $(MFLAGS
) rpm
;; \
304 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
309 # End of "$Id: Makefile 6897 2007-08-30 06:11:59Z mike $".