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