2 # "$Id: Makefile 11173 2013-07-23 12:31:34Z msweet $"
4 # Top-level Makefile for CUPS.
6 # Copyright 2007-2013 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)
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/cups-files.conf conf/cupsd.conf
103 $(RM) conf/mime.convs conf/pam.std conf/snmp.conf
104 $(RM) doc/help/ref-cups-files-conf.html doc/help/ref-cupsd-conf.html
105 $(RM) doc/help/standard.html doc/index.html
106 $(RM) man/client.conf.man
107 $(RM) man/cups-deviced.man man/cups-driverd.man
108 $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
109 $(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
110 $(RM) packaging/cups.list
111 $(RM) packaging/cups-desc.plist packaging/cups-info.plist
112 $(RM) templates/header.tmpl
113 $(RM) desktop/cups.desktop
114 $(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd
115 $(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml
116 -$(RM) doc/*/index.html
117 -$(RM) templates/*/header.tmpl
118 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
126 for dir in $(DIRS); do\
127 echo Making dependencies in $$dir... ;\
128 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
133 # Run the clang.llvm.org static code analysis tool on the C sources.
134 # (at least checker-231 is required for scan-build to work this way)
137 .PHONY: clang clang-changes
140 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
142 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
146 # Generate a ctags file...
154 # Install everything...
157 install: install-data install-headers install-libs install-exec
161 # Install data files...
165 echo Making all in cups...
166 (cd cups; $(MAKE) $(MFLAGS) all)
167 for dir in $(DIRS); do\
168 echo Installing data files in $$dir... ;\
169 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
171 echo Installing cups-config script...
172 $(INSTALL_DIR) -m 755 $(BINDIR)
173 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
177 # Install header files...
181 for dir in $(DIRS); do\
182 echo Installing header files in $$dir... ;\
183 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
185 if test "x$(privateinclude)" != x; then \
186 echo Installing config.h into $(PRIVATEINCLUDE)...; \
187 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
188 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
193 # Install programs...
197 for dir in $(DIRS); do\
198 echo Installing programs in $$dir... ;\
199 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
204 # Install libraries...
208 for dir in $(DIRS); do\
209 echo Installing libraries in $$dir... ;\
210 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
215 # Uninstall object and target files...
219 for dir in $(DIRS); do\
220 echo Uninstalling in $$dir... ;\
221 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
223 echo Uninstalling cups-config script...
224 $(RM) $(BINDIR)/cups-config
229 # Run the test suite...
233 echo Running CUPS test suite...
234 cd test; ./run-stp-tests.sh
238 echo Running CUPS test suite with defaults...
239 cd test; ./run-stp-tests.sh 1 0 n n
241 debugcheck: all unittests
242 echo Running CUPS test suite with debug printfs...
243 cd test; ./run-stp-tests.sh 1 0 n y
247 # Create HTML documentation...
251 for dir in cgi-bin cups filter ppdc scheduler; do\
252 echo Generating API help in $$dir... ;\
253 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
257 for dir in cgi-bin cups filter ppdc scheduler; do\
258 echo Generating framed API help in $$dir... ;\
259 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
264 # Create an Xcode docset...
268 echo Generating docset directory tree...
269 $(RM) -r org.cups.docset
270 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
271 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
272 cd man; $(MAKE) $(MFLAGS) html
273 cd doc; $(MAKE) $(MFLAGS) docset
274 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
275 cgi-bin/makedocset org.cups.docset \
276 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
277 doc/help/api-*.tokens
278 $(RM) doc/help/api-*.tokens
279 echo Indexing docset...
280 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
281 echo Generating docset archive and feed...
282 $(RM) org.cups.docset.atom
283 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
284 --atom org.cups.docset.atom \
285 --download-url http://www.cups.org/org.cups.docset.xar \
290 # Lines of code computation...
294 for dir in cups scheduler; do \
295 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
300 # Make software distributions using EPM (http://www.epmhome.org/)...
303 EPMFLAGS = -v --output-dir dist $(EPMARCH)
305 aix bsd deb depot inst pkg setld slackware swinstall tardist:
306 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
309 epm $(EPMFLAGS) -s packaging/installer.gif 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*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
323 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
328 # Don't run top-level build targets in parallel...
335 # End of "$Id: Makefile 11173 2013-07-23 12:31:34Z msweet $".