]> git.ipfire.org Git - thirdparty/cups.git/blame - Makefile
Save work on TLS stuff (does not compile)
[thirdparty/cups.git] / Makefile
CommitLineData
ef416fc2 1#
f2d18633 2# "$Id$"
ef416fc2 3#
5a1d7a17 4# Top-level Makefile for CUPS.
ef416fc2 5#
5a1d7a17
MS
6# Copyright 2007-2013 by Apple Inc.
7# Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8#
5a1d7a17
MS
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/".
ef416fc2 14#
15
16include Makedefs
17
49d87452 18
ef416fc2 19#
20# Directories to make...
21#
22
a4845881 23DIRS = cups test $(BUILDDIRS)
bd7854cb 24
ef416fc2 25
26#
27# Make all targets...
28#
29
30all:
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
50libs:
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
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
ef416fc2 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
bd7854cb 94
a9252913 95#
96# Remove all non-distribution files...
97#
98
99distclean: 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
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
1f0275e3 130#
148d3699
MS
131# Run the Clang static code analysis tool on the sources, available here:
132#
133# http://clang-analyzer.llvm.org
134#
135# At least checker-231 is required.
1f0275e3
MS
136#
137
f8b3a85b 138.PHONY: clang clang-changes
1f0275e3 139clang:
c5571a1d 140 $(RM) -r clang
41681883 141 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
f8b3a85b
MS
142clang-changes:
143 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
1f0275e3
MS
144
145
148d3699
MS
146#
147# Run the STACK tool on the sources, available here:
148#
149# http://css.csail.mit.edu/stack/
150#
151# Do the following to pass options to configure:
152#
153# make CONFIGFLAGS="--foo --bar" stack
154#
155
156.PHONY: stack
157stack:
158 stack-build ./configure $(CONFIGFLAGS)
159 stack-build $(MAKE) $(MFLAGS) clean all
160 poptck
161 $(MAKE) $(MFLAGS) distclean
162 $(RM) */*.ll
163 $(RM) */*.ll.out
164
165
b94498cf 166#
167# Generate a ctags file...
168#
169
170ctags:
171 ctags -R .
172
173
ef416fc2 174#
50fe7201 175# Install everything...
ef416fc2 176#
177
50fe7201
MS
178install: install-data install-headers install-libs install-exec
179
180
181#
182# Install data files...
183#
184
185install-data:
229681c1
MS
186 echo Making all in cups...
187 (cd cups; $(MAKE) $(MFLAGS) all)
ef416fc2 188 for dir in $(DIRS); do\
50fe7201
MS
189 echo Installing data files in $$dir... ;\
190 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
ef416fc2 191 done
ef416fc2 192 echo Installing cups-config script...
757d2cad 193 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 194 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
4d301e69 195
ef416fc2 196
50fe7201
MS
197#
198# Install header files...
199#
200
201install-headers:
202 for dir in $(DIRS); do\
203 echo Installing header files in $$dir... ;\
204 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
205 done
71e16022
MS
206 if test "x$(privateinclude)" != x; then \
207 echo Installing config.h into $(PRIVATEINCLUDE)...; \
5180a04c
MS
208 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
209 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
71e16022 210 fi
50fe7201 211
ef416fc2 212
213#
50fe7201 214# Install programs...
ef416fc2 215#
216
c9fc04c6 217install-exec: all
50fe7201
MS
218 for dir in $(DIRS); do\
219 echo Installing programs in $$dir... ;\
c9fc04c6 220 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
50fe7201 221 done
ef416fc2 222
50fe7201
MS
223
224#
225# Install libraries...
226#
227
c9fc04c6 228install-libs: libs
50fe7201
MS
229 for dir in $(DIRS); do\
230 echo Installing libraries in $$dir... ;\
c9fc04c6 231 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
50fe7201 232 done
ef416fc2 233
234
757d2cad 235#
236# Uninstall object and target files...
237#
238
239uninstall:
240 for dir in $(DIRS); do\
241 echo Uninstalling in $$dir... ;\
242 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
243 done
244 echo Uninstalling cups-config script...
245 $(RM) $(BINDIR)/cups-config
246 -$(RMDIR) $(BINDIR)
757d2cad 247
248
ef416fc2 249#
250# Run the test suite...
251#
252
f11a948a 253test: all unittests
ef416fc2 254 echo Running CUPS test suite...
255 cd test; ./run-stp-tests.sh
256
257
f11a948a 258check: all unittests
d09495fa 259 echo Running CUPS test suite with defaults...
85dda01c
MS
260 cd test; ./run-stp-tests.sh 1 0 n n
261
262debugcheck: all unittests
263 echo Running CUPS test suite with debug printfs...
264 cd test; ./run-stp-tests.sh 1 0 n y
d09495fa 265
266
f11a948a 267#
9520743f 268# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
f11a948a
MS
269#
270
271apihelp:
a2326b5b 272 for dir in cgi-bin cups filter ppdc scheduler; do\
f11a948a
MS
273 echo Generating API help in $$dir... ;\
274 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
275 done
276
277framedhelp:
a2326b5b 278 for dir in cgi-bin cups filter ppdc scheduler; do\
f11a948a
MS
279 echo Generating framed API help in $$dir... ;\
280 (cd $$dir; $(MAKE) $(MFLAGS) framedhelp) || exit 1;\
281 done
282
178cb736
MS
283
284#
9520743f 285# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
178cb736
MS
286#
287
f11a948a
MS
288docset: apihelp
289 echo Generating docset directory tree...
290 $(RM) -r org.cups.docset
291 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
292 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
178cb736 293 cd man; $(MAKE) $(MFLAGS) html
f11a948a
MS
294 cd doc; $(MAKE) $(MFLAGS) docset
295 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
296 cgi-bin/makedocset org.cups.docset \
297 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
298 doc/help/api-*.tokens
299 $(RM) doc/help/api-*.tokens
300 echo Indexing docset...
a29fd7dd 301 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
f11a948a 302 echo Generating docset archive and feed...
85b5d1df 303 $(RM) org.cups.docset.atom
a29fd7dd 304 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
f11a948a
MS
305 --atom org.cups.docset.atom \
306 --download-url http://www.cups.org/org.cups.docset.xar \
307 org.cups.docset
308
309
84315f46
MS
310#
311# Lines of code computation...
312#
313
314sloc:
a4845881 315 for dir in cups scheduler; do \
84315f46
MS
316 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
317 done
318
319
ef416fc2 320#
9520743f 321# Make software distributions using EPM (http://www.msweet.org/)...
ef416fc2 322#
323
d09495fa 324EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 325
5a1d7a17 326bsd deb pkg slackware tardist:
4744bd90 327 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 328
329epm:
d09495fa 330 epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
331
b86bc4cf 332rpm:
333 epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
334
d09495fa 335.PHONEY: dist
336dist: all
337 $(RM) -r dist
338 $(MAKE) $(MFLAGS) epm
339 case `uname` in \
340 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
341 Darwin*) $(MAKE) $(MFLAGS) osx;; \
97c9a8d7 342 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
d09495fa 343 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
344 esac
ef416fc2 345
bd7854cb 346
ef416fc2 347#
31db8ded
MS
348# Don't run top-level build targets in parallel...
349#
350
351.NOTPARALLEL:
352
353
354#
f2d18633 355# End of "$Id$".
ef416fc2 356#