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.
134 .PHONY
: clang clang-changes
137 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) clean all
139 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) all
143 # Run the STACK tool on the sources, available here:
145 # http://css.csail.mit.edu/stack/
147 # Do the following to pass options to configure:
149 # make CONFIGFLAGS="--foo --bar" stack
154 stack-build .
/configure
$(CONFIGFLAGS
)
155 stack-build
$(MAKE
) $(MFLAGS
) clean all
157 $(MAKE
) $(MFLAGS
) distclean
163 # Generate a ctags file...
171 # Install everything...
174 install: install-data install-headers install-libs install-exec
178 # Install data files...
182 echo Making
all in cups...
183 (cd cups
; $(MAKE
) $(MFLAGS
) all)
184 for
dir in
$(DIRS
); do\
185 echo Installing data files in
$$dir...
;\
186 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
188 echo Installing cups-config script...
189 $(INSTALL_DIR
) -m
755 $(BINDIR
)
190 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
194 # Install header files...
198 for
dir in
$(DIRS
); do\
199 echo Installing header files in
$$dir...
;\
200 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
202 if
test "x$(privateinclude)" != x
; then \
203 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
204 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
205 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
210 # Install programs...
214 for
dir in
$(DIRS
); do\
215 echo Installing programs in
$$dir...
;\
216 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
221 # Install libraries...
225 for
dir in
$(DIRS
); do\
226 echo Installing libraries in
$$dir...
;\
227 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
232 # Uninstall object and target files...
236 for
dir in
$(DIRS
); do\
237 echo Uninstalling in
$$dir...
;\
238 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
240 echo Uninstalling cups-config script...
241 $(RM
) $(BINDIR
)/cups-config
246 # Run the test suite...
250 echo Running CUPS
test suite...
251 cd
test; .
/run-stp-tests.sh
255 echo Running CUPS
test suite with defaults...
256 cd
test; .
/run-stp-tests.sh
1 0 n n
258 debugcheck
: all unittests
259 echo Running CUPS
test suite with debug printfs...
260 cd
test; .
/run-stp-tests.sh
1 0 n y
264 # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
268 for
dir in cgi-bin cups
filter ppdc scheduler
; do\
269 echo Generating API help in
$$dir...
;\
270 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
274 for
dir in cgi-bin cups
filter ppdc scheduler
; do\
275 echo Generating framed API help in
$$dir...
;\
276 (cd
$$dir; $(MAKE
) $(MFLAGS
) framedhelp
) || exit
1;\
281 # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
285 echo Generating docset directory tree...
286 $(RM
) -r org.cups.docset
287 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/help
288 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/images
289 cd man
; $(MAKE
) $(MFLAGS
) html
290 cd doc
; $(MAKE
) $(MFLAGS
) docset
291 cd cgi-bin
; $(MAKE
) $(MFLAGS
) makedocset
292 cgi-bin
/makedocset org.cups.docset \
293 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
294 doc
/help
/api-
*.tokens
295 $(RM
) doc
/help
/api-
*.tokens
296 echo Indexing docset...
297 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil index org.cups.docset
298 echo Generating docset archive and feed...
299 $(RM
) org.cups.docset.atom
300 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil package
--output org.cups.docset.xar \
301 --atom org.cups.docset.atom \
302 --download-url http
://www.cups.org
/org.cups.docset.xar \
307 # Lines of code computation...
311 for
dir in cups scheduler
; do \
312 (cd
$$dir; $(MAKE
) $(MFLAGS
) sloc
) || exit
1;\
317 # Make software distributions using EPM (http://www.msweet.org/)...
320 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
322 bsd deb pkg slackware
:
323 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
326 epm
$(EPMFLAGS
) -s packaging
/installer.gif cups packaging
/cups.list
329 epm
$(EPMFLAGS
) -f rpm
-s packaging
/installer.gif cups packaging
/cups.list
334 $(MAKE
) $(MFLAGS
) epm
336 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
337 Darwin
*) $(MAKE
) $(MFLAGS
) osx
;; \
338 Linux
*) test ! -x
/usr
/bin
/rpm ||
$(MAKE
) $(MFLAGS
) rpm
;; \
339 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
344 # Don't run top-level build targets in parallel...