]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Top-level Makefile for CUPS. | |
3 | # | |
4 | # Copyright © 2007-2018 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 | # Make all targets... | |
23 | # | |
24 | ||
25 | all: | |
26 | chmod +x cups-config | |
27 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
28 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
29 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
30 | echo Using CC="$(CC)" | |
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;\ | |
38 | done | |
39 | ||
40 | ||
41 | # | |
42 | # Make library targets... | |
43 | # | |
44 | ||
45 | libs: | |
46 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
47 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
48 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
49 | echo Using CC="$(CC)" | |
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;\ | |
57 | done | |
58 | ||
59 | ||
60 | # | |
61 | # Make unit test targets... | |
62 | # | |
63 | ||
64 | unittests: | |
65 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
66 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
67 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
68 | echo Using CC="$(CC)" | |
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;\ | |
76 | done | |
77 | ||
78 | ||
79 | # | |
80 | # Remove object and target files... | |
81 | # | |
82 | ||
83 | clean: | |
84 | for dir in $(DIRS); do\ | |
85 | echo Cleaning in $$dir... ;\ | |
86 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ | |
87 | done | |
88 | ||
89 | ||
90 | # | |
91 | # Remove all non-distribution files... | |
92 | # | |
93 | ||
94 | distclean: clean | |
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 | |
97 | $(RM) cups-config | |
98 | $(RM) data/testprint | |
99 | $(RM) desktop/cups.desktop | |
100 | $(RM) doc/index.html | |
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 | |
108 | ||
109 | ||
110 | # | |
111 | # Make dependencies | |
112 | # | |
113 | ||
114 | depend: | |
115 | for dir in $(DIRS); do\ | |
116 | echo Making dependencies in $$dir... ;\ | |
117 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
118 | done | |
119 | ||
120 | ||
121 | # | |
122 | # Run the Clang static code analysis tool on the sources, available here: | |
123 | # | |
124 | # http://clang-analyzer.llvm.org | |
125 | # | |
126 | # At least checker-231 is required. | |
127 | # | |
128 | # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text | |
129 | # output instead of HTML...) | |
130 | # | |
131 | ||
132 | .PHONY: clang clang-changes | |
133 | clang: | |
134 | $(RM) -r clang | |
135 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all | |
136 | clang-changes: | |
137 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all | |
138 | ||
139 | ||
140 | # | |
141 | # Run the STACK tool on the sources, available here: | |
142 | # | |
143 | # http://css.csail.mit.edu/stack/ | |
144 | # | |
145 | # Do the following to pass options to configure: | |
146 | # | |
147 | # make CONFIGFLAGS="--foo --bar" stack | |
148 | # | |
149 | ||
150 | .PHONY: stack | |
151 | stack: | |
152 | stack-build ./configure $(CONFIGFLAGS) | |
153 | stack-build $(MAKE) $(MFLAGS) clean all | |
154 | poptck | |
155 | $(MAKE) $(MFLAGS) distclean | |
156 | $(RM) */*.ll | |
157 | $(RM) */*.ll.out | |
158 | ||
159 | ||
160 | # | |
161 | # Generate a ctags file... | |
162 | # | |
163 | ||
164 | ctags: | |
165 | ctags -R . | |
166 | ||
167 | ||
168 | # | |
169 | # Install everything... | |
170 | # | |
171 | ||
172 | install: install-data install-headers install-libs install-exec | |
173 | ||
174 | ||
175 | # | |
176 | # Install data files... | |
177 | # | |
178 | ||
179 | install-data: | |
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;\ | |
185 | done | |
186 | echo Installing cups-config script... | |
187 | $(INSTALL_DIR) -m 755 $(BINDIR) | |
188 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config | |
189 | ||
190 | ||
191 | # | |
192 | # Install header files... | |
193 | # | |
194 | ||
195 | install-headers: | |
196 | for dir in $(DIRS); do\ | |
197 | echo Installing header files in $$dir... ;\ | |
198 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
199 | done | |
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; \ | |
204 | fi | |
205 | ||
206 | ||
207 | # | |
208 | # Install programs... | |
209 | # | |
210 | ||
211 | install-exec: all | |
212 | for dir in $(DIRS); do\ | |
213 | echo Installing programs in $$dir... ;\ | |
214 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ | |
215 | done | |
216 | ||
217 | ||
218 | # | |
219 | # Install libraries... | |
220 | # | |
221 | ||
222 | install-libs: libs | |
223 | for dir in $(DIRS); do\ | |
224 | echo Installing libraries in $$dir... ;\ | |
225 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ | |
226 | done | |
227 | ||
228 | ||
229 | # | |
230 | # Uninstall object and target files... | |
231 | # | |
232 | ||
233 | uninstall: | |
234 | for dir in $(DIRS); do\ | |
235 | echo Uninstalling in $$dir... ;\ | |
236 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
237 | done | |
238 | echo Uninstalling cups-config script... | |
239 | $(RM) $(BINDIR)/cups-config | |
240 | -$(RMDIR) $(BINDIR) | |
241 | ||
242 | ||
243 | # | |
244 | # Run the test suite... | |
245 | # | |
246 | ||
247 | test: all unittests | |
248 | echo Running CUPS test suite... | |
249 | cd test; ./run-stp-tests.sh | |
250 | ||
251 | ||
252 | check: all unittests | |
253 | echo Running CUPS test suite with defaults... | |
254 | cd test; ./run-stp-tests.sh 1 0 n n | |
255 | ||
256 | debugcheck: all unittests | |
257 | echo Running CUPS test suite with debug printfs... | |
258 | cd test; ./run-stp-tests.sh 1 0 n y | |
259 | ||
260 | ||
261 | # | |
262 | # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)... | |
263 | # | |
264 | ||
265 | apihelp: | |
266 | for dir in cups filter; do\ | |
267 | echo Generating API help in $$dir... ;\ | |
268 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
269 | done | |
270 | ||
271 | ||
272 | # | |
273 | # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)... | |
274 | # | |
275 | ||
276 | docset: apihelp | |
277 | echo Generating docset directory tree... | |
278 | $(RM) -r org.cups.docset | |
279 | mkdir -p org.cups.docset/Contents/Resources/Documentation/help | |
280 | mkdir -p org.cups.docset/Contents/Resources/Documentation/images | |
281 | cd man; $(MAKE) $(MFLAGS) html | |
282 | cd doc; $(MAKE) $(MFLAGS) docset | |
283 | cd cgi-bin; $(MAKE) $(MFLAGS) makedocset | |
284 | cgi-bin/makedocset org.cups.docset \ | |
285 | `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \ | |
286 | doc/help/api-*.tokens | |
287 | $(RM) doc/help/api-*.tokens | |
288 | echo Indexing docset... | |
289 | /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset | |
290 | echo Generating docset archive and feed... | |
291 | $(RM) org.cups.docset.atom | |
292 | /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \ | |
293 | --atom org.cups.docset.atom \ | |
294 | --download-url http://www.cups.org/org.cups.docset.xar \ | |
295 | org.cups.docset | |
296 | ||
297 | ||
298 | # | |
299 | # Lines of code computation... | |
300 | # | |
301 | ||
302 | sloc: | |
303 | for dir in cups scheduler; do \ | |
304 | (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\ | |
305 | done | |
306 | ||
307 | ||
308 | # | |
309 | # Make software distributions using EPM (http://www.msweet.org/)... | |
310 | # | |
311 | ||
312 | EPMFLAGS = -v --output-dir dist $(EPMARCH) | |
313 | ||
314 | bsd deb epm pkg rpm slackware: | |
315 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list | |
316 | ||
317 | .PHONY: dist | |
318 | dist: all | |
319 | $(RM) -r dist | |
320 | $(MAKE) $(MFLAGS) epm | |
321 | case `uname` in \ | |
322 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
323 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ | |
324 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
325 | esac | |
326 | ||
327 | ||
328 | # | |
329 | # Don't run top-level build targets in parallel... | |
330 | # | |
331 | ||
332 | .NOTPARALLEL: |