]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Update man pages.
[thirdparty/cups.git] / Makefile
1 #
2 # Top-level Makefile for CUPS.
3 #
4 # Copyright © 2007-2019 by Apple Inc.
5 # Copyright © 1997-2007 by Easy Software Products, all rights reserved.
6 #
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
8 # information.
9 #
10
11 include Makedefs
12
13
14 #
15 # Directories to make...
16 #
17
18 DIRS = cups $(BUILDDIRS)
19
20
21 #
22 # Make all targets...
23 #
24
25 all:
26 chmod +x cups-config
27 echo Using ARCHFLAGS="$(ARCHFLAGS)"
28 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
29 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
30 echo Using CC="$(CC)"
31 echo Using CXX="$(CC)"
32 echo Using DSOFLAGS="$(DSOFLAGS)"
33 echo Using LDFLAGS="$(LDFLAGS)"
34 echo Using LIBS="$(LIBS)"
35 for dir in $(DIRS); do\
36 echo Making all in $$dir... ;\
37 (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\
38 done
39
40
41 #
42 # Make library targets...
43 #
44
45 libs:
46 echo Using ARCHFLAGS="$(ARCHFLAGS)"
47 echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
48 echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
49 echo Using CC="$(CC)"
50 echo Using CXX="$(CC)"
51 echo Using DSOFLAGS="$(DSOFLAGS)"
52 echo Using LDFLAGS="$(LDFLAGS)"
53 echo Using LIBS="$(LIBS)"
54 for dir in $(DIRS); do\
55 echo Making libraries in $$dir... ;\
56 (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\
57 done
58
59
60 #
61 # Make unit test targets...
62 #
63
64 unittests:
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
79 #
80 # Remove object and target files...
81 #
82
83 clean:
84 for dir in $(DIRS); do\
85 echo Cleaning in $$dir... ;\
86 (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
87 done
88
89
90 #
91 # Remove all non-distribution files...
92 #
93
94 distclean: clean
95 $(RM) Makedefs config.h config.log config.status
96 $(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
97 $(RM) cups-config
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
102 $(RM) packaging/cups.list
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
104 $(RM) templates/header.tmpl
105 -$(RM) doc/*/index.html
106 -$(RM) templates/*/header.tmpl
107 -$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
108
109
110 #
111 # Make dependencies
112 #
113
114 depend:
115 for dir in $(DIRS); do\
116 echo Making dependencies in $$dir... ;\
117 (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
118 done
119
120
121 #
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.
127 #
128 # Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
129 # output instead of HTML...)
130 #
131
132 .PHONY: clang clang-changes
133 clang:
134 $(RM) -r clang
135 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
136 clang-changes:
137 scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
138
139
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
151 stack:
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
160 #
161 # Generate a ctags file...
162 #
163
164 ctags:
165 ctags -R .
166
167
168 #
169 # Install everything...
170 #
171
172 install: install-data install-headers install-libs install-exec
173
174
175 #
176 # Install data files...
177 #
178
179 install-data:
180 echo Making all in cups...
181 (cd cups; $(MAKE) $(MFLAGS) all)
182 for dir in $(DIRS); do\
183 echo Installing data files in $$dir... ;\
184 (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
185 done
186 echo Installing cups-config script...
187 $(INSTALL_DIR) -m 755 $(BINDIR)
188 $(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
189
190
191 #
192 # Install header files...
193 #
194
195 install-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
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
205
206
207 #
208 # Install programs...
209 #
210
211 install-exec: all
212 for dir in $(DIRS); do\
213 echo Installing programs in $$dir... ;\
214 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
215 done
216
217
218 #
219 # Install libraries...
220 #
221
222 install-libs: libs
223 for dir in $(DIRS); do\
224 echo Installing libraries in $$dir... ;\
225 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
226 done
227
228
229 #
230 # Uninstall object and target files...
231 #
232
233 uninstall:
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)
241
242
243 #
244 # Run the test suite...
245 #
246
247 test: all unittests
248 echo Running CUPS test suite...
249 cd test; ./run-stp-tests.sh
250
251
252 check: all unittests
253 echo Running CUPS test suite with defaults...
254 cd test; ./run-stp-tests.sh 1 0 n n
255
256 debugcheck: all unittests
257 echo Running CUPS test suite with debug printfs...
258 cd test; ./run-stp-tests.sh 1 0 n y
259
260
261 #
262 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
263 #
264
265 apihelp:
266 for dir in cups filter; do\
267 echo Generating API help in $$dir... ;\
268 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
269 done
270
271
272 #
273 # Lines of code computation...
274 #
275
276 sloc:
277 for dir in cups scheduler; do \
278 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
279 done
280
281
282 #
283 # Make software distributions using EPM (http://www.msweet.org/)...
284 #
285
286 EPMFLAGS = -v --output-dir dist $(EPMARCH)
287
288 bsd deb epm pkg rpm slackware:
289 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
290
291 .PHONY: dist
292 dist: all
293 $(RM) -r dist
294 $(MAKE) $(MFLAGS) epm
295 case `uname` in \
296 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
297 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
298 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
299 esac
300
301
302 #
303 # Don't run top-level build targets in parallel...
304 #
305
306 .NOTPARALLEL: