]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Top-level Makefile for CUPS. | |
3 | # | |
4 | # Copyright © 2020-2024 by OpenPrinting | |
5 | # Copyright © 2007-2019 by Apple Inc. | |
6 | # Copyright © 1997-2007 by Easy Software Products, all rights reserved. | |
7 | # | |
8 | # Licensed under Apache License v2.0. See the file "LICENSE" for more | |
9 | # information. | |
10 | # | |
11 | ||
12 | include Makedefs | |
13 | ||
14 | ||
15 | # | |
16 | # Directories to make... | |
17 | # | |
18 | ||
19 | DIRS = cups $(BUILDDIRS) | |
20 | ||
21 | ||
22 | # | |
23 | # Test suite options - normally blank, override with make command... | |
24 | # | |
25 | ||
26 | TESTOPTIONS = | |
27 | ||
28 | ||
29 | # | |
30 | # Make all targets... | |
31 | # | |
32 | ||
33 | all: | |
34 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
35 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
36 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
37 | echo Using CC="$(CC)" | |
38 | echo Using CXX="$(CC)" | |
39 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
40 | echo Using LDFLAGS="$(LDFLAGS)" | |
41 | echo Using LIBS="$(LIBS)" | |
42 | for dir in $(DIRS); do\ | |
43 | echo Making all in $$dir... ;\ | |
44 | (cd $$dir ; $(MAKE) $(MFLAGS) all $(UNITTESTS)) || exit 1;\ | |
45 | done | |
46 | ||
47 | ||
48 | # | |
49 | # Make library targets... | |
50 | # | |
51 | ||
52 | libs: | |
53 | echo Using ARCHFLAGS="$(ARCHFLAGS)" | |
54 | echo Using ALL_CFLAGS="$(ALL_CFLAGS)" | |
55 | echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)" | |
56 | echo Using CC="$(CC)" | |
57 | echo Using CXX="$(CC)" | |
58 | echo Using DSOFLAGS="$(DSOFLAGS)" | |
59 | echo Using LDFLAGS="$(LDFLAGS)" | |
60 | echo Using LIBS="$(LIBS)" | |
61 | for dir in $(DIRS); do\ | |
62 | echo Making libraries in $$dir... ;\ | |
63 | (cd $$dir ; $(MAKE) $(MFLAGS) libs) || exit 1;\ | |
64 | done | |
65 | ||
66 | ||
67 | # | |
68 | # Make unit test targets... | |
69 | # | |
70 | ||
71 | unittests: | |
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 | ||
86 | # | |
87 | # Remove object and target files... | |
88 | # | |
89 | ||
90 | clean: | |
91 | for dir in $(DIRS); do\ | |
92 | echo Cleaning in $$dir... ;\ | |
93 | (cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\ | |
94 | done | |
95 | ||
96 | ||
97 | # | |
98 | # Remove all non-distribution files... | |
99 | # | |
100 | ||
101 | distclean: clean | |
102 | $(RM) Makedefs config.h config.log config.status | |
103 | $(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf | |
104 | $(RM) cups.pc | |
105 | $(RM) desktop/cups.desktop | |
106 | $(RM) doc/index.html | |
107 | $(RM) packaging/cups.list | |
108 | $(RM) scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/cups-lpdAT.service scheduler/cups.path scheduler/cups.service scheduler/cups.socket | |
109 | $(RM) templates/header.tmpl | |
110 | -$(RM) doc/*/index.html | |
111 | -$(RM) templates/*/header.tmpl | |
112 | -$(RM) -r autom4te*.cache cups/charmaps cups/locale | |
113 | ||
114 | ||
115 | # | |
116 | # Make dependencies | |
117 | # | |
118 | ||
119 | depend: | |
120 | for dir in $(DIRS); do\ | |
121 | echo Making dependencies in $$dir... ;\ | |
122 | (cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\ | |
123 | done | |
124 | ||
125 | ||
126 | # | |
127 | # Run the STACK tool on the sources, available here: | |
128 | # | |
129 | # http://css.csail.mit.edu/stack/ | |
130 | # | |
131 | # Do the following to pass options to configure: | |
132 | # | |
133 | # make CONFIGFLAGS="--foo --bar" stack | |
134 | # | |
135 | ||
136 | .PHONY: stack | |
137 | stack: | |
138 | stack-build ./configure $(CONFIGFLAGS) | |
139 | stack-build $(MAKE) $(MFLAGS) clean all | |
140 | poptck | |
141 | $(MAKE) $(MFLAGS) distclean | |
142 | $(RM) */*.ll | |
143 | $(RM) */*.ll.out | |
144 | ||
145 | ||
146 | # | |
147 | # Generate a ctags file... | |
148 | # | |
149 | ||
150 | ctags: | |
151 | ctags -R . | |
152 | ||
153 | ||
154 | # | |
155 | # Install everything... | |
156 | # | |
157 | ||
158 | install: install-data install-headers install-libs install-exec | |
159 | ||
160 | ||
161 | # | |
162 | # Install data files... | |
163 | # | |
164 | ||
165 | install-data: | |
166 | echo Making all in cups... | |
167 | (cd cups; $(MAKE) $(MFLAGS) all) | |
168 | for dir in $(DIRS); do\ | |
169 | echo Installing data files in $$dir... ;\ | |
170 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
171 | done | |
172 | echo Installing cups.pc file... | |
173 | $(INSTALL_DIR) -m 755 $(CUPS_PKGCONFPATH) | |
174 | $(INSTALL_DATA) cups.pc $(CUPS_PKGCONFPATH)/cups.pc | |
175 | ||
176 | ||
177 | # | |
178 | # Install header files... | |
179 | # | |
180 | ||
181 | install-headers: | |
182 | for dir in $(DIRS); do\ | |
183 | echo Installing header files in $$dir... ;\ | |
184 | (cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\ | |
185 | done | |
186 | if test "x$(privateinclude)" != x; then \ | |
187 | echo Installing config.h into $(PRIVATEINCLUDE)...; \ | |
188 | $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \ | |
189 | $(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \ | |
190 | fi | |
191 | ||
192 | ||
193 | # | |
194 | # Install programs... | |
195 | # | |
196 | ||
197 | install-exec: all | |
198 | for dir in $(DIRS); do\ | |
199 | echo Installing programs in $$dir... ;\ | |
200 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ | |
201 | done | |
202 | ||
203 | ||
204 | # | |
205 | # Install libraries... | |
206 | # | |
207 | ||
208 | install-libs: libs | |
209 | for dir in $(DIRS); do\ | |
210 | echo Installing libraries in $$dir... ;\ | |
211 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ | |
212 | done | |
213 | -if test -x /usr/sbin/ldconfig; then \ | |
214 | /usr/sbin/ldconfig; \ | |
215 | fi | |
216 | ||
217 | ||
218 | # | |
219 | # Uninstall object and target files... | |
220 | # | |
221 | ||
222 | uninstall: | |
223 | for dir in $(DIRS); do\ | |
224 | echo Uninstalling in $$dir... ;\ | |
225 | (cd $$dir; $(MAKE) $(MFLAGS) uninstall) || exit 1;\ | |
226 | done | |
227 | echo Uninstalling cups.pc file... | |
228 | $(RM) $(CUPS_PKGCONFPATH)/cups.pc | |
229 | -$(RMDIR) $(CUPS_PKGCONFPATH) | |
230 | ||
231 | ||
232 | # | |
233 | # Run the test suite... | |
234 | # | |
235 | ||
236 | testserver: all unittests | |
237 | echo Running CUPS test server... | |
238 | cd test; ./run-stp-tests.sh $(TESTOPTIONS) | |
239 | ||
240 | ||
241 | check test: all unittests | |
242 | cd cups; make test | |
243 | cd scheduler; make test | |
244 | echo Running CUPS test suite... | |
245 | cd test; ./run-stp-tests.sh 1 0 n n | |
246 | ||
247 | debugcheck debugtest: all unittests | |
248 | echo Running CUPS test suite with debug printfs... | |
249 | cd test; ./run-stp-tests.sh 1 0 n y | |
250 | ||
251 | ||
252 | # | |
253 | # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)... | |
254 | # | |
255 | ||
256 | apihelp: | |
257 | for dir in cups filter; do\ | |
258 | echo Generating API help in $$dir... ;\ | |
259 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
260 | done | |
261 | ||
262 | ||
263 | # | |
264 | # Lines of code computation... | |
265 | # | |
266 | ||
267 | sloc: | |
268 | for dir in cups scheduler; do \ | |
269 | (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\ | |
270 | done | |
271 | ||
272 | ||
273 | # | |
274 | # Make software distributions using EPM (http://www.msweet.org/)... | |
275 | # | |
276 | ||
277 | EPMFLAGS = -v --output-dir dist $(EPMARCH) | |
278 | ||
279 | bsd deb epm pkg rpm slackware: | |
280 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list | |
281 | ||
282 | .PHONY: dist | |
283 | dist: all | |
284 | $(RM) -r dist | |
285 | $(MAKE) $(MFLAGS) epm | |
286 | case `uname` in \ | |
287 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
288 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ | |
289 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ | |
290 | esac | |
291 | ||
292 | ||
293 | # | |
294 | # Don't run top-level build targets in parallel... | |
295 | # | |
296 | ||
297 | .NOTPARALLEL: |