]> git.ipfire.org Git - thirdparty/cups.git/blob - Makefile
Clean up installation of private headers.
[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
201
202 #
203 # Install programs...
204 #
205
206 install-exec: all
207 for dir in $(DIRS); do\
208 echo Installing programs in $$dir... ;\
209 (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\
210 done
211
212
213 #
214 # Install libraries...
215 #
216
217 install-libs: libs
218 for dir in $(DIRS); do\
219 echo Installing libraries in $$dir... ;\
220 (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\
221 done
222
223
224 #
225 # Uninstall object and target files...
226 #
227
228 uninstall:
229 for dir in $(DIRS); do\
230 echo Uninstalling in $$dir... ;\
231 (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\
232 done
233 echo Uninstalling cups-config script...
234 $(RM) $(BINDIR)/cups-config
235 -$(RMDIR) $(BINDIR)
236
237
238 #
239 # Run the test suite...
240 #
241
242 test: all unittests
243 echo Running CUPS test suite...
244 cd test; ./run-stp-tests.sh
245
246
247 check: all unittests
248 echo Running CUPS test suite with defaults...
249 cd test; ./run-stp-tests.sh 1 0 n n
250
251 debugcheck: all unittests
252 echo Running CUPS test suite with debug printfs...
253 cd test; ./run-stp-tests.sh 1 0 n y
254
255
256 #
257 # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
258 #
259
260 apihelp:
261 for dir in cups filter; do\
262 echo Generating API help in $$dir... ;\
263 (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\
264 done
265
266
267 #
268 # Lines of code computation...
269 #
270
271 sloc:
272 for dir in cups scheduler; do \
273 (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
274 done
275
276
277 #
278 # Make software distributions using EPM (http://www.msweet.org/)...
279 #
280
281 EPMFLAGS = -v --output-dir dist $(EPMARCH)
282
283 bsd deb epm pkg rpm slackware:
284 epm $(EPMFLAGS) -f $@ cups packaging/cups.list
285
286 .PHONY: dist
287 dist: all
288 $(RM) -r dist
289 $(MAKE) $(MFLAGS) epm
290 case `uname` in \
291 *BSD*) $(MAKE) $(MFLAGS) bsd;; \
292 Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
293 SunOS*) $(MAKE) $(MFLAGS) pkg;; \
294 esac
295
296
297 #
298 # Don't run top-level build targets in parallel...
299 #
300
301 .NOTPARALLEL: