]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Update test suite for new location of test files.
[thirdparty/cups.git] / Makefile
1 #
2 # Top-level Makefile for CUPS.
3 #
4 # Copyright © 2007-2019 by Apple Inc.
5 # Copyright © 1997-2007 by Easy Software Products, all rights reserved.
6 #
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
8 # information.
9 #
10
11 include Makedefs
12
13
14 #
15 # Directories to make...
16 #
17
18 DIRS = cups $(BUILDDIRS)
19
20
21 #
22 # Test suite options - normally blank, override with make command...
23 #
24
25 TESTOPTIONS =
26
27
28 #
29 # Make all targets...
30 #
31
32 all:
33 chmod +x cups-config
34 echo Using ARCHFLAGS="$(ARCHFLAGS)"
35 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
36 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
37 echo Using CC="$(CC)"
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;\
45 done
46
47
48 #
49 # Make library targets...
50 #
51
52 libs:
53 echo Using ARCHFLAGS="$(ARCHFLAGS)"
54 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
55 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
56 echo Using CC="$(CC)"
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;\
64 done
65
66
67 #
68 # Make unit test targets...
69 #
70
71 unittests:
72 echo Using ARCHFLAGS="$(ARCHFLAGS)"
73 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
74 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
75 echo Using CC="$(CC)"
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;\
83 done
84
85
86 #
87 # Remove object and target files...
88 #
89
90 clean:
91 for dir in $(DIRS); do\
92 echo Cleaning in $$dir... ;\
93 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
94 done
95
96
97 #
98 # Remove all non-distribution files...
99 #
100
101 distclean: clean
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
104 $(RM) cups-config
105 $(RM) data/testprint
106 $(RM) desktop/cups.desktop
107 $(RM) doc/index.html
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
115
116
117 #
118 # Make dependencies
119 #
120
121 depend:
122 for dir in $(DIRS); do\
123 echo Making dependencies in $$dir... ;\
124 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
125 done
126
127
128 #
129 # Run the Clang static code analysis tool on the sources, available here:
130 #
131 # http://clang-analyzer.llvm.org
132 #
133 # At least checker-231 is required.
134 #
135 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
136 # output instead of HTML...)
137 #
138
139 .PHONY: clang clang-changes
140 clang:
141 $(RM) -r clang
142 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
143 clang-changes:
144 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
145
146
147 #
148 # Run the STACK tool on the sources, available here:
149 #
150 # http://css.csail.mit.edu/stack/
151 #
152 # Do the following to pass options to configure:
153 #
154 # make CONFIGFLAGS="--foo --bar" stack
155 #
156
157 .PHONY: stack
158 stack:
159 stack-build ./configure $(CONFIGFLAGS)
160 stack-build $(MAKE) $(MFLAGS) clean all
161 poptck
162 $(MAKE) $(MFLAGS) distclean
163 $(RM) */*.ll
164 $(RM) */*.ll.out
165
166
167 #
168 # Generate a ctags file...
169 #
170
171 ctags:
172 ctags -R .
173
174
175 #
176 # Install everything...
177 #
178
179 install: install-data install-headers install-libs install-exec
180
181
182 #
183 # Install data files...
184 #
185
186 install-data:
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;\
192 done
193 echo Installing cups-config script...
194 $(INSTALL_DIR) -m 755 $(BINDIR)
195 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
196
197
198 #
199 # Install header files...
200 #
201
202 install-headers:
203 for dir in $(DIRS); do\
204 echo Installing header files in $$dir... ;\
205 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
206 done
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; \
211 fi
212
213
214 #
215 # Install programs...
216 #
217
218 install-exec: all
219 for dir in $(DIRS); do\
220 echo Installing programs in $$dir... ;\
221 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
222 done
223
224
225 #
226 # Install libraries...
227 #
228
229 install-libs: libs
230 for dir in $(DIRS); do\
231 echo Installing libraries in $$dir... ;\
232 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
233 done
234
235
236 #
237 # Uninstall object and target files...
238 #
239
240 uninstall:
241 for dir in $(DIRS); do\
242 echo Uninstalling in $$dir... ;\
243 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
244 done
245 echo Uninstalling cups-config script...
246 $(RM) $(BINDIR)/cups-config
247 -$(RMDIR) $(BINDIR)
248
249
250 #
251 # Run the test suite...
252 #
253
254 test: all unittests
255 echo Running CUPS test suite...
256 cd test; ./run-stp-tests.sh $(TESTOPTIONS)
257
258
259 check: all unittests
260 echo Running CUPS test suite with defaults...
261 cd test; ./run-stp-tests.sh 1 0 n n
262
263 debugcheck: all unittests
264 echo Running CUPS test suite with debug printfs...
265 cd test; ./run-stp-tests.sh 1 0 n y
266
267
268 #
269 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
270 #
271
272 apihelp:
273 for dir in cups filter; do\
274 echo Generating API help in $$dir... ;\
275 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
276 done
277
278
279 #
280 # Lines of code computation...
281 #
282
283 sloc:
284 for dir in cups scheduler; do \
285 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
286 done
287
288
289 #
290 # Make software distributions using EPM (http://www.msweet.org/)...
291 #
292
293 EPMFLAGS = -v --output-dir dist $(EPMARCH)
294
295 bsd deb epm pkg rpm slackware:
296 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
297
298 .PHONY: dist
299 dist: all
300 $(RM) -r dist
301 $(MAKE) $(MFLAGS) epm
302 case `uname` in \
303 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
304 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
305 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
306 esac
307
308
309 #
310 # Don't run top-level build targets in parallel...
311 #
312
313 .NOTPARALLEL: