]> git.ipfire.org Git - thirdparty/cups.git/blame_incremental - Makefile
Implement CUPS-Create-Local-Printer operation and add test file.
[thirdparty/cups.git] / Makefile
... / ...
CommitLineData
1#
2# "$Id$"
3#
4# Top-level Makefile for CUPS.
5#
6# Copyright 2007-2014 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)
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) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
102 $(RM) cups-config
103 $(RM) data/testprint
104 $(RM) desktop/cups.desktop
105 $(RM) doc/index.html
106 $(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
107 $(RM) packaging/cups.list
108 $(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
109 $(RM) templates/header.tmpl
110 -$(RM) doc/*/index.html
111 -$(RM) templates/*/header.tmpl
112 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
113
114
115#
116# Make dependencies
117#
118
119depend:
120 for dir in $(DIRS); do\
121 echo Making dependencies in $$dir... ;\
122 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
123 done
124
125
126#
127# Run the Clang static code analysis tool on the sources, available here:
128#
129# http://clang-analyzer.llvm.org
130#
131# At least checker-231 is required.
132#
133# Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
134# output instead of HTML...)
135#
136
137.PHONY: clang clang-changes
138clang:
139 $(RM) -r clang
140 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
141clang-changes:
142 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
143
144
145#
146# Run the STACK tool on the sources, available here:
147#
148# http://css.csail.mit.edu/stack/
149#
150# Do the following to pass options to configure:
151#
152# make CONFIGFLAGS="--foo --bar" stack
153#
154
155.PHONY: stack
156stack:
157 stack-build ./configure $(CONFIGFLAGS)
158 stack-build $(MAKE) $(MFLAGS) clean all
159 poptck
160 $(MAKE) $(MFLAGS) distclean
161 $(RM) */*.ll
162 $(RM) */*.ll.out
163
164
165#
166# Generate a ctags file...
167#
168
169ctags:
170 ctags -R .
171
172
173#
174# Install everything...
175#
176
177install: install-data install-headers install-libs install-exec
178
179
180#
181# Install data files...
182#
183
184install-data:
185 echo Making all in cups...
186 (cd cups; $(MAKE) $(MFLAGS) all)
187 for dir in $(DIRS); do\
188 echo Installing data files in $$dir... ;\
189 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
190 done
191 echo Installing cups-config script...
192 $(INSTALL_DIR) -m 755 $(BINDIR)
193 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
194
195
196#
197# Install header files...
198#
199
200install-headers:
201 for dir in $(DIRS); do\
202 echo Installing header files in $$dir... ;\
203 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
204 done
205 if test "x$(privateinclude)" != x; then \
206 echo Installing config.h into $(PRIVATEINCLUDE)...; \
207 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
208 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
209 fi
210
211
212#
213# Install programs...
214#
215
216install-exec: all
217 for dir in $(DIRS); do\
218 echo Installing programs in $$dir... ;\
219 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
220 done
221
222
223#
224# Install libraries...
225#
226
227install-libs: libs
228 for dir in $(DIRS); do\
229 echo Installing libraries in $$dir... ;\
230 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
231 done
232
233
234#
235# Uninstall object and target files...
236#
237
238uninstall:
239 for dir in $(DIRS); do\
240 echo Uninstalling in $$dir... ;\
241 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
242 done
243 echo Uninstalling cups-config script...
244 $(RM) $(BINDIR)/cups-config
245 -$(RMDIR) $(BINDIR)
246
247
248#
249# Run the test suite...
250#
251
252test: all unittests
253 echo Running CUPS test suite...
254 cd test; ./run-stp-tests.sh
255
256
257check: all unittests
258 echo Running CUPS test suite with defaults...
259 cd test; ./run-stp-tests.sh 1 0 n n
260
261debugcheck: all unittests
262 echo Running CUPS test suite with debug printfs...
263 cd test; ./run-stp-tests.sh 1 0 n y
264
265
266#
267# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
268#
269
270apihelp:
271 for dir in cgi-bin cups filter ppdc scheduler; do\
272 echo Generating API help in $$dir... ;\
273 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
274 done
275
276framedhelp:
277 for dir in cgi-bin cups filter ppdc scheduler; do\
278 echo Generating framed API help in $$dir... ;\
279 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
280 done
281
282
283#
284# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
285#
286
287docset: apihelp
288 echo Generating docset directory tree...
289 $(RM) -r org.cups.docset
290 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
291 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
292 cd man; $(MAKE) $(MFLAGS) html
293 cd doc; $(MAKE) $(MFLAGS) docset
294 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
295 cgi-bin/makedocset org.cups.docset \
296 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
297 doc/help/api-*.tokens
298 $(RM) doc/help/api-*.tokens
299 echo Indexing docset...
300 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
301 echo Generating docset archive and feed...
302 $(RM) org.cups.docset.atom
303 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
304 --atom org.cups.docset.atom \
305 --download-url http://www.cups.org/org.cups.docset.xar \
306 org.cups.docset
307
308
309#
310# Lines of code computation...
311#
312
313sloc:
314 for dir in cups scheduler; do \
315 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
316 done
317
318
319#
320# Make software distributions using EPM (http://www.msweet.org/)...
321#
322
323EPMFLAGS = -v --output-dir dist $(EPMARCH)
324
325bsd deb pkg slackware:
326 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
327
328epm:
329 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
330
331rpm:
332 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
333
334.PHONEY: dist
335dist: all
336 $(RM) -r dist
337 $(MAKE) $(MFLAGS) epm
338 case `uname` in \
339 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
340 Darwin*) $(MAKE) $(MFLAGS) osx;; \
341 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
342 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
343 esac
344
345
346#
347# Don't run top-level build targets in parallel...
348#
349
350.NOTPARALLEL:
351
352
353#
354# End of "$Id$".
355#