2 # "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $"
4 # Top-level Makefile for CUPS.
6 # Copyright 2007-2010 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 # Directories to make...
23 DIRS
= cups
test $(BUILDDIRS
) $(PHPDIR
) $(FONTS
)
32 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
33 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
34 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
36 echo Using CXX
="$(CC)"
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 $(UNITTESTS
)) || 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)"
55 echo Using CXX
="$(CC)"
56 echo Using DSOFLAGS
="$(DSOFLAGS)"
57 echo Using LDFLAGS
="$(LDFLAGS)"
58 echo Using LIBS
="$(LIBS)"
59 for
dir in
$(DIRS
); do\
60 echo Making libraries in
$$dir...
;\
61 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
66 # Make unit test targets...
70 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
71 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
72 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
74 echo Using CXX
="$(CC)"
75 echo Using DSOFLAGS
="$(DSOFLAGS)"
76 echo Using LDFLAGS
="$(LDFLAGS)"
77 echo Using LIBS
="$(LIBS)"
78 for
dir in
$(DIRS
); do\
79 echo Making
all in
$$dir...
;\
80 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
85 # Remove object and target files...
89 for
dir in
$(DIRS
); do\
90 echo Cleaning in
$$dir...
;\
91 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
96 # Remove all non-distribution files...
100 $(RM
) Makedefs config.h config.log config.status
102 $(RM
) conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
103 $(RM
) doc
/help
/ref-cupsd-conf.html doc
/help
/standard.html doc
/index.html
104 $(RM
) man
/client.conf.man
105 $(RM
) man
/cups-deviced.man man
/cups-driverd.man
106 $(RM
) man
/cups-lpd.man man
/cupsaddsmb.man man
/cupsd.man
107 $(RM
) man
/cupsd.conf.man man
/drv.man man
/lpoptions.man
108 $(RM
) packaging
/cups.list
109 $(RM
) packaging
/cups-desc.plist packaging
/cups-info.plist
110 $(RM
) templates
/header.tmpl
111 $(RM
) desktop
/cups.desktop
112 $(RM
) scheduler
/cups.sh scheduler
/cups-lpd.xinetd
113 $(RM
) scheduler
/org.cups.cups-lpd.plist scheduler
/cups.xml
114 -$(RM
) doc
/*/index.html
115 -$(RM
) templates
/*/header.tmpl
116 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale driver
/test
124 for
dir in
$(DIRS
); do\
125 echo Making dependencies in
$$dir...
;\
126 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
131 # Run the clang.llvm.org static code analysis tool on the C sources.
132 # (at least checker-231 is required for scan-build to work this way)
135 .PHONY
: clang clang-changes
138 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) clean all
140 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) all
144 # Generate a ctags file...
152 # Install everything...
155 install: install-data install-headers install-libs install-exec
159 # Install data files...
163 for
dir in
$(DIRS
); do\
164 echo Installing data files in
$$dir...
;\
165 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
167 echo Installing cups-config script...
168 $(INSTALL_DIR
) -m
755 $(BINDIR
)
169 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
173 # Install header files...
177 for
dir in
$(DIRS
); do\
178 echo Installing header files in
$$dir...
;\
179 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
181 if
test "x$(privateinclude)" != x
; then \
182 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
183 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
184 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
189 # Install programs...
193 for
dir in
$(DIRS
); do\
194 echo Installing programs in
$$dir...
;\
195 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
200 # Install libraries...
204 for
dir in
$(DIRS
); do\
205 echo Installing libraries in
$$dir...
;\
206 (cd
$$dir; $(MAKE
) $(MFLAGS
) 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
225 # Run the test suite...
229 echo Running CUPS
test suite...
230 cd
test; .
/run-stp-tests.sh
234 echo Running CUPS
test suite with defaults...
235 cd
test; .
/run-stp-tests.sh
1 0 n
239 # Create HTML documentation...
243 for
dir in cgi-bin cups
filter driver ppdc scheduler
; do\
244 echo Generating API help in
$$dir...
;\
245 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
249 for
dir in cgi-bin cups
filter driver ppdc scheduler
; do\
250 echo Generating framed API help in
$$dir...
;\
251 (cd
$$dir; $(MAKE
) $(MFLAGS
) framedhelp
) || exit
1;\
256 # Create an Xcode docset...
260 echo Generating docset directory tree...
261 $(RM
) -r org.cups.docset
262 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/help
263 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/images
264 cd man
; $(MAKE
) $(MFLAGS
) html
265 cd doc
; $(MAKE
) $(MFLAGS
) docset
266 cd cgi-bin
; $(MAKE
) $(MFLAGS
) makedocset
267 cgi-bin
/makedocset org.cups.docset \
268 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
269 doc
/help
/api-
*.tokens
270 $(RM
) doc
/help
/api-
*.tokens
271 echo Indexing docset...
272 /Developer
/usr
/bin
/docsetutil index org.cups.docset
273 echo Generating docset archive and feed...
274 $(RM
) org.cups.docset.atom
275 /Developer
/usr
/bin
/docsetutil package
--output org.cups.docset.xar \
276 --atom org.cups.docset.atom \
277 --download-url http
://www.cups.org
/org.cups.docset.xar \
282 # Make software distributions using EPM (http://www.epmhome.org/)...
285 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
287 aix bsd deb depot inst pkg setld slackware swinstall tardist
:
288 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
291 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
294 epm
$(EPMFLAGS
) -f osx
-s packaging
/installer.tif cups packaging
/cups.list
297 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
302 $(MAKE
) $(MFLAGS
) epm
304 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
305 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
306 IRIX
*) $(MAKE
) $(MFLAGS
) tardist
;; \
307 Linux
*) test ! -x
/usr
/bin
/rpm ||
$(MAKE
) $(MFLAGS
) rpm
;; \
308 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
313 # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $".