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