]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
f2d18633 | 2 | # "$Id$" |
ef416fc2 | 3 | # |
5a1d7a17 | 4 | # Top-level Makefile for CUPS. |
ef416fc2 | 5 | # |
d95bd167 | 6 | # Copyright 2007-2014 by Apple Inc. |
5a1d7a17 | 7 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | # |
5a1d7a17 MS |
9 | # These coded instructions, statements, and computer programs are the |
10 | # property of Apple Inc. and are protected by Federal copyright | |
11 | # law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | # which should have been included with this file. If this file is | |
13 | # file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | # |
15 | ||
16 | include Makedefs | |
17 | ||
49d87452 | 18 | |
ef416fc2 | 19 | # |
20 | # Directories to make... | |
21 | # | |
22 | ||
a4845881 | 23 | DIRS = cups test $(BUILDDIRS) |
bd7854cb | 24 | |
ef416fc2 | 25 | |
26 | # | |
27 | # Make all targets... | |
28 | # | |
29 | ||
30 | all: | |
31 | chmod +x cups-config | |
c9fc04c6 | 32 | echo Using ARCHFLAGS="$(ARCHFLAGS)" |
ac884b6a MS |
33 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" |
34 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
5f64df29 MS |
35 | echo Using CC="$(CC)" |
36 | echo Using CXX="$(CC)" | |
c9fc04c6 | 37 | echo Using DSOFLAGS="$(DSOFLAGS)" |
ac884b6a MS |
38 | echo Using LDFLAGS="$(LDFLAGS)" |
39 | echo Using LIBS="$(LIBS)" | |
ef416fc2 | 40 | for dir in $(DIRS); do\ |
41 | echo Making all in $$dir... ;\ | |
1f6f3dbc | 42 | (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\ |
c9fc04c6 MS |
43 | done |
44 | ||
45 | ||
46 | # | |
47 | # Make library targets... | |
48 | # | |
49 | ||
50 | libs: | |
51 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
52 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
53 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
5f64df29 MS |
54 | echo Using CC="$(CC)" |
55 | echo Using CXX="$(CC)" | |
c9fc04c6 MS |
56 | echo Using DSOFLAGS="$(DSOFLAGS)" |
57 | echo Using LDFLAGS="$(LDFLAGS)" | |
58 | echo Using LIBS="$(LIBS)" | |
59 | for dir in $(DIRS); do\ | |
8922323b | 60 | echo Making libraries in $$dir... ;\ |
c9fc04c6 | 61 | (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\ |
ef416fc2 | 62 | done |
63 | ||
bd7854cb | 64 | |
5f64df29 MS |
65 | # |
66 | # Make unit test targets... | |
67 | # | |
68 | ||
69 | unittests: | |
70 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
71 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
72 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
73 | echo Using CC="$(CC)" | |
74 | echo Using CXX="$(CC)" | |
75 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
76 | echo Using LDFLAGS="$(LDFLAGS)" | |
77 | echo Using LIBS="$(LIBS)" | |
78 | for dir in $(DIRS); do\ | |
79 | echo Making all in $$dir... ;\ | |
80 | (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\ | |
81 | done | |
82 | ||
83 | ||
ef416fc2 | 84 | # |
85 | # Remove object and target files... | |
86 | # | |
87 | ||
88 | clean: | |
89 | for dir in $(DIRS); do\ | |
90 | echo Cleaning in $$dir... ;\ | |
91 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ | |
92 | done | |
93 | ||
bd7854cb | 94 | |
a9252913 | 95 | # |
96 | # Remove all non-distribution files... | |
97 | # | |
98 | ||
99 | distclean: clean | |
100 | $(RM) Makedefs config.h config.log config.status | |
d95bd167 | 101 | $(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf |
0a682745 | 102 | $(RM) cups-config |
d95bd167 MS |
103 | $(RM) data/testprint |
104 | $(RM) desktop/cups.desktop | |
105 | $(RM) doc/index.html | |
106 | $(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 | |
f7deaa1a | 107 | $(RM) packaging/cups.list |
352d5a7d | 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 |
db1f069b | 109 | $(RM) templates/header.tmpl |
a9252913 | 110 | -$(RM) doc/*/index.html |
a9252913 | 111 | -$(RM) templates/*/header.tmpl |
d95bd167 | 112 | -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale |
a9252913 | 113 | |
114 | ||
ef416fc2 | 115 | # |
116 | # Make dependencies | |
117 | # | |
118 | ||
119 | depend: | |
120 | for dir in $(DIRS); do\ | |
121 | echo Making dependencies in $$dir... ;\ | |
122 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
123 | done | |
124 | ||
125 | ||
1f0275e3 | 126 | # |
148d3699 MS |
127 | # Run the Clang static code analysis tool on the sources, available here: |
128 | # | |
129 | # http://clang-analyzer.llvm.org | |
130 | # | |
131 | # At least checker-231 is required. | |
1f0275e3 | 132 | # |
95ece0cb MS |
133 | # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text |
134 | # output instead of HTML...) | |
135 | # | |
1f0275e3 | 136 | |
f8b3a85b | 137 | .PHONY: clang clang-changes |
1f0275e3 | 138 | clang: |
c5571a1d | 139 | $(RM) -r clang |
41681883 | 140 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all |
f8b3a85b MS |
141 | clang-changes: |
142 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all | |
1f0275e3 MS |
143 | |
144 | ||
148d3699 MS |
145 | # |
146 | # Run the STACK tool on the sources, available here: | |
147 | # | |
148 | # http://css.csail.mit.edu/stack/ | |
149 | # | |
150 | # Do the following to pass options to configure: | |
151 | # | |
152 | # make CONFIGFLAGS="--foo --bar" stack | |
153 | # | |
154 | ||
155 | .PHONY: stack | |
156 | stack: | |
157 | stack-build ./configure $(CONFIGFLAGS) | |
158 | stack-build $(MAKE) $(MFLAGS) clean all | |
159 | poptck | |
160 | $(MAKE) $(MFLAGS) distclean | |
161 | $(RM) */*.ll | |
162 | $(RM) */*.ll.out | |
163 | ||
164 | ||
b94498cf | 165 | # |
166 | # Generate a ctags file... | |
167 | # | |
168 | ||
169 | ctags: | |
170 | ctags -R . | |
171 | ||
172 | ||
ef416fc2 | 173 | # |
50fe7201 | 174 | # Install everything... |
ef416fc2 | 175 | # |
176 | ||
50fe7201 MS |
177 | install: install-data install-headers install-libs install-exec |
178 | ||
179 | ||
180 | # | |
181 | # Install data files... | |
182 | # | |
183 | ||
184 | install-data: | |
229681c1 MS |
185 | echo Making all in cups... |
186 | (cd cups; $(MAKE) $(MFLAGS) all) | |
ef416fc2 | 187 | for dir in $(DIRS); do\ |
50fe7201 MS |
188 | echo Installing data files in $$dir... ;\ |
189 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
ef416fc2 | 190 | done |
ef416fc2 | 191 | echo Installing cups-config script... |
757d2cad | 192 | $(INSTALL_DIR) -m 755 $(BINDIR) |
ef416fc2 | 193 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config |
4d301e69 | 194 | |
ef416fc2 | 195 | |
50fe7201 MS |
196 | # |
197 | # Install header files... | |
198 | # | |
199 | ||
200 | install-headers: | |
201 | for dir in $(DIRS); do\ | |
202 | echo Installing header files in $$dir... ;\ | |
203 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
204 | done | |
71e16022 MS |
205 | if test "x$(privateinclude)" != x; then \ |
206 | echo Installing config.h into $(PRIVATEINCLUDE)...; \ | |
5180a04c MS |
207 | $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \ |
208 | $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \ | |
71e16022 | 209 | fi |
50fe7201 | 210 | |
ef416fc2 | 211 | |
212 | # | |
50fe7201 | 213 | # Install programs... |
ef416fc2 | 214 | # |
215 | ||
c9fc04c6 | 216 | install-exec: all |
50fe7201 MS |
217 | for dir in $(DIRS); do\ |
218 | echo Installing programs in $$dir... ;\ | |
c9fc04c6 | 219 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ |
50fe7201 | 220 | done |
ef416fc2 | 221 | |
50fe7201 MS |
222 | |
223 | # | |
224 | # Install libraries... | |
225 | # | |
226 | ||
c9fc04c6 | 227 | install-libs: libs |
50fe7201 MS |
228 | for dir in $(DIRS); do\ |
229 | echo Installing libraries in $$dir... ;\ | |
c9fc04c6 | 230 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ |
50fe7201 | 231 | done |
ef416fc2 | 232 | |
233 | ||
757d2cad | 234 | # |
235 | # Uninstall object and target files... | |
236 | # | |
237 | ||
238 | uninstall: | |
239 | for dir in $(DIRS); do\ | |
240 | echo Uninstalling in $$dir... ;\ | |
241 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
242 | done | |
243 | echo Uninstalling cups-config script... | |
244 | $(RM) $(BINDIR)/cups-config | |
245 | -$(RMDIR) $(BINDIR) | |
757d2cad | 246 | |
247 | ||
ef416fc2 | 248 | # |
249 | # Run the test suite... | |
250 | # | |
251 | ||
f11a948a | 252 | test: all unittests |
ef416fc2 | 253 | echo Running CUPS test suite... |
254 | cd test; ./run-stp-tests.sh | |
255 | ||
256 | ||
f11a948a | 257 | check: all unittests |
d09495fa | 258 | echo Running CUPS test suite with defaults... |
85dda01c MS |
259 | cd test; ./run-stp-tests.sh 1 0 n n |
260 | ||
261 | debugcheck: all unittests | |
262 | echo Running CUPS test suite with debug printfs... | |
263 | cd test; ./run-stp-tests.sh 1 0 n y | |
d09495fa | 264 | |
265 | ||
f11a948a | 266 | # |
9520743f | 267 | # Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)... |
f11a948a MS |
268 | # |
269 | ||
270 | apihelp: | |
a2326b5b | 271 | for dir in cgi-bin cups filter ppdc scheduler; do\ |
f11a948a MS |
272 | echo Generating API help in $$dir... ;\ |
273 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
274 | done | |
275 | ||
276 | framedhelp: | |
a2326b5b | 277 | for dir in cgi-bin cups filter ppdc scheduler; do\ |
f11a948a MS |
278 | echo Generating framed API help in $$dir... ;\ |
279 | (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\ | |
280 | done | |
281 | ||
178cb736 MS |
282 | |
283 | # | |
9520743f | 284 | # Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)... |
178cb736 MS |
285 | # |
286 | ||
f11a948a MS |
287 | docset: apihelp |
288 | echo Generating docset directory tree... | |
289 | $(RM) -r org.cups.docset | |
290 | mkdir -p org.cups.docset/Contents/Resources/Documentation/help | |
291 | mkdir -p org.cups.docset/Contents/Resources/Documentation/images | |
178cb736 | 292 | cd man; $(MAKE) $(MFLAGS) html |
f11a948a MS |
293 | cd doc; $(MAKE) $(MFLAGS) docset |
294 | cd cgi-bin; $(MAKE) $(MFLAGS) makedocset | |
295 | cgi-bin/makedocset org.cups.docset \ | |
296 | `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \ | |
297 | doc/help/api-*.tokens | |
298 | $(RM) doc/help/api-*.tokens | |
299 | echo Indexing docset... | |
a29fd7dd | 300 | /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset |
f11a948a | 301 | echo Generating docset archive and feed... |
85b5d1df | 302 | $(RM) org.cups.docset.atom |
a29fd7dd | 303 | /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \ |
f11a948a MS |
304 | --atom org.cups.docset.atom \ |
305 | --download-url http://www.cups.org/org.cups.docset.xar \ | |
306 | org.cups.docset | |
307 | ||
308 | ||
84315f46 MS |
309 | # |
310 | # Lines of code computation... | |
311 | # | |
312 | ||
313 | sloc: | |
a4845881 | 314 | for dir in cups scheduler; do \ |
84315f46 MS |
315 | (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\ |
316 | done | |
317 | ||
318 | ||
ef416fc2 | 319 | # |
9520743f | 320 | # Make software distributions using EPM (http://www.msweet.org/)... |
ef416fc2 | 321 | # |
322 | ||
d09495fa | 323 | EPMFLAGS = -v --output-dir dist $(EPMARCH) |
ef416fc2 | 324 | |
9aed20a5 | 325 | bsd deb pkg slackware: |
4744bd90 | 326 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list |
ef416fc2 | 327 | |
328 | epm: | |
d09495fa | 329 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list |
330 | ||
b86bc4cf | 331 | rpm: |
332 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
333 | ||
d09495fa | 334 | .PHONEY: dist |
335 | dist: all | |
336 | $(RM) -r dist | |
337 | $(MAKE) $(MFLAGS) epm | |
338 | case `uname` in \ | |
339 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
340 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
97c9a8d7 | 341 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ |
d09495fa | 342 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ |
343 | esac | |
ef416fc2 | 344 | |
bd7854cb | 345 | |
ef416fc2 | 346 | # |
31db8ded MS |
347 | # Don't run top-level build targets in parallel... |
348 | # | |
349 | ||
350 | .NOTPARALLEL: | |
351 | ||
352 | ||
353 | # | |
f2d18633 | 354 | # End of "$Id$". |
ef416fc2 | 355 | # |