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