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