]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
5a1d7a17 | 2 | # Top-level Makefile for CUPS. |
ef416fc2 | 3 | # |
76b6aade | 4 | # Copyright © 2020-2024 by OpenPrinting |
f294fe22 | 5 | # Copyright © 2007-2019 by Apple Inc. |
171c38f2 | 6 | # Copyright © 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 7 | # |
171c38f2 MS |
8 | # Licensed under Apache License v2.0. See the file "LICENSE" for more |
9 | # information. | |
ef416fc2 | 10 | # |
11 | ||
12 | include Makedefs | |
13 | ||
49d87452 | 14 | |
ef416fc2 | 15 | # |
16 | # Directories to make... | |
17 | # | |
18 | ||
171c38f2 | 19 | DIRS = cups $(BUILDDIRS) |
bd7854cb | 20 | |
ef416fc2 | 21 | |
feb13eea MS |
22 | # |
23 | # Test suite options - normally blank, override with make command... | |
24 | # | |
25 | ||
26 | TESTOPTIONS = | |
27 | ||
28 | ||
ef416fc2 | 29 | # |
30 | # Make all targets... | |
31 | # | |
32 | ||
33 | all: | |
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 | ||
52 | libs: | |
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 | ||
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 | ||
ef416fc2 | 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 | ||
bd7854cb | 96 | |
a9252913 | 97 | # |
98 | # Remove all non-distribution files... | |
99 | # | |
100 | ||
101 | distclean: 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 |
3e573834 | 104 | $(RM) cups.pc |
d95bd167 MS |
105 | $(RM) desktop/cups.desktop |
106 | $(RM) doc/index.html | |
f7deaa1a | 107 | $(RM) packaging/cups.list |
464f5c6c | 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 |
db1f069b | 109 | $(RM) templates/header.tmpl |
a9252913 | 110 | -$(RM) doc/*/index.html |
a9252913 | 111 | -$(RM) templates/*/header.tmpl |
87030afb | 112 | -$(RM) -r autom4te*.cache cups/charmaps cups/locale |
a9252913 | 113 | |
114 | ||
ef416fc2 | 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 | ||
148d3699 MS |
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 | ||
b94498cf | 146 | # |
147 | # Generate a ctags file... | |
148 | # | |
149 | ||
150 | ctags: | |
151 | ctags -R . | |
152 | ||
153 | ||
ef416fc2 | 154 | # |
50fe7201 | 155 | # Install everything... |
ef416fc2 | 156 | # |
157 | ||
50fe7201 MS |
158 | install: install-data install-headers install-libs install-exec |
159 | ||
160 | ||
161 | # | |
162 | # Install data files... | |
163 | # | |
164 | ||
165 | install-data: | |
229681c1 MS |
166 | echo Making all in cups... |
167 | (cd cups; $(MAKE) $(MFLAGS) all) | |
ef416fc2 | 168 | for dir in $(DIRS); do\ |
50fe7201 MS |
169 | echo Installing data files in $$dir... ;\ |
170 | (cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\ | |
ef416fc2 | 171 | done |
3e573834 | 172 | echo Installing cups.pc file... |
173 | $(INSTALL_DIR) -m 755 $(CUPS_PKGCONFPATH) | |
174 | $(INSTALL_DATA) cups.pc $(CUPS_PKGCONFPATH)/cups.pc | |
4d301e69 | 175 | |
ef416fc2 | 176 | |
50fe7201 MS |
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 | |
6bf37cc8 MS |
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 | |
50fe7201 | 191 | |
ef416fc2 | 192 | |
193 | # | |
50fe7201 | 194 | # Install programs... |
ef416fc2 | 195 | # |
196 | ||
c9fc04c6 | 197 | install-exec: all |
50fe7201 MS |
198 | for dir in $(DIRS); do\ |
199 | echo Installing programs in $$dir... ;\ | |
c9fc04c6 | 200 | (cd $$dir; $(MAKE) $(MFLAGS) install-exec) || exit 1;\ |
50fe7201 | 201 | done |
ef416fc2 | 202 | |
50fe7201 MS |
203 | |
204 | # | |
205 | # Install libraries... | |
206 | # | |
207 | ||
c9fc04c6 | 208 | install-libs: libs |
50fe7201 MS |
209 | for dir in $(DIRS); do\ |
210 | echo Installing libraries in $$dir... ;\ | |
c9fc04c6 | 211 | (cd $$dir; $(MAKE) $(MFLAGS) install-libs) || exit 1;\ |
50fe7201 | 212 | done |
a8408a0b | 213 | -if test -x /usr/sbin/ldconfig; then \ |
ac7ddebf MS |
214 | /usr/sbin/ldconfig; \ |
215 | fi | |
ef416fc2 | 216 | |
217 | ||
757d2cad | 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 | |
3e573834 | 227 | echo Uninstalling cups.pc file... |
228 | $(RM) $(CUPS_PKGCONFPATH)/cups.pc | |
229 | -$(RMDIR) $(CUPS_PKGCONFPATH) | |
757d2cad | 230 | |
231 | ||
ef416fc2 | 232 | # |
233 | # Run the test suite... | |
234 | # | |
235 | ||
96ba46eb MS |
236 | testserver: all unittests |
237 | echo Running CUPS test server... | |
feb13eea | 238 | cd test; ./run-stp-tests.sh $(TESTOPTIONS) |
ef416fc2 | 239 | |
240 | ||
96ba46eb | 241 | check test: all unittests |
5b027e64 | 242 | cd cups; make test |
610371ec | 243 | cd scheduler; make test |
96ba46eb | 244 | echo Running CUPS test suite... |
85dda01c MS |
245 | cd test; ./run-stp-tests.sh 1 0 n n |
246 | ||
96ba46eb | 247 | debugcheck debugtest: all unittests |
85dda01c MS |
248 | echo Running CUPS test suite with debug printfs... |
249 | cd test; ./run-stp-tests.sh 1 0 n y | |
d09495fa | 250 | |
251 | ||
f11a948a | 252 | # |
f294fe22 | 253 | # Create HTML documentation using codedoc (http://www.msweet.org/codedoc)... |
f11a948a MS |
254 | # |
255 | ||
256 | apihelp: | |
d825017a | 257 | for dir in cups filter; do\ |
f11a948a MS |
258 | echo Generating API help in $$dir... ;\ |
259 | (cd $$dir; $(MAKE) $(MFLAGS) apihelp) || exit 1;\ | |
260 | done | |
261 | ||
178cb736 | 262 | |
84315f46 MS |
263 | # |
264 | # Lines of code computation... | |
265 | # | |
266 | ||
267 | sloc: | |
a4845881 | 268 | for dir in cups scheduler; do \ |
84315f46 MS |
269 | (cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\ |
270 | done | |
271 | ||
272 | ||
ef416fc2 | 273 | # |
9520743f | 274 | # Make software distributions using EPM (http://www.msweet.org/)... |
ef416fc2 | 275 | # |
276 | ||
d09495fa | 277 | EPMFLAGS = -v --output-dir dist $(EPMARCH) |
ef416fc2 | 278 | |
8072030b | 279 | bsd deb epm pkg rpm slackware: |
4744bd90 | 280 | epm $(EPMFLAGS) -f $@ cups packaging/cups.list |
ef416fc2 | 281 | |
83bf1f7b | 282 | .PHONY: dist |
d09495fa | 283 | dist: all |
284 | $(RM) -r dist | |
285 | $(MAKE) $(MFLAGS) epm | |
286 | case `uname` in \ | |
287 | *BSD*) $(MAKE) $(MFLAGS) bsd;; \ | |
97c9a8d7 | 288 | Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \ |
d09495fa | 289 | SunOS*) $(MAKE) $(MFLAGS) pkg;; \ |
290 | esac | |
ef416fc2 | 291 | |
bd7854cb | 292 | |
ef416fc2 | 293 | # |
31db8ded MS |
294 | # Don't run top-level build targets in parallel... |
295 | # | |
296 | ||
297 | .NOTPARALLEL: |