]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $" | |
3 | # | |
4 | # Top-level Makefile for CUPS. | |
5 | # | |
6 | # Copyright 2007-2010 by Apple Inc. | |
7 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. | |
8 | # | |
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/". | |
14 | # | |
15 | ||
16 | include Makedefs | |
17 | ||
18 | ||
19 | # | |
20 | # Don't run top-level build targets in parallel... | |
21 | # | |
22 | ||
23 | .NOTPARALLEL: | |
24 | ||
25 | ||
26 | # | |
27 | # Directories to make... | |
28 | # | |
29 | ||
30 | DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \ | |
31 | notifier ppdc scheduler systemv test \ | |
32 | $(PHPDIR) \ | |
33 | conf data desktop doc examples $(FONTS) templates | |
34 | ||
35 | ||
36 | # | |
37 | # Make all targets... | |
38 | # | |
39 | ||
40 | all: | |
41 | chmod +x cups-config | |
42 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
43 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
44 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
45 | echo Using CC="$(CC)" | |
46 | echo Using CXX="$(CC)" | |
47 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
48 | echo Using LDFLAGS="$(LDFLAGS)" | |
49 | echo Using LIBS="$(LIBS)" | |
50 | for dir in $(DIRS); do\ | |
51 | echo Making all in $$dir... ;\ | |
52 | (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\ | |
53 | done | |
54 | ||
55 | ||
56 | # | |
57 | # Make library targets... | |
58 | # | |
59 | ||
60 | libs: | |
61 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
62 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
63 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
64 | echo Using CC="$(CC)" | |
65 | echo Using CXX="$(CC)" | |
66 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
67 | echo Using LDFLAGS="$(LDFLAGS)" | |
68 | echo Using LIBS="$(LIBS)" | |
69 | for dir in $(DIRS); do\ | |
70 | echo Making libraries in $$dir... ;\ | |
71 | (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\ | |
72 | done | |
73 | ||
74 | ||
75 | # | |
76 | # Make unit test targets... | |
77 | # | |
78 | ||
79 | unittests: | |
80 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
81 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
82 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
83 | echo Using CC="$(CC)" | |
84 | echo Using CXX="$(CC)" | |
85 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
86 | echo Using LDFLAGS="$(LDFLAGS)" | |
87 | echo Using LIBS="$(LIBS)" | |
88 | for dir in $(DIRS); do\ | |
89 | echo Making all in $$dir... ;\ | |
90 | (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\ | |
91 | done | |
92 | ||
93 | ||
94 | # | |
95 | # Remove object and target files... | |
96 | # | |
97 | ||
98 | clean: | |
99 | for dir in $(DIRS); do\ | |
100 | echo Cleaning in $$dir... ;\ | |
101 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ | |
102 | done | |
103 | ||
104 | ||
105 | # | |
106 | # Remove all non-distribution files... | |
107 | # | |
108 | ||
109 | distclean: clean | |
110 | $(RM) Makedefs config.h config.log config.status | |
111 | $(RM) cups-config | |
112 | $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf | |
113 | $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html | |
114 | $(RM) man/client.conf.man | |
115 | $(RM) man/cups-deviced.man man/cups-driverd.man | |
116 | $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man | |
117 | $(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man | |
118 | $(RM) packaging/cups.list | |
119 | $(RM) packaging/cups-desc.plist packaging/cups-info.plist | |
120 | $(RM) templates/header.tmpl | |
121 | $(RM) desktop/cups.desktop | |
122 | $(RM) scheduler/cups.sh scheduler/cups-lpd | |
123 | $(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml | |
124 | -$(RM) doc/*/index.html | |
125 | -$(RM) templates/*/header.tmpl | |
126 | -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test | |
127 | ||
128 | ||
129 | # | |
130 | # Make dependencies | |
131 | # | |
132 | ||
133 | depend: | |
134 | for dir in $(DIRS); do\ | |
135 | echo Making dependencies in $$dir... ;\ | |
136 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
137 | done | |
138 | ||
139 | ||
140 | # | |
141 | # Run the clang.llvm.org static code analysis tool on the C sources. | |
142 | # (at least checker-231 is required for scan-build to work this way) | |
143 | # | |
144 | ||
145 | .PHONY: clang clang-changes | |
146 | clang: | |
147 | $(RM) -r clang | |
148 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all | |
149 | clang-changes: | |
150 | scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all | |
151 | ||
152 | ||
153 | # | |
154 | # Generate a ctags file... | |
155 | # | |
156 | ||
157 | ctags: | |
158 | ctags -R . | |
159 | ||
160 | ||
161 | # | |
162 | # Install everything... | |
163 | # | |
164 | ||
165 | install: install-data install-headers install-libs install-exec | |
166 | ||
167 | ||
168 | # | |
169 | # Install data files... | |
170 | # | |
171 | ||
172 | install-data: | |
173 | for dir in $(DIRS); do\ | |
174 | echo Installing data files in $$dir... ;\ | |
175 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
176 | done | |
177 | echo Installing cups-config script... | |
178 | $(INSTALL_DIR) -m 755 $(BINDIR) | |
179 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config | |
180 | ||
181 | ||
182 | # | |
183 | # Install header files... | |
184 | # | |
185 | ||
186 | install-headers: | |
187 | for dir in $(DIRS); do\ | |
188 | echo Installing header files in $$dir... ;\ | |
189 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
190 | done | |
191 | ||
192 | ||
193 | # | |
194 | # Install programs... | |
195 | # | |
196 | ||
197 | install-exec: all | |
198 | for dir in $(DIRS); do\ | |
199 | echo Installing programs in $$dir... ;\ | |
200 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ | |
201 | done | |
202 | ||
203 | ||
204 | # | |
205 | # Install libraries... | |
206 | # | |
207 | ||
208 | install-libs: libs | |
209 | for dir in $(DIRS); do\ | |
210 | echo Installing libraries in $$dir... ;\ | |
211 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ | |
212 | done | |
213 | ||
214 | ||
215 | # | |
216 | # Uninstall object and target files... | |
217 | # | |
218 | ||
219 | uninstall: | |
220 | for dir in $(DIRS); do\ | |
221 | echo Uninstalling in $$dir... ;\ | |
222 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
223 | done | |
224 | echo Uninstalling cups-config script... | |
225 | $(RM) $(BINDIR)/cups-config | |
226 | -$(RMDIR) $(BINDIR) | |
227 | ||
228 | ||
229 | # | |
230 | # Run the test suite... | |
231 | # | |
232 | ||
233 | test: all unittests | |
234 | echo Running CUPS test suite... | |
235 | cd test; ./run-stp-tests.sh | |
236 | ||
237 | ||
238 | check: all unittests | |
239 | echo Running CUPS test suite with defaults... | |
240 | cd test; ./run-stp-tests.sh 1 0 n | |
241 | ||
242 | ||
243 | # | |
244 | # Create HTML documentation... | |
245 | # | |
246 | ||
247 | apihelp: | |
248 | for dir in cgi-bin cups filter driver ppdc scheduler; do\ | |
249 | echo Generating API help in $$dir... ;\ | |
250 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
251 | done | |
252 | ||
253 | framedhelp: | |
254 | for dir in cgi-bin cups filter driver ppdc scheduler; do\ | |
255 | echo Generating framed API help in $$dir... ;\ | |
256 | (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\ | |
257 | done | |
258 | ||
259 | ||
260 | # | |
261 | # Create an Xcode docset... | |
262 | # | |
263 | ||
264 | docset: apihelp | |
265 | echo Generating docset directory tree... | |
266 | $(RM) -r org.cups.docset | |
267 | mkdir -p org.cups.docset/Contents/Resources/Documentation/help | |
268 | mkdir -p org.cups.docset/Contents/Resources/Documentation/images | |
269 | cd man; $(MAKE) $(MFLAGS) html | |
270 | cd doc; $(MAKE) $(MFLAGS) docset | |
271 | cd cgi-bin; $(MAKE) $(MFLAGS) makedocset | |
272 | cgi-bin/makedocset org.cups.docset \ | |
273 | `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \ | |
274 | doc/help/api-*.tokens | |
275 | $(RM) doc/help/api-*.tokens | |
276 | echo Indexing docset... | |
277 | /Developer/usr/bin/docsetutil index org.cups.docset | |
278 | echo Generating docset archive and feed... | |
279 | $(RM) org.cups.docset.atom | |
280 | /Developer/usr/bin/docsetutil package --output org.cups.docset.xar \ | |
281 | --atom org.cups.docset.atom \ | |
282 | --download-url http://www.cups.org/org.cups.docset.xar \ | |
283 | org.cups.docset | |
284 | ||
285 | ||
286 | # | |
287 | # Make software distributions using EPM (http://www.epmhome.org/)... | |
288 | # | |
289 | ||
290 | EPMFLAGS = -v --output-dir dist $(EPMARCH) | |
291 | ||
292 | aix bsd deb depot inst pkg setld slackware swinstall tardist: | |
293 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list | |
294 | ||
295 | epm: | |
296 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list | |
297 | ||
298 | osx: | |
299 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
300 | ||
301 | rpm: | |
302 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
303 | ||
304 | .PHONEY: dist | |
305 | dist: all | |
306 | $(RM) -r dist | |
307 | $(MAKE) $(MFLAGS) epm | |
308 | case `uname` in \ | |
309 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
310 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
311 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
312 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ | |
313 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
314 | esac | |
315 | ||
316 | ||
317 | # | |
318 | # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $". | |
319 | # |