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