]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
b19ccc9e | 2 | # "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $" |
ef416fc2 | 3 | # |
f8b3a85b | 4 | # Top-level Makefile for CUPS. |
ef416fc2 | 5 | # |
f8b3a85b | 6 | # Copyright 2007-2010 by Apple Inc. |
f7deaa1a | 7 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | # |
9 | # These coded instructions, statements, and computer programs are the | |
bc44d920 | 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 | ||
6d2f911b | 23 | DIRS = cups test $(BUILDDIRS) $(PHPDIR) $(FONTS) |
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 | |
0a682745 MS |
101 | $(RM) cups-config |
102 | $(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf | |
103 | $(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html | |
b94498cf | 104 | $(RM) man/client.conf.man |
a9252913 | 105 | $(RM) man/cups-deviced.man man/cups-driverd.man |
106 | $(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man | |
b19ccc9e | 107 | $(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man |
f7deaa1a | 108 | $(RM) packaging/cups.list |
58dc1933 | 109 | $(RM) packaging/cups-desc.plist packaging/cups-info.plist |
db1f069b | 110 | $(RM) templates/header.tmpl |
c5571a1d | 111 | $(RM) desktop/cups.desktop |
71e16022 | 112 | $(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd |
4d301e69 | 113 | $(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml |
a9252913 | 114 | -$(RM) doc/*/index.html |
a9252913 | 115 | -$(RM) templates/*/header.tmpl |
58dc1933 | 116 | -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test |
a9252913 | 117 | |
118 | ||
ef416fc2 | 119 | # |
120 | # Make dependencies | |
121 | # | |
122 | ||
123 | depend: | |
124 | for dir in $(DIRS); do\ | |
125 | echo Making dependencies in $$dir... ;\ | |
126 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
127 | done | |
128 | ||
129 | ||
1f0275e3 MS |
130 | # |
131 | # Run the clang.llvm.org static code analysis tool on the C sources. | |
41681883 | 132 | # (at least checker-231 is required for scan-build to work this way) |
1f0275e3 MS |
133 | # |
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 | ||
b94498cf | 143 | # |
144 | # Generate a ctags file... | |
145 | # | |
146 | ||
147 | ctags: | |
148 | ctags -R . | |
149 | ||
150 | ||
ef416fc2 | 151 | # |
50fe7201 | 152 | # Install everything... |
ef416fc2 | 153 | # |
154 | ||
50fe7201 MS |
155 | install: install-data install-headers install-libs install-exec |
156 | ||
157 | ||
158 | # | |
159 | # Install data files... | |
160 | # | |
161 | ||
162 | install-data: | |
ef416fc2 | 163 | for dir in $(DIRS); do\ |
50fe7201 MS |
164 | echo Installing data files in $$dir... ;\ |
165 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
ef416fc2 | 166 | done |
ef416fc2 | 167 | echo Installing cups-config script... |
757d2cad | 168 | $(INSTALL_DIR) -m 755 $(BINDIR) |
ef416fc2 | 169 | $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config |
4d301e69 | 170 | |
ef416fc2 | 171 | |
50fe7201 MS |
172 | # |
173 | # Install header files... | |
174 | # | |
175 | ||
176 | install-headers: | |
177 | for dir in $(DIRS); do\ | |
178 | echo Installing header files in $$dir... ;\ | |
179 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
180 | done | |
71e16022 MS |
181 | if test "x$(privateinclude)" != x; then \ |
182 | echo Installing config.h into $(PRIVATEINCLUDE)...; \ | |
5180a04c MS |
183 | $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \ |
184 | $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \ | |
71e16022 | 185 | fi |
50fe7201 | 186 | |
ef416fc2 | 187 | |
188 | # | |
50fe7201 | 189 | # Install programs... |
ef416fc2 | 190 | # |
191 | ||
c9fc04c6 | 192 | install-exec: all |
50fe7201 MS |
193 | for dir in $(DIRS); do\ |
194 | echo Installing programs in $$dir... ;\ | |
c9fc04c6 | 195 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ |
50fe7201 | 196 | done |
ef416fc2 | 197 | |
50fe7201 MS |
198 | |
199 | # | |
200 | # Install libraries... | |
201 | # | |
202 | ||
c9fc04c6 | 203 | install-libs: libs |
50fe7201 MS |
204 | for dir in $(DIRS); do\ |
205 | echo Installing libraries in $$dir... ;\ | |
c9fc04c6 | 206 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ |
50fe7201 | 207 | done |
ef416fc2 | 208 | |
209 | ||
757d2cad | 210 | # |
211 | # Uninstall object and target files... | |
212 | # | |
213 | ||
214 | uninstall: | |
215 | for dir in $(DIRS); do\ | |
216 | echo Uninstalling in $$dir... ;\ | |
217 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
218 | done | |
219 | echo Uninstalling cups-config script... | |
220 | $(RM) $(BINDIR)/cups-config | |
221 | -$(RMDIR) $(BINDIR) | |
757d2cad | 222 | |
223 | ||
ef416fc2 | 224 | # |
225 | # Run the test suite... | |
226 | # | |
227 | ||
f11a948a | 228 | test: all unittests |
ef416fc2 | 229 | echo Running CUPS test suite... |
230 | cd test; ./run-stp-tests.sh | |
231 | ||
232 | ||
f11a948a | 233 | check: all unittests |
d09495fa | 234 | echo Running CUPS test suite with defaults... |
235 | cd test; ./run-stp-tests.sh 1 0 n | |
236 | ||
237 | ||
f11a948a | 238 | # |
178cb736 | 239 | # Create HTML documentation... |
f11a948a MS |
240 | # |
241 | ||
242 | apihelp: | |
243 | for dir in cgi-bin cups filter driver ppdc scheduler; do\ | |
244 | echo Generating API help in $$dir... ;\ | |
245 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
246 | done | |
247 | ||
248 | framedhelp: | |
249 | for dir in cgi-bin cups filter driver ppdc scheduler; do\ | |
250 | echo Generating framed API help in $$dir... ;\ | |
251 | (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\ | |
252 | done | |
253 | ||
178cb736 MS |
254 | |
255 | # | |
256 | # Create an Xcode docset... | |
257 | # | |
258 | ||
f11a948a MS |
259 | docset: apihelp |
260 | echo Generating docset directory tree... | |
261 | $(RM) -r org.cups.docset | |
262 | mkdir -p org.cups.docset/Contents/Resources/Documentation/help | |
263 | mkdir -p org.cups.docset/Contents/Resources/Documentation/images | |
178cb736 | 264 | cd man; $(MAKE) $(MFLAGS) html |
f11a948a MS |
265 | cd doc; $(MAKE) $(MFLAGS) docset |
266 | cd cgi-bin; $(MAKE) $(MFLAGS) makedocset | |
267 | cgi-bin/makedocset org.cups.docset \ | |
268 | `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \ | |
269 | doc/help/api-*.tokens | |
270 | $(RM) doc/help/api-*.tokens | |
271 | echo Indexing docset... | |
272 | /Developer/usr/bin/docsetutil index org.cups.docset | |
273 | echo Generating docset archive and feed... | |
85b5d1df | 274 | $(RM) org.cups.docset.atom |
f11a948a MS |
275 | /Developer/usr/bin/docsetutil package --output org.cups.docset.xar \ |
276 | --atom org.cups.docset.atom \ | |
277 | --download-url http://www.cups.org/org.cups.docset.xar \ | |
278 | org.cups.docset | |
279 | ||
280 | ||
ef416fc2 | 281 | # |
f8b3a85b | 282 | # Make software distributions using EPM (http://www.epmhome.org/)... |
ef416fc2 | 283 | # |
284 | ||
d09495fa | 285 | EPMFLAGS = -v --output-dir dist $(EPMARCH) |
ef416fc2 | 286 | |
b86bc4cf | 287 | aix bsd deb depot inst pkg setld slackware swinstall tardist: |
4744bd90 | 288 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list |
ef416fc2 | 289 | |
290 | epm: | |
d09495fa | 291 | epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list |
292 | ||
293 | osx: | |
294 | epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list | |
295 | ||
b86bc4cf | 296 | rpm: |
297 | epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list | |
298 | ||
d09495fa | 299 | .PHONEY: dist |
300 | dist: all | |
301 | $(RM) -r dist | |
302 | $(MAKE) $(MFLAGS) epm | |
303 | case `uname` in \ | |
304 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
305 | Darwin*) $(MAKE) $(MFLAGS) osx;; \ | |
306 | IRIX*) $(MAKE) $(MFLAGS) tardist;; \ | |
97c9a8d7 | 307 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ |
d09495fa | 308 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ |
309 | esac | |
ef416fc2 | 310 | |
bd7854cb | 311 | |
ef416fc2 | 312 | # |
b19ccc9e | 313 | # End of "$Id: Makefile 7961 2008-09-17 19:52:46Z mike $". |
ef416fc2 | 314 | # |