2 # Top-level Makefile for CUPS.
4 # Copyright © 2007-2019 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
15 # Directories to make...
18 DIRS
= cups
$(BUILDDIRS
)
22 # Test suite options - normally blank, override with make command...
34 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
35 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
36 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
38 echo Using CXX
="$(CC)"
39 echo Using DSOFLAGS
="$(DSOFLAGS)"
40 echo Using LDFLAGS
="$(LDFLAGS)"
41 echo Using LIBS
="$(LIBS)"
42 for
dir in
$(DIRS
); do\
43 echo Making
all in
$$dir...
;\
44 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all $(UNITTESTS
)) || exit
1;\
49 # Make library targets...
53 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
54 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
55 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
57 echo Using CXX
="$(CC)"
58 echo Using DSOFLAGS
="$(DSOFLAGS)"
59 echo Using LDFLAGS
="$(LDFLAGS)"
60 echo Using LIBS
="$(LIBS)"
61 for
dir in
$(DIRS
); do\
62 echo Making libraries in
$$dir...
;\
63 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
68 # Make unit test targets...
72 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
73 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
74 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
76 echo Using CXX
="$(CC)"
77 echo Using DSOFLAGS
="$(DSOFLAGS)"
78 echo Using LDFLAGS
="$(LDFLAGS)"
79 echo Using LIBS
="$(LIBS)"
80 for
dir in
$(DIRS
); do\
81 echo Making
all in
$$dir...
;\
82 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
87 # Remove object and target files...
91 for
dir in
$(DIRS
); do\
92 echo Cleaning in
$$dir...
;\
93 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
98 # Remove all non-distribution files...
102 $(RM
) Makedefs config.h config.log config.status
103 $(RM
) conf
/cups-files.conf conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
106 $(RM
) desktop
/cups.desktop
108 $(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
109 $(RM
) packaging
/cups.list
110 $(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
111 $(RM
) templates
/header.tmpl
112 -$(RM
) doc
/*/index.html
113 -$(RM
) templates
/*/header.tmpl
114 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale
122 for
dir in
$(DIRS
); do\
123 echo Making dependencies in
$$dir...
;\
124 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
129 # Run the Clang static code analysis tool on the sources, available here:
131 # http://clang-analyzer.llvm.org
133 # At least checker-231 is required.
135 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
136 # output instead of HTML...)
139 .PHONY
: clang clang-changes
142 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) clean all
144 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) all
148 # Run the STACK tool on the sources, available here:
150 # http://css.csail.mit.edu/stack/
152 # Do the following to pass options to configure:
154 # make CONFIGFLAGS="--foo --bar" stack
159 stack-build .
/configure
$(CONFIGFLAGS
)
160 stack-build
$(MAKE
) $(MFLAGS
) clean all
162 $(MAKE
) $(MFLAGS
) distclean
168 # Generate a ctags file...
176 # Install everything...
179 install: install-data install-headers install-libs install-exec
183 # Install data files...
187 echo Making
all in cups...
188 (cd cups
; $(MAKE
) $(MFLAGS
) all)
189 for
dir in
$(DIRS
); do\
190 echo Installing data files in
$$dir...
;\
191 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
193 echo Installing cups-config script...
194 $(INSTALL_DIR
) -m
755 $(BINDIR
)
195 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
199 # Install header files...
203 for
dir in
$(DIRS
); do\
204 echo Installing header files in
$$dir...
;\
205 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
207 if
test "x$(privateinclude)" != x
; then \
208 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
209 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
210 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
215 # Install programs...
219 for
dir in
$(DIRS
); do\
220 echo Installing programs in
$$dir...
;\
221 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
226 # Install libraries...
230 for
dir in
$(DIRS
); do\
231 echo Installing libraries in
$$dir...
;\
232 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
237 # Uninstall object and target files...
241 for
dir in
$(DIRS
); do\
242 echo Uninstalling in
$$dir...
;\
243 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
245 echo Uninstalling cups-config script...
246 $(RM
) $(BINDIR
)/cups-config
251 # Run the test suite...
255 echo Running CUPS
test suite...
256 cd
test; .
/run-stp-tests.sh
$(TESTOPTIONS
)
260 echo Running CUPS
test suite with defaults...
261 cd
test; .
/run-stp-tests.sh
1 0 n n
263 debugcheck
: all unittests
264 echo Running CUPS
test suite with debug printfs...
265 cd
test; .
/run-stp-tests.sh
1 0 n y
269 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
273 for
dir in cups
filter; do\
274 echo Generating API help in
$$dir...
;\
275 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
280 # Lines of code computation...
284 for
dir in cups scheduler
; do \
285 (cd
$$dir; $(MAKE
) $(MFLAGS
) sloc
) || exit
1;\
290 # Make software distributions using EPM (http://www.msweet.org/)...
293 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
295 bsd deb epm pkg rpm slackware
:
296 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
301 $(MAKE
) $(MFLAGS
) epm
303 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
304 Linux
*) test ! -x
/usr
/bin
/rpm ||
$(MAKE
) $(MFLAGS
) rpm
;; \
305 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
310 # Don't run top-level build targets in parallel...