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
)
27 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
28 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
29 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
31 echo Using CXX
="$(CC)"
32 echo Using DSOFLAGS
="$(DSOFLAGS)"
33 echo Using LDFLAGS
="$(LDFLAGS)"
34 echo Using LIBS
="$(LIBS)"
35 for
dir in
$(DIRS
); do\
36 echo Making
all in
$$dir...
;\
37 (cd
$$dir ; $(MAKE
) $(MFLAGS
) all $(UNITTESTS
)) || exit
1;\
42 # Make library targets...
46 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
47 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
48 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
50 echo Using CXX
="$(CC)"
51 echo Using DSOFLAGS
="$(DSOFLAGS)"
52 echo Using LDFLAGS
="$(LDFLAGS)"
53 echo Using LIBS
="$(LIBS)"
54 for
dir in
$(DIRS
); do\
55 echo Making libraries in
$$dir...
;\
56 (cd
$$dir ; $(MAKE
) $(MFLAGS
) libs
) || exit
1;\
61 # Make unit test targets...
65 echo Using ARCHFLAGS
="$(ARCHFLAGS)"
66 echo Using ALL_CFLAGS
="$(ALL_CFLAGS)"
67 echo Using ALL_CXXFLAGS
="$(ALL_CXXFLAGS)"
69 echo Using CXX
="$(CC)"
70 echo Using DSOFLAGS
="$(DSOFLAGS)"
71 echo Using LDFLAGS
="$(LDFLAGS)"
72 echo Using LIBS
="$(LIBS)"
73 for
dir in
$(DIRS
); do\
74 echo Making
all in
$$dir...
;\
75 (cd
$$dir ; $(MAKE
) $(MFLAGS
) unittests
) || exit
1;\
80 # Remove object and target files...
84 for
dir in
$(DIRS
); do\
85 echo Cleaning in
$$dir...
;\
86 (cd
$$dir; $(MAKE
) $(MFLAGS
) clean) || exit
1;\
91 # Remove all non-distribution files...
95 $(RM
) Makedefs config.h config.log config.status
96 $(RM
) conf
/cups-files.conf conf
/cupsd.conf conf
/mime.convs conf
/pam.std conf
/snmp.conf
99 $(RM
) desktop
/cups.desktop
101 $(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
102 $(RM
) packaging
/cups.list
103 $(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
104 $(RM
) templates
/header.tmpl
105 -$(RM
) doc
/*/index.html
106 -$(RM
) templates
/*/header.tmpl
107 -$(RM
) -r autom4te
*.cache clang cups
/charmaps cups
/locale
115 for
dir in
$(DIRS
); do\
116 echo Making dependencies in
$$dir...
;\
117 (cd
$$dir; $(MAKE
) $(MFLAGS
) depend
) || exit
1;\
122 # Run the Clang static code analysis tool on the sources, available here:
124 # http://clang-analyzer.llvm.org
126 # At least checker-231 is required.
128 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
129 # output instead of HTML...)
132 .PHONY
: clang clang-changes
135 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) clean all
137 scan-build
-V
-k
-o
`pwd`/clang
$(MAKE
) $(MFLAGS
) all
141 # Run the STACK tool on the sources, available here:
143 # http://css.csail.mit.edu/stack/
145 # Do the following to pass options to configure:
147 # make CONFIGFLAGS="--foo --bar" stack
152 stack-build .
/configure
$(CONFIGFLAGS
)
153 stack-build
$(MAKE
) $(MFLAGS
) clean all
155 $(MAKE
) $(MFLAGS
) distclean
161 # Generate a ctags file...
169 # Install everything...
172 install: install-data install-headers install-libs install-exec
176 # Install data files...
180 echo Making
all in cups...
181 (cd cups
; $(MAKE
) $(MFLAGS
) all)
182 for
dir in
$(DIRS
); do\
183 echo Installing data files in
$$dir...
;\
184 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-data
) || exit
1;\
186 echo Installing cups-config script...
187 $(INSTALL_DIR
) -m
755 $(BINDIR
)
188 $(INSTALL_SCRIPT
) cups-config
$(BINDIR
)/cups-config
192 # Install header files...
196 for
dir in
$(DIRS
); do\
197 echo Installing header files in
$$dir...
;\
198 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-headers
) || exit
1;\
200 if
test "x$(privateinclude)" != x
; then \
201 echo Installing config.h into
$(PRIVATEINCLUDE
)...
; \
202 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
203 $(INSTALL_DATA
) config.h
$(PRIVATEINCLUDE
)/config.h
; \
208 # Install programs...
212 for
dir in
$(DIRS
); do\
213 echo Installing programs in
$$dir...
;\
214 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-exec
) || exit
1;\
219 # Install libraries...
223 for
dir in
$(DIRS
); do\
224 echo Installing libraries in
$$dir...
;\
225 (cd
$$dir; $(MAKE
) $(MFLAGS
) install-libs
) || exit
1;\
230 # Uninstall object and target files...
234 for
dir in
$(DIRS
); do\
235 echo Uninstalling in
$$dir...
;\
236 (cd
$$dir; $(MAKE
) $(MFLAGS
) uninstall) || exit
1;\
238 echo Uninstalling cups-config script...
239 $(RM
) $(BINDIR
)/cups-config
244 # Run the test suite...
248 echo Running CUPS
test suite...
249 cd
test; .
/run-stp-tests.sh
253 echo Running CUPS
test suite with defaults...
254 cd
test; .
/run-stp-tests.sh
1 0 n n
256 debugcheck
: all unittests
257 echo Running CUPS
test suite with debug printfs...
258 cd
test; .
/run-stp-tests.sh
1 0 n y
262 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
266 for
dir in cups
filter; do\
267 echo Generating API help in
$$dir...
;\
268 (cd
$$dir; $(MAKE
) $(MFLAGS
) apihelp
) || exit
1;\
273 # Lines of code computation...
277 for
dir in cups scheduler
; do \
278 (cd
$$dir; $(MAKE
) $(MFLAGS
) sloc
) || exit
1;\
283 # Make software distributions using EPM (http://www.msweet.org/)...
286 EPMFLAGS
= -v
--output-dir
dist $(EPMARCH
)
288 bsd deb epm pkg rpm slackware
:
289 epm
$(EPMFLAGS
) -f
$@ cups packaging
/cups.list
294 $(MAKE
) $(MFLAGS
) epm
296 *BSD
*) $(MAKE
) $(MFLAGS
) bsd
;; \
297 Linux
*) test ! -x
/usr
/bin
/rpm ||
$(MAKE
) $(MFLAGS
) rpm
;; \
298 SunOS
*) $(MAKE
) $(MFLAGS
) pkg
;; \
303 # Don't run top-level build targets in parallel...