4 # Top-level Makefile for CUPS.
6 # Copyright 2007-2014 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
101 $(RM
) conf
/cups-files.conf conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
104 $(RM
) desktop
/cups.desktop
106 $(RM
) man
/client.conf.man man
/cups-files.conf.man man
/cups-lpd.man man
/cups-snmp.man man
/cupsaddsmb.man man
/cupsd.conf.man man
/cupsd.man man
/lpoptions.man
107 $(RM
) packaging
/cups.list
108 $(RM
) scheduler
/cups-lpd.xinetd scheduler
/cups.sh scheduler
/cups.xml scheduler
/org.cups.cups-lpd.plist scheduler
/org.cups.cups-lpdAT.service scheduler
/org.cups.cupsd.path scheduler
/org.cups.cupsd.service scheduler
/org.cups.cupsd.socket
109 $(RM
) templates
/header.tmpl
110 -$(RM
) doc
/*/index.html
111 -$(RM
) templates
/*/header.tmpl
112 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale
120 for
dir in
$(DIRS
); do\
121 echo Making dependencies in
$$dir...
;\
122 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
127 # Run the Clang static code analysis tool on the sources, available here:
129 # http://clang-analyzer.llvm.org
131 # At least checker-231 is required.
133 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
134 # output instead of HTML...)
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 # Run the STACK tool on the sources, available here:
148 # http://css.csail.mit.edu/stack/
150 # Do the following to pass options to configure:
152 # make CONFIGFLAGS="--foo --bar" stack
157 stack-build .
/configure
$(CONFIGFLAGS
)
158 stack-build
$(MAKE
) $(MFLAGS
) clean all
160 $(MAKE
) $(MFLAGS
) distclean
166 # Generate a ctags file...
174 # Install everything...
177 install: install-data install-headers install-libs install-exec
181 # Install data files...
185 echo Making
all in cups...
186 (cd cups
; $(MAKE
) $(MFLAGS
) all)
187 for
dir in
$(DIRS
); do\
188 echo Installing data files in
$$dir...
;\
189 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
191 echo Installing cups-config script...
192 $(INSTALL_DIR
) -m
755 $(BINDIR
)
193 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
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;\
205 if
test "x$(privateinclude)" != x
; then \
206 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
207 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
208 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
213 # Install programs...
217 for
dir in
$(DIRS
); do\
218 echo Installing programs in
$$dir...
;\
219 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
224 # Install libraries...
228 for
dir in
$(DIRS
); do\
229 echo Installing libraries in
$$dir...
;\
230 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
235 # Uninstall object and target files...
239 for
dir in
$(DIRS
); do\
240 echo Uninstalling in
$$dir...
;\
241 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
243 echo Uninstalling cups-config script...
244 $(RM
) $(BINDIR
)/cups-config
249 # Run the test suite...
253 echo Running CUPS
test suite...
254 cd
test; .
/run-stp-tests.sh
258 echo Running CUPS
test suite with defaults...
259 cd
test; .
/run-stp-tests.sh
1 0 n n
261 debugcheck
: all unittests
262 echo Running CUPS
test suite with debug printfs...
263 cd
test; .
/run-stp-tests.sh
1 0 n y
267 # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
271 for
dir in cgi-bin cups
filter ppdc scheduler
; do\
272 echo Generating API help in
$$dir...
;\
273 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
277 for
dir in cgi-bin cups
filter ppdc scheduler
; do\
278 echo Generating framed API help in
$$dir...
;\
279 (cd
$$dir; $(MAKE
) $(MFLAGS
) framedhelp
) || exit
1;\
284 # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
288 echo Generating docset directory tree...
289 $(RM
) -r org.cups.docset
290 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/help
291 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/images
292 cd man
; $(MAKE
) $(MFLAGS
) html
293 cd doc
; $(MAKE
) $(MFLAGS
) docset
294 cd cgi-bin
; $(MAKE
) $(MFLAGS
) makedocset
295 cgi-bin
/makedocset org.cups.docset \
296 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
297 doc
/help
/api-
*.tokens
298 $(RM
) doc
/help
/api-
*.tokens
299 echo Indexing docset...
300 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil index org.cups.docset
301 echo Generating docset archive and feed...
302 $(RM
) org.cups.docset.atom
303 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil package
--output org.cups.docset.xar \
304 --atom org.cups.docset.atom \
305 --download-url http
://www.cups.org
/org.cups.docset.xar \
310 # Lines of code computation...
314 for
dir in cups scheduler
; do \
315 (cd
$$dir; $(MAKE
) $(MFLAGS
) sloc
) || exit
1;\
320 # Make software distributions using EPM (http://www.msweet.org/)...
323 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
325 bsd deb pkg slackware
:
326 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
329 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
332 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
337 $(MAKE
) $(MFLAGS
) epm
339 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
340 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
341 Linux
*) test ! -x
/usr
/bin
/rpm ||
$(MAKE
) $(MFLAGS
) rpm
;; \
342 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
347 # Don't run top-level build targets in parallel...