Don't install cupscgi, cupsmime, or cupsppdc shared libraries.
[thirdparty/cups.git] / Makefile
CommitLineData
ef416fc2 1#
5a1d7a17 2# Top-level Makefile for CUPS.
ef416fc2 3#
d825017a 4# Copyright 2007-2016 by Apple Inc.
5a1d7a17 5# Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 6#
e3101897 7# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
ef416fc2 8#
9
10include Makedefs
11
49d87452 12
ef416fc2 13#
14# Directories to make...
15#
16
a4845881 17DIRS = cups test $(BUILDDIRS)
bd7854cb 18
ef416fc2 19
20#
21# Make all targets...
22#
23
24all:
25 chmod +x cups-config
c9fc04c6 26 echo Using ARCHFLAGS="$(ARCHFLAGS)"
ac884b6a
MS
27 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
28 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
5f64df29
MS
29 echo Using CC="$(CC)"
30 echo Using CXX="$(CC)"
c9fc04c6 31 echo Using DSOFLAGS="$(DSOFLAGS)"
ac884b6a
MS
32 echo Using LDFLAGS="$(LDFLAGS)"
33 echo Using LIBS="$(LIBS)"
ef416fc2 34 for dir in $(DIRS); do\
35 echo Making all in $$dir... ;\
1f6f3dbc 36 (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\
c9fc04c6
MS
37 done
38
39
40#
41# Make library targets...
42#
43
44libs:
45 echo Using ARCHFLAGS="$(ARCHFLAGS)"
46 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
47 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
5f64df29
MS
48 echo Using CC="$(CC)"
49 echo Using CXX="$(CC)"
c9fc04c6
MS
50 echo Using DSOFLAGS="$(DSOFLAGS)"
51 echo Using LDFLAGS="$(LDFLAGS)"
52 echo Using LIBS="$(LIBS)"
53 for dir in $(DIRS); do\
8922323b 54 echo Making libraries in $$dir... ;\
c9fc04c6 55 (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\
ef416fc2 56 done
57
bd7854cb 58
5f64df29
MS
59#
60# Make unit test targets...
61#
62
63unittests:
64 echo Using ARCHFLAGS="$(ARCHFLAGS)"
65 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
66 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
67 echo Using CC="$(CC)"
68 echo Using CXX="$(CC)"
69 echo Using DSOFLAGS="$(DSOFLAGS)"
70 echo Using LDFLAGS="$(LDFLAGS)"
71 echo Using LIBS="$(LIBS)"
72 for dir in $(DIRS); do\
73 echo Making all in $$dir... ;\
74 (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
75 done
76
77
ef416fc2 78#
79# Remove object and target files...
80#
81
82clean:
83 for dir in $(DIRS); do\
84 echo Cleaning in $$dir... ;\
85 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
86 done
87
bd7854cb 88
a9252913 89#
90# Remove all non-distribution files...
91#
92
93distclean: clean
94 $(RM) Makedefs config.h config.log config.status
d95bd167 95 $(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
0a682745 96 $(RM) cups-config
d95bd167
MS
97 $(RM) data/testprint
98 $(RM) desktop/cups.desktop
99 $(RM) doc/index.html
100 $(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
f7deaa1a 101 $(RM) packaging/cups.list
352d5a7d 102 $(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
db1f069b 103 $(RM) templates/header.tmpl
a9252913 104 -$(RM) doc/*/index.html
a9252913 105 -$(RM) templates/*/header.tmpl
d95bd167 106 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
a9252913 107
108
ef416fc2 109#
110# Make dependencies
111#
112
113depend:
114 for dir in $(DIRS); do\
115 echo Making dependencies in $$dir... ;\
116 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
117 done
118
119
1f0275e3 120#
148d3699
MS
121# Run the Clang static code analysis tool on the sources, available here:
122#
123# http://clang-analyzer.llvm.org
124#
125# At least checker-231 is required.
1f0275e3 126#
95ece0cb
MS
127# Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
128# output instead of HTML...)
129#
1f0275e3 130
f8b3a85b 131.PHONY: clang clang-changes
1f0275e3 132clang:
c5571a1d 133 $(RM) -r clang
41681883 134 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
f8b3a85b
MS
135clang-changes:
136 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
1f0275e3
MS
137
138
148d3699
MS
139#
140# Run the STACK tool on the sources, available here:
141#
142# http://css.csail.mit.edu/stack/
143#
144# Do the following to pass options to configure:
145#
146# make CONFIGFLAGS="--foo --bar" stack
147#
148
149.PHONY: stack
150stack:
151 stack-build ./configure $(CONFIGFLAGS)
152 stack-build $(MAKE) $(MFLAGS) clean all
153 poptck
154 $(MAKE) $(MFLAGS) distclean
155 $(RM) */*.ll
156 $(RM) */*.ll.out
157
158
b94498cf 159#
160# Generate a ctags file...
161#
162
163ctags:
164 ctags -R .
165
166
ef416fc2 167#
50fe7201 168# Install everything...
ef416fc2 169#
170
50fe7201
MS
171install: install-data install-headers install-libs install-exec
172
173
174#
175# Install data files...
176#
177
178install-data:
229681c1
MS
179 echo Making all in cups...
180 (cd cups; $(MAKE) $(MFLAGS) all)
ef416fc2 181 for dir in $(DIRS); do\
50fe7201
MS
182 echo Installing data files in $$dir... ;\
183 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
ef416fc2 184 done
ef416fc2 185 echo Installing cups-config script...
757d2cad 186 $(INSTALL_DIR) -m 755 $(BINDIR)
ef416fc2 187 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
4d301e69 188
ef416fc2 189
50fe7201
MS
190#
191# Install header files...
192#
193
194install-headers:
195 for dir in $(DIRS); do\
196 echo Installing header files in $$dir... ;\
197 (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
198 done
71e16022
MS
199 if test "x$(privateinclude)" != x; then \
200 echo Installing config.h into $(PRIVATEINCLUDE)...; \
5180a04c
MS
201 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
202 $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
71e16022 203 fi
50fe7201 204
ef416fc2 205
206#
50fe7201 207# Install programs...
ef416fc2 208#
209
c9fc04c6 210install-exec: all
50fe7201
MS
211 for dir in $(DIRS); do\
212 echo Installing programs in $$dir... ;\
c9fc04c6 213 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
50fe7201 214 done
ef416fc2 215
50fe7201
MS
216
217#
218# Install libraries...
219#
220
c9fc04c6 221install-libs: libs
50fe7201
MS
222 for dir in $(DIRS); do\
223 echo Installing libraries in $$dir... ;\
c9fc04c6 224 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
50fe7201 225 done
ef416fc2 226
227
757d2cad 228#
229# Uninstall object and target files...
230#
231
232uninstall:
233 for dir in $(DIRS); do\
234 echo Uninstalling in $$dir... ;\
235 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
236 done
237 echo Uninstalling cups-config script...
238 $(RM) $(BINDIR)/cups-config
239 -$(RMDIR) $(BINDIR)
757d2cad 240
241
ef416fc2 242#
243# Run the test suite...
244#
245
f11a948a 246test: all unittests
ef416fc2 247 echo Running CUPS test suite...
248 cd test; ./run-stp-tests.sh
249
250
f11a948a 251check: all unittests
d09495fa 252 echo Running CUPS test suite with defaults...
85dda01c
MS
253 cd test; ./run-stp-tests.sh 1 0 n n
254
255debugcheck: all unittests
256 echo Running CUPS test suite with debug printfs...
257 cd test; ./run-stp-tests.sh 1 0 n y
d09495fa 258
259
f11a948a 260#
9520743f 261# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
f11a948a
MS
262#
263
264apihelp:
d825017a 265 for dir in cups filter; do\
f11a948a
MS
266 echo Generating API help in $$dir... ;\
267 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
268 done
269
178cb736
MS
270
271#
9520743f 272# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
178cb736
MS
273#
274
f11a948a
MS
275docset: apihelp
276 echo Generating docset directory tree...
277 $(RM) -r org.cups.docset
278 mkdir -p org.cups.docset/Contents/Resources/Documentation/help
279 mkdir -p org.cups.docset/Contents/Resources/Documentation/images
178cb736 280 cd man; $(MAKE) $(MFLAGS) html
f11a948a
MS
281 cd doc; $(MAKE) $(MFLAGS) docset
282 cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
283 cgi-bin/makedocset org.cups.docset \
284 `svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
285 doc/help/api-*.tokens
286 $(RM) doc/help/api-*.tokens
287 echo Indexing docset...
a29fd7dd 288 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
f11a948a 289 echo Generating docset archive and feed...
85b5d1df 290 $(RM) org.cups.docset.atom
a29fd7dd 291 /Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
f11a948a
MS
292 --atom org.cups.docset.atom \
293 --download-url http://www.cups.org/org.cups.docset.xar \
294 org.cups.docset
295
296
84315f46
MS
297#
298# Lines of code computation...
299#
300
301sloc:
a4845881 302 for dir in cups scheduler; do \
84315f46
MS
303 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
304 done
305
306
ef416fc2 307#
9520743f 308# Make software distributions using EPM (http://www.msweet.org/)...
ef416fc2 309#
310
d09495fa 311EPMFLAGS = -v --output-dir dist $(EPMARCH)
ef416fc2 312
8072030b 313bsd deb epm pkg rpm slackware:
4744bd90 314 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
ef416fc2 315
83bf1f7b 316.PHONY: dist
d09495fa 317dist: all
318 $(RM) -r dist
319 $(MAKE) $(MFLAGS) epm
320 case `uname` in \
321 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
97c9a8d7 322 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
d09495fa 323 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
324 esac
ef416fc2 325
bd7854cb 326
ef416fc2 327#
31db8ded
MS
328# Don't run top-level build targets in parallel...
329#
330
331.NOTPARALLEL: