]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | # Copyright (C) 1991-2019 Free Software Foundation, Inc. |
28f540f4 RM |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
28f540f4 RM |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
28f540f4 RM |
17 | |
18 | # | |
19 | # Master Makefile for the GNU C library | |
20 | # | |
21 | ifneq (,) | |
22 | This makefile requires GNU Make. | |
23 | endif | |
24 | ||
aa802e96 UD |
25 | include Makeconfig |
26 | ||
28f540f4 RM |
27 | |
28 | # This is the default target; it makes everything except the tests. | |
29 | .PHONY: all | |
edf5b2d7 | 30 | all: lib others |
28f540f4 | 31 | \f |
1400de2e RM |
32 | ifneq ($(AUTOCONF),no) |
33 | ||
4d06461a UD |
34 | define autoconf-it |
35 | @-rm -f $@.new | |
1400de2e | 36 | $(AUTOCONF) $(ACFLAGS) $< > $@.new |
7967983f | 37 | chmod a-w$(patsubst %,$(comma)a+x,$(filter .,$(@D))) $@.new |
4d06461a UD |
38 | mv -f $@.new $@ |
39 | endef | |
c8d32817 | 40 | |
cb8a6dbd MF |
41 | configure: configure.ac aclocal.m4; $(autoconf-it) |
42 | %/configure: %/configure.ac aclocal.m4; $(autoconf-it) | |
43 | %/preconfigure: %/preconfigure.ac aclocal.m4; $(autoconf-it) | |
28f540f4 | 44 | |
1400de2e RM |
45 | endif # $(AUTOCONF) = no |
46 | ||
47 | ||
48 | # We don't want to run anything here in parallel. | |
49 | .NOTPARALLEL: | |
50 | ||
28f540f4 | 51 | # These are the targets that are made by making them in each subdirectory. |
edf5b2d7 UD |
52 | +subdir_targets := subdir_lib objects objs others subdir_mostlyclean \ |
53 | subdir_clean subdir_distclean subdir_realclean \ | |
dd7b064c | 54 | tests xtests \ |
7b57bfe5 | 55 | subdir_update-abi subdir_check-abi \ |
c100dca3 | 56 | subdir_update-all-abi \ |
7b57bfe5 | 57 | subdir_echo-headers \ |
57ba7bb4 | 58 | subdir_install \ |
5d9e8991 | 59 | subdir_objs subdir_stubs subdir_testclean \ |
57ba7bb4 | 60 | $(addprefix install-, no-libc.a bin lib data headers others) |
28f540f4 | 61 | \f |
625cd00f | 62 | headers := limits.h values.h features.h gnu-versions.h \ |
48789000 JM |
63 | bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \ |
64 | bits/libc-header-start.h | |
28f540f4 RM |
65 | |
66 | echo-headers: subdir_echo-headers | |
67 | ||
762a2918 UD |
68 | # The headers are in the include directory. |
69 | subdir-dirs = include | |
70 | vpath %.h $(subdir-dirs) | |
71 | ||
28f540f4 | 72 | # What to install. |
8d57beea | 73 | install-others = $(inst_includedir)/gnu/stubs.h |
fe54a69c | 74 | install-bin-script = |
56552e42 | 75 | |
a18f587d | 76 | ifeq (yes,$(build-shared)) |
6736e93b | 77 | headers += gnu/lib-names.h |
a18f587d | 78 | endif |
28f540f4 | 79 | |
28f540f4 RM |
80 | include Makerules |
81 | ||
737547be | 82 | ifeq ($(build-programs),yes) |
6c3ebebd | 83 | others: $(addprefix $(objpfx),$(install-bin-script)) |
737547be UD |
84 | endif |
85 | ||
28f540f4 RM |
86 | # Install from subdirectories too. |
87 | install: subdir_install | |
8d57beea | 88 | |
6736e93b UD |
89 | # Explicit dependency so that `make install-headers' works |
90 | install-headers: install-headers-nosubdir | |
91 | ||
5148d49f UD |
92 | # Make sure that the dynamic linker is installed before libc. |
93 | $(inst_slibdir)/libc-$(version).so: elf/ldso_install | |
94 | ||
95 | .PHONY: elf/ldso_install | |
96 | elf/ldso_install: | |
97 | $(MAKE) -C $(@D) $(@F) | |
98 | ||
b43b13ac | 99 | # Create links for shared libraries using the `ldconfig' program if possible. |
7cc27f44 | 100 | # Ignore the error if we cannot update /etc/ld.so.cache. |
1ef32c3d UD |
101 | ifeq (no,$(cross-compiling)) |
102 | ifeq (yes,$(build-shared)) | |
409dfcea UD |
103 | install: install-symbolic-link |
104 | .PHONY: install-symbolic-link | |
105 | install-symbolic-link: subdir_install | |
9d141cae | 106 | $(symbolic-link-prog) $(symbolic-link-list) |
7ef90c15 | 107 | rm -f $(symbolic-link-list) |
9d141cae | 108 | |
8d57beea | 109 | install: |
686554bf | 110 | -test ! -x $(elf-objpfx)ldconfig || LC_ALL=C \ |
4134b50d JM |
111 | $(elf-objpfx)ldconfig $(addprefix -r ,$(install_root)) \ |
112 | $(slibdir) $(libdir) | |
cc3fa755 UD |
113 | ifneq (no,$(PERL)) |
114 | ifeq (/usr,$(prefix)) | |
115 | ifeq (,$(install_root)) | |
d22e28b0 | 116 | LD_SO=$(ld.so-version) CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx) |
cc3fa755 UD |
117 | endif |
118 | endif | |
119 | endif | |
1ef32c3d UD |
120 | endif |
121 | endif | |
28f540f4 | 122 | |
01a36ad3 RM |
123 | # Build subdirectory lib objects. |
124 | lib-noranlib: subdir_lib | |
28f540f4 | 125 | |
01a36ad3 RM |
126 | ifeq (yes,$(build-shared)) |
127 | # Build the shared object from the PIC object library. | |
5f855e35 | 128 | lib: $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so |
bd81123a | 129 | endif # $(build-shared) |
9bfce4bf | 130 | |
f2873d2d FW |
131 | # Used to build testrun.sh. |
132 | define testrun-script | |
133 | #!/bin/bash | |
134 | builddir=`dirname "$$0"` | |
135 | GCONV_PATH="$${builddir}/iconvdata" | |
136 | ||
137 | usage () { | |
138 | echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1 | |
139 | echo " $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1 | |
140 | } | |
141 | ||
142 | toolname=default | |
143 | while test $$# -gt 0 ; do | |
144 | case "$$1" in | |
145 | --tool=*) | |
146 | toolname="$${1:7}" | |
147 | shift | |
148 | ;; | |
149 | --*) | |
150 | usage | |
151 | ;; | |
152 | *) | |
153 | break | |
154 | ;; | |
155 | esac | |
156 | done | |
157 | ||
158 | if test $$# -eq 0 ; then | |
159 | usage | |
160 | fi | |
161 | ||
162 | case "$$toolname" in | |
163 | default) | |
164 | exec $(subst $(common-objdir),"$${builddir}", $(test-program-prefix)) \ | |
165 | $${1+"$$@"} | |
166 | ;; | |
167 | strace) | |
168 | exec strace $(patsubst %, -E%, $(run-program-env)) \ | |
169 | $(test-via-rtld-prefix) $${1+"$$@"} | |
170 | ;; | |
171 | valgrind) | |
172 | exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"} | |
173 | ;; | |
174 | *) | |
175 | usage | |
176 | ;; | |
177 | esac | |
178 | endef | |
9bfce4bf RM |
179 | |
180 | # This is a handy script for running any dynamically linked program against | |
181 | # the current libc build for testing. | |
182 | $(common-objpfx)testrun.sh: $(common-objpfx)config.make \ | |
183 | $(..)Makeconfig $(..)Makefile | |
46341286 | 184 | $(file >$@T,$(testrun-script)) |
9bfce4bf RM |
185 | chmod a+x $@T |
186 | mv -f $@T $@ | |
187 | postclean-generated += testrun.sh | |
188 | ||
189 | others: $(common-objpfx)testrun.sh | |
28f540f4 | 190 | \f |
97a47867 UD |
191 | # Makerules creates a file `stubs' in each subdirectory, which |
192 | # contains `#define __stub_FUNCTION' for each function defined in that | |
193 | # directory which is a stub. | |
6bc31da0 | 194 | # Here we paste all of these together into <gnu/stubs.h>. |
28f540f4 | 195 | |
97a47867 | 196 | subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) |
28f540f4 | 197 | |
0ab0291b | 198 | ifndef abi-variants |
3e1e123d RM |
199 | installed-stubs = $(inst_includedir)/gnu/stubs.h |
200 | else | |
0ab0291b | 201 | installed-stubs = $(inst_includedir)/gnu/stubs-$(default-abi).h |
3e1e123d | 202 | |
691bc9c1 | 203 | $(inst_includedir)/gnu/stubs.h: $(+force) |
f0cf0902 | 204 | $(make-target-directory) |
0ab0291b L |
205 | { \ |
206 | echo '/* This file is automatically generated.';\ | |
207 | echo " This file selects the right generated file of \`__stub_FUNCTION' macros";\ | |
208 | echo ' based on the architecture being compiled for. */'; \ | |
209 | echo ''; \ | |
210 | $(foreach h,$(abi-includes), echo '#include <$(h)>';) \ | |
211 | echo ''; \ | |
212 | $(foreach v,$(abi-variants),\ | |
213 | $(if $(abi-$(v)-condition),\ | |
214 | echo '#if $(abi-$(v)-condition)'; \ | |
215 | echo '# include <gnu/stubs-$(v).h>'); \ | |
216 | $(if $(abi-$(v)-condition),echo '#endif';) \ | |
217 | rm -f $(@:.d=.h).new$(v); \ | |
218 | ) \ | |
219 | } > $(@:.d=.h).new | |
220 | mv -f $(@:.d=.h).new $(@:.d=.h) | |
3e1e123d RM |
221 | |
222 | install-others-nosubdir: $(installed-stubs) | |
223 | endif | |
224 | ||
225 | ||
28f540f4 RM |
226 | # Since stubs.h is never needed when building the library, we simplify the |
227 | # hairy installation process by producing it in place only as the last part | |
b9b49b44 UD |
228 | # of the top-level `make install'. It depends on subdir_install, which |
229 | # iterates over all the subdirs; subdir_install in each subdir depends on | |
230 | # the subdir's stubs file. Having more direct dependencies would result in | |
231 | # extra iterations over the list for subdirs and many recursive makes. | |
3e1e123d | 232 | $(installed-stubs): include/stubs-prologue.h subdir_install |
5107cf1d | 233 | $(make-target-directory) |
28f540f4 | 234 | @rm -f $(objpfx)stubs.h |
d62507dd | 235 | (sed '/^@/d' $<; LC_ALL=C sort $(subdir-stubs)) > $(objpfx)stubs.h |
13a0be88 | 236 | if test -r $@ && cmp -s $(objpfx)stubs.h $@; \ |
ba1ffaa1 | 237 | then echo 'stubs.h unchanged'; \ |
d36e7692 | 238 | else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi |
28f540f4 RM |
239 | rm -f $(objpfx)stubs.h |
240 | \f | |
241 | # This makes the Info or DVI file of the documentation from the Texinfo source. | |
fef0b717 UD |
242 | .PHONY: info dvi pdf html |
243 | info dvi pdf html: | |
c0e45674 | 244 | $(MAKE) $(PARALLELMFLAGS) -C manual $@ |
28f540f4 RM |
245 | \f |
246 | # This makes all the subdirectory targets. | |
247 | ||
248 | # For each target, make it depend on DIR/target for each subdirectory DIR. | |
249 | $(+subdir_targets): %: $(addsuffix /%,$(subdirs)) | |
250 | ||
251 | # Compute a list of all those targets. | |
252 | all-subdirs-targets := $(foreach dir,$(subdirs),\ | |
253 | $(addprefix $(dir)/,$(+subdir_targets))) | |
254 | ||
255 | # The action for each of those is to cd into the directory and make the | |
256 | # target there. | |
257 | $(all-subdirs-targets): | |
e0a3ed4f RM |
258 | $(MAKE) $(PARALLELMFLAGS) $(subdir-target-args) $(@F) |
259 | ||
260 | define subdir-target-args | |
261 | subdir=$(@D)$(if $($(@D)-srcdir),\ | |
262 | -C $($(@D)-srcdir) ..=`pwd`/,\ | |
263 | -C $(@D) ..=../) | |
264 | endef | |
28f540f4 RM |
265 | |
266 | .PHONY: $(+subdir_targets) $(all-subdirs-targets) | |
267 | \f | |
268 | # Targets to clean things up to various degrees. | |
269 | ||
3c5edd4d UD |
270 | .PHONY: clean realclean distclean distclean-1 parent-clean parent-mostlyclean \ |
271 | tests-clean | |
28f540f4 RM |
272 | |
273 | # Subroutines of all cleaning targets. | |
274 | parent-mostlyclean: common-mostlyclean # common-mostlyclean is in Makerules. | |
4ddde9ee | 275 | -rm -f $(foreach o,$(object-suffixes-for-libc),\ |
60092701 RM |
276 | $(common-objpfx)$(patsubst %,$(libtype$o),c)) \ |
277 | $(addprefix $(objpfx),$(install-lib)) | |
28f540f4 | 278 | parent-clean: parent-mostlyclean common-clean |
da2d1bc5 UD |
279 | |
280 | postclean = $(addprefix $(common-objpfx),$(postclean-generated)) \ | |
4ae73ca0 | 281 | $(addprefix $(objpfx),sysd-dirs sysd-rules) \ |
4fcddf8e | 282 | $(addprefix $(objpfx),sysd-sorted soversions.mk soversions.i) |
28f540f4 RM |
283 | |
284 | clean: parent-clean | |
285 | # This is done this way rather than having `subdir_clean' be a | |
286 | # dependency of this target so that libc.a will be removed before the | |
287 | # subdirectories are dealt with and so they won't try to remove object | |
288 | # files from it when it's going to be removed anyway. | |
289 | @$(MAKE) subdir_clean no_deps=t | |
b5c69d99 | 290 | -rm -f $(postclean) |
28f540f4 RM |
291 | mostlyclean: parent-mostlyclean |
292 | @$(MAKE) subdir_mostlyclean no_deps=t | |
da2d1bc5 | 293 | -rm -f $(postclean) |
28f540f4 | 294 | |
3c5edd4d UD |
295 | tests-clean: |
296 | @$(MAKE) subdir_testclean no_deps=t | |
297 | ||
00db8bf4 | 298 | ifneq (,$(CXX)) |
bd29910a JM |
299 | vpath c++-types.data $(+sysdep_dirs) |
300 | ||
684ce7e0 | 301 | tests-special += $(objpfx)c++-types-check.out |
bd29910a | 302 | $(objpfx)c++-types-check.out: c++-types.data scripts/check-c++-types.sh |
783dd2d3 | 303 | scripts/check-c++-types.sh $< $(CXX) $(filter-out -std=gnu11 $(+gccwarn-c),$(CFLAGS)) $(CPPFLAGS) > $@; \ |
f0881698 | 304 | $(evaluate-test) |
2750c39c | 305 | endif |
806e4a4a | 306 | |
1241b50b | 307 | tests-special += $(objpfx)check-local-headers.out |
16feadf2 | 308 | $(objpfx)check-local-headers.out: scripts/check-local-headers.sh |
ea5ee9f7 | 309 | AWK='$(AWK)' scripts/check-local-headers.sh \ |
3b2cc56d | 310 | "$(includedir)" "$(objpfx)" < /dev/null > $@; \ |
f0881698 | 311 | $(evaluate-test) |
16feadf2 | 312 | |
47755784 ZW |
313 | ifneq "$(headers)" "" |
314 | # Special test of all the installed headers in this directory. | |
315 | tests-special += $(objpfx)check-installed-headers-c.out | |
7c3018f9 | 316 | libof-check-installed-headers-c := testsuite |
47755784 ZW |
317 | $(objpfx)check-installed-headers-c.out: \ |
318 | scripts/check-installed-headers.sh $(headers) | |
319 | $(SHELL) $(..)scripts/check-installed-headers.sh c \ | |
320 | "$(CC) $(filter-out -std=%,$(CFLAGS)) -D_ISOMAC $(+includes)" \ | |
321 | $(headers) > $@; \ | |
322 | $(evaluate-test) | |
323 | ||
324 | ifneq "$(CXX)" "" | |
325 | tests-special += $(objpfx)check-installed-headers-cxx.out | |
7c3018f9 | 326 | libof-check-installed-headers-cxx := testsuite |
47755784 ZW |
327 | $(objpfx)check-installed-headers-cxx.out: \ |
328 | scripts/check-installed-headers.sh $(headers) | |
329 | $(SHELL) $(..)scripts/check-installed-headers.sh c++ \ | |
330 | "$(CXX) $(filter-out -std=%,$(CXXFLAGS)) -D_ISOMAC $(+includes)" \ | |
331 | $(headers) > $@; \ | |
332 | $(evaluate-test) | |
333 | endif | |
334 | endif | |
335 | ||
44a6213c RM |
336 | define summarize-tests |
337 | @egrep -v '^(PASS|XFAIL):' $(objpfx)$1 || true | |
338 | @echo "Summary of test results$2:" | |
339 | @sed 's/:.*//' < $(objpfx)$1 | sort | uniq -c | |
99db95db | 340 | @! egrep -q -v '^(X?PASS|XFAIL|UNSUPPORTED):' $(objpfx)$1 |
44a6213c RM |
341 | endef |
342 | ||
561b0bec DD |
343 | # The intention here is to do ONE install of our build into the |
344 | # testroot.pristine/ directory, then rsync (internal to | |
345 | # support/test-container) that to testroot.root/ at the start of each | |
346 | # test. That way we can promise each test a "clean" install, without | |
347 | # having to do the install for each test. | |
348 | # | |
349 | # In addition, we have to copy some files (which we build) into this | |
350 | # root in addition to what glibc installs. For example, many tests | |
351 | # require additional programs including /bin/sh, /bin/true, and | |
352 | # /bin/echo, all of which we build below to limit library dependencies | |
353 | # to just those things in glibc and language support libraries which | |
354 | # we also copy into the into the rootfs. To determine what language | |
355 | # support libraries we need we build a "test" program in either C or | |
356 | # (if available) C++ just so we can copy in any shared objects | |
357 | # (which we do not build) that GCC-compiled programs depend on. | |
358 | ||
359 | ||
360 | ifeq (,$(CXX)) | |
361 | LINKS_DSO_PROGRAM = links-dso-program-c | |
362 | else | |
363 | LINKS_DSO_PROGRAM = links-dso-program | |
364 | endif | |
365 | ||
366 | $(tests-container) $(addsuffix /tests,$(subdirs)) : \ | |
367 | $(objpfx)testroot.pristine/install.stamp | |
368 | $(objpfx)testroot.pristine/install.stamp : | |
369 | test -d $(objpfx)testroot.pristine || \ | |
370 | mkdir $(objpfx)testroot.pristine | |
371 | # We need a working /bin/sh for some of the tests. | |
372 | test -d $(objpfx)testroot.pristine/bin || \ | |
373 | mkdir $(objpfx)testroot.pristine/bin | |
374 | cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/bin/sh | |
375 | cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/bin/echo | |
376 | cp $(objpfx)support/true-container $(objpfx)testroot.pristine/bin/true | |
bd598da9 | 377 | ifeq ($(run-built-tests),yes) |
561b0bec DD |
378 | # Copy these DSOs first so we can overwrite them with our own. |
379 | for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ | |
380 | $(objpfx)elf/$(rtld-installed-name) \ | |
381 | $(objpfx)testroot.pristine/bin/sh \ | |
382 | | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ | |
383 | do \ | |
384 | test -d `dirname $(objpfx)testroot.pristine$$dso` || \ | |
385 | mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\ | |
386 | $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\ | |
387 | done | |
388 | for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 \ | |
389 | $(objpfx)elf/$(rtld-installed-name) \ | |
390 | $(objpfx)support/$(LINKS_DSO_PROGRAM) \ | |
391 | | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\ | |
392 | do \ | |
393 | test -d `dirname $(objpfx)testroot.pristine$$dso` || \ | |
394 | mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\ | |
395 | $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\ | |
396 | done | |
bd598da9 | 397 | endif |
edceb7f5 TMQMF |
398 | $(MAKE) install DESTDIR=$(objpfx)testroot.pristine \ |
399 | subdirs='$(all-subdirs)' | |
561b0bec DD |
400 | touch $(objpfx)testroot.pristine/install.stamp |
401 | ||
265d52ab | 402 | tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special)) |
f214606a | 403 | tests: $(tests-special) |
265d52ab JM |
404 | $(..)scripts/merge-test-results.sh -s $(objpfx) "" \ |
405 | $(sort $(tests-special-notdir:.out=)) \ | |
406 | > $(objpfx)subdir-tests.sum | |
407 | $(..)scripts/merge-test-results.sh -t $(objpfx) subdir-tests.sum \ | |
408 | $(sort $(subdirs) .) \ | |
409 | > $(objpfx)tests.sum | |
44a6213c | 410 | $(call summarize-tests,tests.sum) |
265d52ab JM |
411 | xtests: |
412 | $(..)scripts/merge-test-results.sh -t $(objpfx) subdir-xtests.sum \ | |
413 | $(sort $(subdirs)) \ | |
414 | > $(objpfx)xtests.sum | |
44a6213c | 415 | $(call summarize-tests,xtests.sum, for extra tests) |
f214606a | 416 | |
28f540f4 RM |
417 | # The realclean target is just like distclean for the parent, but we want |
418 | # the subdirs to know the difference in case they care. | |
419 | realclean distclean: parent-clean | |
420 | # This is done this way rather than having `subdir_distclean' be a | |
421 | # dependency of this target so that libc.a will be removed before the | |
422 | # subdirectories are dealt with and so they won't try to remove object | |
423 | # files from it when it's going to be removed anyway. | |
da2d1bc5 UD |
424 | @$(MAKE) distclean-1 no_deps=t distclean-1=$@ avoid-generated=yes \ |
425 | sysdep-subdirs="$(sysdep-subdirs)" | |
426 | -rm -f $(postclean) | |
28f540f4 RM |
427 | |
428 | # Subroutine of distclean and realclean. | |
429 | distclean-1: subdir_$(distclean-1) | |
430 | -rm -f $(config-generated) | |
60092701 RM |
431 | -rm -f $(addprefix $(objpfx),config.status config.cache config.log) |
432 | -rm -f $(addprefix $(objpfx),config.make config-name.h config.h) | |
28f540f4 RM |
433 | ifdef objdir |
434 | -rm -f $(objpfx)Makefile | |
435 | endif | |
436 | -rm -f $(sysdep-$(distclean-1)) | |
437 | \f | |
9de06f3c RM |
438 | # Make the TAGS file for Emacs users. |
439 | ||
440 | .PHONY: TAGS | |
441 | TAGS: | |
77c84aeb | 442 | scripts/list-sources.sh | sed -n -e '/Makefile/p' \ |
9de06f3c | 443 | $(foreach S,[chsSyl] cxx sh bash pl,\ |
77c84aeb | 444 | $(subst .,\.,-e '/.$S\(.in\)*$$/p')) \ |
9de06f3c RM |
445 | | $(ETAGS) -o $@ - |
446 | \f | |
28f540f4 | 447 | # Make the distribution tarfile. |
6cfe8609 | 448 | .PHONY: dist dist-prepare |
28f540f4 | 449 | |
c7562c74 | 450 | generated := $(generated) stubs.h |
28f540f4 | 451 | |
7ac30cc5 | 452 | files-for-dist := README INSTALL configure ChangeLog NEWS |
6cfe8609 RM |
453 | |
454 | # Regenerate stuff, then error if these things are not committed yet. | |
455 | dist-prepare: $(files-for-dist) | |
644d3857 | 456 | conf=`find sysdeps -name configure`; \ |
6cfe8609 RM |
457 | $(MAKE) $$conf && \ |
458 | git diff --stat HEAD -- $^ $$conf \ | |
459 | | $(AWK) '{ print; rc=1 } END { exit rc }' | |
460 | ||
461 | %.tar: FORCE | |
462 | git archive --prefix=$*/ $* > $@.new | |
463 | mv -f $@.new $@ | |
62780824 | 464 | |
7c0cf356 | 465 | # Do `make dist dist-version=X.Y.Z' to make tar files of an older version. |
7c0cf356 | 466 | |
6cfe8609 RM |
467 | ifneq (,$(strip $(dist-version))) |
468 | dist: $(foreach Z,.bz2 .gz .xz,$(dist-version).tar$Z) | |
62780824 | 469 | md5sum $^ |
6cfe8609 RM |
470 | else |
471 | dist: dist-prepare | |
472 | @if v=`git describe`; then \ | |
473 | echo Distribution version $$v; \ | |
474 | $(MAKE) dist dist-version=$$v; \ | |
475 | else \ | |
476 | false; \ | |
477 | fi | |
478 | endif | |
62780824 | 479 | |
d136c6dc SP |
480 | INSTALL: manual/install-plain.texi manual/macros.texi \ |
481 | $(common-objpfx)manual/pkgvers.texi manual/install.texi | |
4e87147f | 482 | makeinfo --no-validate --plaintext --no-number-sections \ |
b31469d0 JM |
483 | -I$(common-objpfx)manual $< -o $@-tmp |
484 | $(AWK) 'NF == 0 { ++n; next } \ | |
485 | NF != 0 { while (n-- > 0) print ""; n = 0; print }' \ | |
486 | < $@-tmp > $@-tmp2 | |
487 | rm -f $@-tmp | |
488 | -chmod a-w $@-tmp2 | |
489 | mv -f $@-tmp2 $@ | |
8b748aed JM |
490 | $(common-objpfx)manual/%: FORCE |
491 | $(MAKE) $(PARALLELMFLAGS) -C manual $@ | |
f671aeab | 492 | FORCE: |
6a441471 | 493 | |
8b748aed | 494 | iconvdata/% localedata/% po/%: FORCE |
f4017d20 | 495 | $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) |