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
105 $(RM) desktop/cups.desktop
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 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 STACK tool on the sources, available here:
129 # http://css.csail.mit.edu/stack/
131 # Do the following to pass options to configure:
133 # make CONFIGFLAGS="--foo --bar" stack
138 stack-build ./configure $(CONFIGFLAGS)
139 stack-build $(MAKE) $(MFLAGS) clean all
141 $(MAKE) $(MFLAGS) distclean
147 # Generate a ctags file...
155 # Install everything...
158 install: install-data install-headers install-libs install-exec
162 # Install data files...
166 echo Making all in cups...
167 (cd cups; $(MAKE) $(MFLAGS) all)
168 for dir in $(DIRS); do\
169 echo Installing data files in $$dir... ;\
170 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
172 echo Installing cups-config script...
173 $(INSTALL_DIR) -m 755 $(BINDIR)
174 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
178 # Install header files...
182 for dir in $(DIRS); do\
183 echo Installing header files in $$dir... ;\
184 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
186 if test "x$(privateinclude)" != x; then \
187 echo Installing config.h into $(PRIVATEINCLUDE)...; \
188 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
189 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
194 # Install programs...
198 for dir in $(DIRS); do\
199 echo Installing programs in $$dir... ;\
200 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
205 # Install libraries...
209 for dir in $(DIRS); do\
210 echo Installing libraries in $$dir... ;\
211 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
216 # Uninstall object and target files...
220 for dir in $(DIRS); do\
221 echo Uninstalling in $$dir... ;\
222 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
224 echo Uninstalling cups-config script...
225 $(RM) $(BINDIR)/cups-config
230 # Run the test suite...
234 echo Running CUPS test suite...
235 cd test; ./run-stp-tests.sh $(TESTOPTIONS)
239 echo Running CUPS test suite with defaults...
240 cd test; ./run-stp-tests.sh 1 0 n n
242 debugcheck: all unittests
243 echo Running CUPS test suite with debug printfs...
244 cd test; ./run-stp-tests.sh 1 0 n y
248 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
252 for dir in cups filter; do\
253 echo Generating API help in $$dir... ;\
254 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
259 # Lines of code computation...
263 for dir in cups scheduler; do \
264 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
269 # Make software distributions using EPM (http://www.msweet.org/)...
272 EPMFLAGS = -v --output-dir dist $(EPMARCH)
274 bsd deb epm pkg rpm slackware:
275 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
280 $(MAKE) $(MFLAGS) epm
282 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
283 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
284 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
289 # Don't run top-level build targets in parallel...