2 # Top-level Makefile for CUPS.
4 # Copyright 2007-2016 by Apple Inc.
5 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more information.
14 # Directories to make...
17 DIRS
= cups
test $(BUILDDIRS
)
26 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
27 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
28 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
30 echo Using CXX
="$(CC)"
31 echo Using DSOFLAGS
="$(DSOFLAGS)"
32 echo Using LDFLAGS
="$(LDFLAGS)"
33 echo Using LIBS
="$(LIBS)"
34 for
dir in
$(DIRS
); do\
35 echo Making
all in
$$dir...
;\
36 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all $(UNITTESTS
)) || exit
1;\
41 # Make library targets...
45 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
46 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
47 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
49 echo Using CXX
="$(CC)"
50 echo Using DSOFLAGS
="$(DSOFLAGS)"
51 echo Using LDFLAGS
="$(LDFLAGS)"
52 echo Using LIBS
="$(LIBS)"
53 for
dir in
$(DIRS
); do\
54 echo Making libraries in
$$dir...
;\
55 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
60 # Make unit test targets...
64 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
65 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
66 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
68 echo Using CXX
="$(CC)"
69 echo Using DSOFLAGS
="$(DSOFLAGS)"
70 echo Using LDFLAGS
="$(LDFLAGS)"
71 echo Using LIBS
="$(LIBS)"
72 for
dir in
$(DIRS
); do\
73 echo Making
all in
$$dir...
;\
74 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
79 # Remove object and target files...
83 for
dir in
$(DIRS
); do\
84 echo Cleaning in
$$dir...
;\
85 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
90 # Remove all non-distribution files...
94 $(RM
) Makedefs config.h config.log config.status
95 $(RM
) conf
/cups-files.conf conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
98 $(RM
) desktop
/cups.desktop
100 $(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
101 $(RM
) packaging
/cups.list
102 $(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
103 $(RM
) templates
/header.tmpl
104 -$(RM
) doc
/*/index.html
105 -$(RM
) templates
/*/header.tmpl
106 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale
114 for
dir in
$(DIRS
); do\
115 echo Making dependencies in
$$dir...
;\
116 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
121 # Run the Clang static code analysis tool on the sources, available here:
123 # http://clang-analyzer.llvm.org
125 # At least checker-231 is required.
127 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
128 # output instead of HTML...)
131 .PHONY
: clang clang-changes
134 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) clean all
136 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) all
140 # Run the STACK tool on the sources, available here:
142 # http://css.csail.mit.edu/stack/
144 # Do the following to pass options to configure:
146 # make CONFIGFLAGS="--foo --bar" stack
151 stack-build .
/configure
$(CONFIGFLAGS
)
152 stack-build
$(MAKE
) $(MFLAGS
) clean all
154 $(MAKE
) $(MFLAGS
) distclean
160 # Generate a ctags file...
168 # Install everything...
171 install: install-data install-headers install-libs install-exec
175 # Install data files...
179 echo Making
all in cups...
180 (cd cups
; $(MAKE
) $(MFLAGS
) all)
181 for
dir in
$(DIRS
); do\
182 echo Installing data files in
$$dir...
;\
183 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
185 echo Installing cups-config script...
186 $(INSTALL_DIR
) -m
755 $(BINDIR
)
187 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
191 # Install header files...
195 for
dir in
$(DIRS
); do\
196 echo Installing header files in
$$dir...
;\
197 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
199 if
test "x$(privateinclude)" != x
; then \
200 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
201 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
202 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
207 # Install programs...
211 for
dir in
$(DIRS
); do\
212 echo Installing programs in
$$dir...
;\
213 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
218 # Install libraries...
222 for
dir in
$(DIRS
); do\
223 echo Installing libraries in
$$dir...
;\
224 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
229 # Uninstall object and target files...
233 for
dir in
$(DIRS
); do\
234 echo Uninstalling in
$$dir...
;\
235 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
237 echo Uninstalling cups-config script...
238 $(RM
) $(BINDIR
)/cups-config
243 # Run the test suite...
247 echo Running CUPS
test suite...
248 cd
test; .
/run-stp-tests.sh
252 echo Running CUPS
test suite with defaults...
253 cd
test; .
/run-stp-tests.sh
1 0 n n
255 debugcheck
: all unittests
256 echo Running CUPS
test suite with debug printfs...
257 cd
test; .
/run-stp-tests.sh
1 0 n y
261 # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
265 for
dir in cups
filter; do\
266 echo Generating API help in
$$dir...
;\
267 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
272 # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
276 echo Generating docset directory tree...
277 $(RM
) -r org.cups.docset
278 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/help
279 mkdir
-p org.cups.docset
/Contents
/Resources
/Documentation
/images
280 cd man
; $(MAKE
) $(MFLAGS
) html
281 cd doc
; $(MAKE
) $(MFLAGS
) docset
282 cd cgi-bin
; $(MAKE
) $(MFLAGS
) makedocset
283 cgi-bin
/makedocset org.cups.docset \
284 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
285 doc
/help
/api-
*.tokens
286 $(RM
) doc
/help
/api-
*.tokens
287 echo Indexing docset...
288 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil index org.cups.docset
289 echo Generating docset archive and feed...
290 $(RM
) org.cups.docset.atom
291 /Applications
/Xcode.app
/Contents
/Developer
/usr
/bin
/docsetutil package
--output org.cups.docset.xar \
292 --atom org.cups.docset.atom \
293 --download-url http
://www.cups.org
/org.cups.docset.xar \
298 # Lines of code computation...
302 for
dir in cups scheduler
; do \
303 (cd
$$dir; $(MAKE
) $(MFLAGS
) sloc
) || exit
1;\
308 # Make software distributions using EPM (http://www.msweet.org/)...
311 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
313 bsd deb epm pkg rpm slackware
:
314 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
319 $(MAKE
) $(MFLAGS
) epm
321 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
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...