1 # Copyright (C) 1991-1999,2000,01,02 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
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.
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
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 # Common rules for making the GNU C library. This file is included
21 # by the top-level Makefile and by all subdirectory makefiles
25 This makefile requires GNU Make.
28 REQUIRED_MAKE_VERSION = 3.74
29 REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
31 ifneq ($(REQUIRED_MAKE_VERSION), \
32 $(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
33 Wrong GNU Make version. See above for the version needed.
41 # If `sources' was defined by the parent makefile, undefine it so
42 # we will later get it from wildcard search in this directory.
43 ifneq "$(findstring env,$(origin sources))" ""
48 PATH := this definition should take precedence over $(oPATH)
49 ifeq ($(PATH),$(oPATH))
50 You must not use the -e flag when building the GNU C library.
55 ifndef +included-Makeconfig
56 include $(..)Makeconfig
59 # `configure' writes a definition of `config-sysdirs' in `config.make'.
60 sysdirs = $(strip $(full_config_sysdirs))
62 +sysdir_pfx = $(common-objpfx)
64 export sysdirs := $(sysdirs)
66 +sysdep_dirs := $(full_config_sysdirs)
68 +sysdep_dirs := $(objdir) $(+sysdep_dirs)
71 # Add -I switches to get the right sysdep directories.
72 # `+includes' in Makeconfig references $(+sysdep-includes).
73 +sysdep-includes := $(addprefix -I,$(+sysdep_dirs))
75 # This variable is used in ``include $(o-iterator)'' after defining
76 # $(o-iterator-doit) to produce some desired rule using $o for the object
77 # suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
78 # is produced for each object suffix in use.
79 o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
81 # Include any system-specific makefiles.
83 # This is here so things in sysdep Makefiles can easily depend on foo.h as
84 # appropriate and not worry about where foo.h comes from, which may be
85 # system dependent and not known by that Makefile.
86 vpath %.h $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
87 $(+sysdep_dirs) $(..)))
89 # The same is true for RPC source files.
90 vpath %.x $(subst $(empty) ,:,$(strip $(common-objpfx) $(objpfx) \
91 $(+sysdep_dirs) $(..)))
93 # Some sysdep makefiles use this to distinguish being included here from
94 # being included individually by a subdir makefile (hurd/Makefile needs this).
97 sysdep-makefiles := $(wildcard $(full_config_sysdirs:=/Makefile))
98 ifneq (,$(sysdep-makefiles))
99 include $(sysdep-makefiles)
103 # Reorder before-compile so that mach things come first, and hurd things
104 # second, before all else. The mach and hurd subdirectories have many
105 # generated header files which the much of rest of the library depends on,
106 # so it is best to build them first (and mach before hurd, at that).
107 before-compile := $(filter $(common-objpfx)mach% $(common-objpfx)hurd%,\
109 $(filter-out $(common-objpfx)mach% $(common-objpfx)hurd%,\
112 # Even before that, we need abi-versions.h which is generated right here.
113 ifeq ($(versioning),yes)
114 ifndef avoid-generated
115 before-compile := $(common-objpfx)abi-versions.h $(before-compile)
116 $(common-objpfx)abi-versions.h: $(..)scripts/abi-versions.awk \
117 $(common-objpfx)Versions.all
118 LC_ALL=C $(AWK) -v oldest_abi=$(oldest-abi) -f $^ > $@T
121 $(common-objpfx)%.latest: $(common-objpfx)abi-versions.h
122 sed -n '/ VERSION_$*_/{s/^.*_\([A-Z0-9_]*\).*$$/\1/;h;};$${g;p;}' \
123 $(common-objpfx)abi-versions.h > $@T
125 endif # avoid-generated
126 endif # $(versioning) = yes
128 # When we have no deps pass doing it, then make sure the subdirectory
129 # for object files gets created.
132 before-compile += $(objpfx).
134 $(make-target-directory)
138 # Remove existing files from `before-compile'. Things are added there when
139 # they must exist for dependency generation to work right, but once they
140 # exist there is no further need for every single file to depend on them,
141 # and those gratuitous dependencies result in many gratuitous
143 before-compile := $(filter-out $(wildcard $(before-compile)),$(before-compile))
145 # Don't let any before-compile file be an intermediate and get removed.
150 # If a makefile needs to do something conditional on something that
151 # can only be figured out from headers, write a FOO.make.c input
152 # file that uses cpp contructs and contains @@@ LINE @@@ for each LINE
153 # to emit in the generated makefile, and use -include $(common-objpfx)FOO.make.
154 $(common-objpfx)%.make: $(..)%.make.c $(..)Makerules
156 (echo '# Generated from $*.make.c by Makerules.'; \
157 SUNPRO_DEPENDENCIES='$@.dT $$(common-objpfx)$*.make' \
158 $(CC) $(CFLAGS) $(CPPFLAGS) -E $< \
159 | sed -n '/@@@/{s/@@@[ ]*\(.*\)@@@/\1/;s/[ ]*$$//p;}'; \
160 echo 'common-generated += $(@F)'; \
161 cat $@.dT; rm -f $@.dT) > $@T
164 # Generate an ordered list of implicit rules which find the source files in
165 # each sysdep directory. The old method was to use vpath to search all the
166 # sysdep directories. However, that had the problem that a .S file in a
167 # later directory would be chosen over a .c file in an earlier directory,
168 # which does not preserve the desired sysdeps ordering behavior.
170 # When making the list of .d files to include, we can't know which ones
171 # have source in .s files, and thus do not in fact need a .d file.
172 # So we must define rules to make .d files for .s files.
173 define make-dummy-dep
174 $(addprefix ln $(common-objpfx)dummy.d ,$(filter-out $(wildcard $@),$@))
176 $(common-objpfx)dummy.d:
177 echo '# .s files cannot contain includes, so they need no deps.' > $@
179 # It matters that this set of rules, for compiling from sources in
180 # the current directory (the $srcdir/$subdir) come before the
181 # generated sysdep rules in included from sysd-rules below. When
182 # compiling in the source tree, generated sources go into the current
183 # directory, and those should be chosen before any sources in sysdeps.
184 define o-iterator-doit
185 $(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
187 object-suffixes-left := $(all-object-suffixes)
188 include $(o-iterator)
189 $(objpfx)%.d: %.S $(before-compile); $(+make-deps)
191 define o-iterator-doit
192 $(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
194 object-suffixes-left := $(all-object-suffixes)
195 include $(o-iterator)
196 $(objpfx)%.d: %.s $(common-objpfx)dummy.d; $(make-dummy-dep)
198 define o-iterator-doit
199 $(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
201 object-suffixes-left := $(all-object-suffixes)
202 include $(o-iterator)
203 $(objpfx)%.d: %.c $(before-compile); $(+make-deps)
205 # Omit the objpfx rules when building in the source tree, because
206 # objpfx is empty and so these rules just override the ones above.
208 # Define first rules to find the source files in $(objpfx).
209 # Generated source files will end up there.
210 define o-iterator-doit
211 $(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
213 object-suffixes-left := $(all-object-suffixes)
214 include $(o-iterator)
215 $(objpfx)%.d: $(objpfx)%.S $(before-compile); $(+make-deps)
217 define o-iterator-doit
218 $(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
220 object-suffixes-left := $(all-object-suffixes)
221 include $(o-iterator)
222 $(objpfx)%.d: $(objpfx)%.s $(common-objpfx)dummy.d; $(make-dummy-dep)
224 define o-iterator-doit
225 $(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
227 object-suffixes-left := $(all-object-suffixes)
228 include $(o-iterator)
229 $(objpfx)%.d: $(objpfx)%.c $(before-compile); $(+make-deps)
232 # System-dependent makefiles can put in `inhibit-sysdep-asm' wildcard
233 # patterns matching sysdep directories whose assembly source files should
235 ifdef inhibit-sysdep-asm
236 define open-check-inhibit-asm
237 case $$sysdir in $(subst $(empty) ,|,$(inhibit-sysdep-asm))) : ;; *)
239 close-check-inhibit-asm = ;; esac ;
242 -include $(+sysdir_pfx)sysd-rules
243 ifneq ($(sysd-rules-sysdirs),$(config-sysdirs))
244 # The value of $(+sysdep_dirs) the sysd-rules was computed for
245 # differs from the one we are using now. So force a rebuild of sysd-rules.
246 sysd-rules-force = FORCE
249 $(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \
250 $(wildcard $(foreach dir,$(sysdirs),\
254 (echo 'sysd-rules-sysdirs := $(config-sysdirs)'; \
255 for dir in $(config-sysdirs:%='$$(..)%'); do \
256 for o in $(all-object-suffixes); do \
257 $(open-check-inhibit-asm) \
258 echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
259 \$$(compile-command.S)"; \
260 echo "\$$(objpfx)%$$o: $$dir/%.s \$$(before-compile); \
261 \$$(compile-command.s)"; \
262 echo "\$$(objpfx)rtld-%$$o: $$dir/%.S \$$(before-compile); \
263 \$$(compile-command.S)"; \
264 echo "\$$(objpfx)rtld-%$$o: $$dir/%.s \$$(before-compile); \
265 \$$(compile-command.s)"; \
266 $(close-check-inhibit-asm) \
267 echo "\$$(objpfx)%$$o: $$dir/%.c \$$(before-compile); \
268 \$$(compile-command.c)"; \
269 echo "\$$(objpfx)rtld-%$$o: $$dir/%.c \$$(before-compile); \
270 \$$(compile-command.c)"; \
272 $(open-check-inhibit-asm) \
273 echo "\$$(objpfx)%.d: $$dir/%.s \$$(common-objpfx)dummy.d; \
274 \$$(make-dummy-dep)"; \
275 echo "\$$(objpfx)rtld-%.d: $$dir/%.s \$$(common-objpfx)dummy.d; \
276 \$$(make-dummy-dep)"; \
277 echo "\$$(objpfx)%.d: $$dir/%.S \$$(before-compile); \
279 echo "\$$(objpfx)rtld-%.d: $$dir/%.S \$$(before-compile); \
281 $(close-check-inhibit-asm) \
282 echo "\$$(objpfx)%.d: $$dir/%.c \$$(before-compile); \
284 echo "\$$(objpfx)rtld-%.d: $$dir/%.c \$$(before-compile); \
286 echo "\$$(objpfx)m_%.S: $$dir/s_%.S; \$$(+make-include-of-dep)"; \
287 echo "\$$(objpfx)m_%.c: $$dir/s_%.c; \$$(+make-include-of-dep)"; \
289 echo 'sysd-rules-done = t') > $@T
292 ifndef sysd-rules-done
293 # Don't do deps until this exists, because it provides rules to make the deps.
297 # This is used by the m_%.[Sc] pattern rules in sysd-rules.
298 define +make-include-of-dep
299 echo '#include <$<>' > $@T
303 # Generate version maps, but wait until sysdep-subdirs is known
304 ifeq ($(sysd-sorted-done),t)
305 ifeq ($(versioning),yes)
306 -include $(common-objpfx)sysd-versions
307 $(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
308 common-generated += $(version-maps)
309 postclean-generated += sysd-versions Versions.all abi-versions.h \
310 Versions.def.v.i Versions.def.v Versions.v.i Versions.v
312 ifndef avoid-generated
313 ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
314 sysd-versions-force = FORCE
317 # See %.v/%.v.i implicit rules in Makeconfig.
318 $(common-objpfx)Versions.def.v.i: $(..)Versions.def \
319 $(wildcard $(add-ons:%=$(..)%/Versions.def))
320 $(common-objpfx)Versions.all: $(..)scripts/firstversions.awk \
321 $(common-objpfx)soversions.i \
322 $(common-objpfx)Versions.def.v
323 { while read lib version setname; do \
324 test -z "$$setname" || echo "$$lib : $$setname"; \
325 done < $(word 2,$^); \
327 } | LC_ALL=C $(AWK) -f $< > $@T
329 # See %.v/%.v.i implicit rules in Makeconfig.
330 $(common-objpfx)Versions.v.i: $(wildcard $(all-subdirs:%=$(..)%/Versions)) \
331 $(wildcard $(sysdirs:%=%/Versions)) \
332 $(common-objpfx)abi-versions.h \
333 $(sysd-versions-force)
334 $(common-objpfx)sysd-versions: $(common-objpfx)Versions.all \
335 $(common-objpfx)Versions.v \
336 $(..)scripts/versions.awk
337 ( echo 'sysd-versions-subdirs = $(all-subdirs) $(config-sysdirs)' ; \
339 | LC_ALL=C $(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
340 -v move_if_change='$(move-if-change)' \
344 endif # avoid-generated
345 endif # $(versioning) = yes
346 endif # sysd-sorted-done
349 ifndef compile-command.S
350 compile-command.S = $(compile.S) $(OUTPUT_OPTION)
352 ifndef compile-command.s
353 compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION)
355 ifndef compile-command.c
356 compile-command.c = $(compile.c) $(OUTPUT_OPTION)
359 # GCC can grok options after the file name, and it looks nicer that way.
360 compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
362 $(CC) $< -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
364 $(CC) -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
365 COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
367 # If we want to generate MD5 checksums for the sources do this now.
369 generate-md5 = ; rm -f $(@:.d=.md5); \
370 $(CC) -E $< $(CFLAGS) $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) | \
371 sed '/^\#/d;/^[[:space:]]*$$/d' | md5sum > $(@:.d=.md5)
376 # We need this for the output to go in the right place. It will default to
377 # empty if make was configured to work with a cc that can't grok -c and -o
378 # together. You can't compile the C library with such a compiler.
379 OUTPUT_OPTION = -o $@
381 # We need the $(CFLAGS) to be in there to have the right predefines during
382 # the dependency run for C sources. But having it for assembly sources can
383 # get the wrong predefines.
384 S-CPPFLAGS = $(asm-CPPFLAGS)
386 $(make-target-directory)
387 $(+mkdep) $< $(if $(filter %.c,$<),$(CFLAGS)) \
388 $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) | sed \
389 -e 's,$(subst .,\.,$*)\.o,$(foreach o,$(all-object-suffixes),$(@:.d=$o)) $@,' \
390 $(sed-remove-objpfx) > $(@:.d=.T)
391 mv -f $(@:.d=.T) $@ $(generate-md5)
394 # Continuation lines here are dangerous because they introduce spaces!
395 define sed-remove-objpfx
396 -e 's@ $(subst .,\.,$(subst @,\@,$(common-objpfx)))@ $$(common-objpfx)@g' \
397 -e 's@^$(subst .,\.,$(subst @,\@,$(common-objpfx)))@$$(common-objpfx)@g'
401 # Modify the list of routines we build for different targets
403 ifeq (yesyes,$(build-shared)$(elf))
404 ifndef libc.so-version
405 # Undefine this because it can't work when we libc.so is unversioned.
406 static-only-routines =
410 # Bounded pointer thunks are only built for *.ob
411 elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
413 elide-routines.oS += $(filter-out $(static-only-routines),\
414 $(routines) $(aux) $(sysdep_routines)) \
416 elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
418 # If we have versioned code we don't need the old versions in any of the
420 elide-routines.o += $(shared-only-routines) $(elide-bp-thunks)
421 elide-routines.op += $(shared-only-routines) $(elide-bp-thunks)
422 elide-routines.og += $(shared-only-routines) $(elide-bp-thunks)
423 elide-routines.ob += $(shared-only-routines)
425 # Shared library building.
427 ifeq (yes,$(build-shared))
429 # Reference map file only when versioning is selected and a map file name
431 ifeq ($(versioning),yes)
432 map-file = $(firstword $($(@F:.so=-map)) \
433 $(addprefix $(common-objpfx), \
434 $(filter $(@F:.so=.map),$(version-maps))))
435 load-map-file = $(map-file:%=-Wl,--version-script=%)
438 # Pattern rule to build a shared object from an archive of PIC objects.
439 # This must come after the installation rules so Make doesn't try to
440 # build shared libraries in place from the installed *_pic.a files.
441 # $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
442 # on other shared objects.
443 lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp)
444 ifneq (,$(findstring aix,$(config-os)))
446 dump -g $< | sed '1,6d' | cut -f2 | sort | uniq) > $(<:a=exp)
451 define build-shlib-helper
452 $(LINK.o) -shared $(static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) $(config-LDFLAGS) \
453 $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
454 $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
455 -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
456 $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
457 -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
460 ifneq (,$(findstring aix,$(config-os)))
461 define build-shlib-helper
462 $(LINK.o) -Wl,-G,-bM:SRE,-bnoentry,-bE:$(<:a=exp) \
463 $(sysdep-LDFLAGS) $(config-LDFLAGS) $(extra-B-$(@F:lib%.so=%).so) \
464 $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
465 $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
466 -L$(subst :, -L,$(rpath-link))
473 # binutils only position loadable notes into the first page for binaries,
474 # not for shared objects
476 $(build-shlib-helper) \
477 -o $@.new $(csu-objpfx)abi-note.o -Wl,--verbose \
478 $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \
479 sed -e '/^=========/,/^=========/!d;/^=========/d' \
480 -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
481 $(LDSEDCMD-$(@F:lib%.so=%).so) > $@.lds
483 $(build-shlib-helper) -o $@ -T $@.lds \
484 $(csu-objpfx)abi-note.o $(build-shlib-objlist)
488 ifneq (,$(findstring aix,$(config-os)))
490 $(build-shlib-helper) \
492 $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \
493 $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so)
496 $(build-shlib-helper) \
497 $(build-shlib-objlist)
502 ifneq (,$(findstring aix,$(config-os)))
503 define build-module-helper
504 $(LINK.o) -Wl,-G -Wl,-bM:SRE -Wl,-bnoentry -Wl,-bexpall \
505 $(sysdep-LDFLAGS) $(config-LDFLAGS) \
507 $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
508 -L$(subst :, -L,$(rpath-link)) -Wl,-L=$(rpath-link)
511 define build-module-helper
512 $(LINK.o) -shared $(static-libgcc) $(sysdep-LDFLAGS) $(config-LDFLAGS) \
513 -B$(csu-objpfx) $(load-map-file) \
514 $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
515 -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
519 # This macro is similar to build-shlib but it does not define a soname
520 # and it does not depend on the destination name to start with `lib'.
522 # binutils only position loadable notes into the first page for binaries,
523 # not for shared objects
525 $(build-module-helper) \
526 -o $@.new $(csu-objpfx)abi-note.o -Wl,--verbose \
527 $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \
528 sed -e '/^=========/,/^=========/!d;/^=========/d' \
529 -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
532 $(build-module-helper) -o $@ -T $@.lds \
533 $(csu-objpfx)abi-note.o $(build-module-objlist)
537 ifneq (,$(findstring aix,$(config-os)))
539 $(build-module-helper) \
541 $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \
542 $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so)
547 $(build-module-helper) \
549 $(build-module-objlist)
554 build-module-helper-objlist = \
555 $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
556 $(filter-out $(map-file) $(+preinit) $(+postinit),$^))
557 whole-archive := -Wl,--whole-archive
559 build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
560 build-shlib-objlist = $(build-module-helper-objlist) \
561 $(LDLIBS-$(@F:lib%.so=%).so)
563 # Don't try to use -lc when making libc.so itself.
564 # Also omits crti.o and crtn.o, which we do not want
565 # since we define our own `.init' section specially.
566 LDFLAGS-c.so = -nostdlib -nostartfiles
567 # But we still want to link libc.so against $(gnulib).
568 LDLIBS-c.so += $(gnulib)
569 # Give libc.so an entry point and make it directly runnable itself.
570 LDFLAGS-c.so += -e __libc_main
571 # Force the backward compatibility EH functions to be linked.
572 LDFLAGS-c.so += -u __register_frame
573 # Pre-link the objects of libc_pic.a so that we can locally resolve
574 # COMMON symbols before we link against ld.so. This is because ld.so
575 # contains some of libc_pic.a already, which will prevent the COMMONs
576 # from being allocated in libc.so, which introduces evil dependencies
577 # between libc.so and ld.so, which can make it impossible to upgrade.
579 $(common-objpfx)libc_pic.os: $(common-objpfx)libc_pic.a
580 $(LINK.o) -nostdlib -nostartfiles -r -o $@ \
581 $(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^
582 LDSEDCMD-c.so = -e 's/^.*\*(\.dynbss).*$$/& __start___libc_freeres_ptrs = .; *(__libc_freeres_ptrs) __stop___libc_freeres_ptrs = .;/'
583 # Use our own special initializer and finalizer files for libc.so.
584 $(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
585 $(common-objpfx)libc_pic.os \
586 $(elfobjdir)/sofini.os \
587 $(elfobjdir)/interp.os $(elfobjdir)/ld.so
589 ifeq ($(versioning),yes)
590 $(common-objpfx)libc.so: $(common-objpfx)libc.map
592 common-generated += libc.so libc_pic.os
593 ifdef libc.so-version
594 $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
596 common-generated += libc.so$(libc.so-version)
600 ifneq (,$(findstring aix,$(config-os)))
601 $(common-objpfx)libc.so: $(common-objpfx)libc_pic.a
604 dump -g $^ | sed '1,6d' | cut -f2 | sort | uniq) > $(^:a=exp)
605 sed '/__mulh/d;/__mull/d;/__divss/d;/__divus/d;/__quoss/d;/__quous/d' \
606 /lib/syscalls.exp > $(common-objpfx)syscalls.exp
607 $(LINK.o) -G -bM:SRE -bnoentry -bE:$(^:a=exp) \
608 -bE:$(common-objpfx)syscalls.exp \
609 -bI:$(common-objpfx)syscalls.exp \
610 -L$(common-objpfx) -o $@ $^
611 # AIX runtime ld wants libc.so to be libc.a(shr.o) hardwired
612 cp $@ $(common-objpfx)shr.o
613 $(AR) $(ARFLAGS) $(common-objpfx)libc.a $(common-objpfx)shr.o
617 # Figure out the source filenames in this directory.
619 override sources := $(addsuffix .c,\
620 $(filter-out $(elided-routines),\
623 sysdep_routines := $(sysdep_routines)
625 headers := $(headers) $(sysdep_headers)
627 # This is the list of all object files, gotten by
628 # replacing every ".c" in `sources' with a ".o".
629 # We also add bounded-pointer thunks, which are later
630 # elided for all suffixes except for `.ob'.
631 override objects := $(addprefix $(objpfx),$(sources:.c=.o) \
632 $(patsubst %,$(bppfx)%.o,\
633 $(filter $(routines) $(sysdep_routines),$(bp-thunks))))
636 # The makefile may define $(extra-libs) with `libfoo libbar'
637 # to build libfoo.a et al from the modules listed in $(libfoo-routines).
639 # extra-lib.mk is included once for each extra lib to define rules
640 # to build it, and to add its objects to the various variables.
641 # During its evaluation, $(lib) is set to the name of the library.
642 extra-libs-left := $(extra-libs)
643 include $(patsubst %,$(..)extra-lib.mk,$(extra-libs))
646 +depfiles := $(sources:.c=.d) \
647 $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
648 $(addsuffix .d,$(tests) $(xtests) $(test-srcs))
649 ifeq ($(build-programs),yes)
650 +depfiles += $(addsuffix .d,$(others) $(sysdep-others))
652 +depfiles := $(addprefix $(objpfx),\
653 $(filter-out $(addsuffix .d,$(omit-deps)),\
658 -include $(+depfiles)
662 # Maximize efficiency by minimizing the number of rules.
663 .SUFFIXES: # Clear the suffix list. We don't use suffix rules.
664 # Don't define any builtin rules.
665 MAKEFLAGS := $(MAKEFLAGS)r
667 # Generic rule for making directories.
669 # mkdir isn't smart enough to strip a trailing /.
672 # Make sure that object files are not removed
673 # when they are intermediates between sources and library members.
674 .PRECIOUS: $(addprefix $(objpfx)%,$(all-object-suffixes))
676 # Make sure that the parent library archive is never removed.
677 .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
679 # Use the verbose option of ar and tar when not running silently.
680 ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s
686 ARFLAGS := r$(verbose)
687 CREATE_ARFLAGS := cru$(verbose)
689 # This makes all the object files in the parent library archive.
691 .PHONY: lib lib-noranlib
692 lib: lib-noranlib $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
693 lib-noranlib: libobjs
695 # For object-suffix $o, the list of objects with that suffix.
696 # Makefiles can define `elide-routines.so = foo' to leave foo.so out.
697 o-objects = $(patsubst %.o,%$o,$(filter-out $(patsubst %,$(objpfx)%.o,\
698 $(elide-routines$o)),\
700 $(addprefix $(objpfx),$(o-objects$o))
702 others: $(addprefix $(objpfx),$(install-lib))
706 # Create the stamp$o files to keep the parent makefile happy.
707 subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
708 $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o):
709 $(make-target-directory)
713 # Define explicit rules to update each $(objpfx)stamp.SUFFIX
714 # timestamp file; these rules (one explicit rule is generated for each
715 # object suffix) write a list of objects to update in the stamp file.
716 # The parent will then actually add them all to the archive in the
717 # archive rule, below.
718 define o-iterator-doit
719 $(objpfx)stamp$o: $(o-objects); $$(do-stamp)
722 echo '$(patsubst $(objpfx)%,$(addsuffix /,$(subdir))%,$^)' > $@T
725 object-suffixes-left := $(object-suffixes-for-libc)
726 include $(o-iterator)
730 # Now define explicit rules to build the library archives; these depend
731 # on the stamp files built above.
732 define o-iterator-doit
733 $(common-objpfx)$(patsubst %,$(libtype$o),c): \
734 $(subdirs-stamp-o) $(common-objpfx)stamp$o; $$(do-makelib)
737 cd $(common-objdir) && \
738 $(AR) $(CREATE_ARFLAGS) $(@F) `cat $(patsubst $(common-objpfx)%,%,$^)`
741 subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%)
742 subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
744 $(subdirs-stamps): subdir_lib;
746 object-suffixes-left = $(object-suffixes-for-libc)
747 include $(o-iterator)
750 # This makes all the object files.
751 .PHONY: objects objs libobjs extra-objs
752 objects objs: libobjs extra-objs
753 libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
754 extra-objs: $(addprefix $(objpfx),$(extra-objs))
756 # Canned sequence for building an extra library archive.
757 define build-extra-lib
758 $(patsubst %/,cd % &&,$(objpfx)) \
759 $(AR) $(CREATE_ARFLAGS) $(@:$(objpfx)%=%) \
760 $(patsubst $(objpfx)%,%,$^)
766 .PHONY: force-install
769 # $(install-lib) are installed from the object directory into $(libdir);
770 # files in $(install-lib) matching `lib%.a' are ranlib'd after installation
771 # unless they also appear in $(non-lib.a). $(install-data) are installed
772 # as they are into $(datadir). $(headers) are installed as they are in
773 # $(includedir). $(install-bin), $(install-bin-script) and $(install-sbin)
774 # are installed from the object directory into $(bindir), $(bindir) and
775 # $(sbindir), respectively. $(install-others) are absolute path names of
776 # files to install; rules to install them are defined elsewhere.
778 # The simple library name to install libc.a under.
779 # This could be defined by a sysdep Makefile.
785 $(make-target-directory)
786 $(INSTALL_DATA) $< $@
789 # Make the target directory if it doesn't exist, using the `mkinstalldirs'
790 # script that does `mkdir -p' even if `mkdir' doesn't support that flag.
791 define make-target-directory
792 $(addprefix $(..)./scripts/mkinstalldirs ,\
793 $(filter-out $(wildcard $(@D:%/=%)),$(@D:%/=%)))
796 # Any directory (parent or subdir) should install libc.a; this way
797 # "make install" in a subdir is guaranteed to install everything it changes.
798 installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
799 $(inst_libdir)/$(patsubst %,$(libtype$o),\
800 $(libprefix)$(libc-name)))
801 install: $(installed-libcs)
802 $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
803 $(make-target-directory)
804 $(INSTALL_DATA) $(common-objpfx)lib$(*:$(libc-name)%=c%) $@
805 # Running ranlib after installing makes the __.SYMDEF time stamp up to
806 # date, which avoids messages from some linkers.
809 define do-install-program
810 $(make-target-directory)
811 $(INSTALL_PROGRAM) $< $@.new
815 define do-install-script
816 $(make-target-directory)
817 $(INSTALL_SCRIPT) $< $@.new
821 install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
822 install-lib := $(filter-out %.so %_pic.a,$(install-lib))
824 ifeq (yes,$(build-shared))
825 # Find which .so's have versions.
826 versioned := $(strip $(foreach so,$(install-lib.so),\
827 $(patsubst %,$(so),$($(so)-version))))
829 install-lib.so-versioned := $(filter $(versioned), $(install-lib.so))
830 install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
832 install-lib-nosubdir: $(install-lib.so-versioned:%=$(inst_libdir)/%) \
833 $(install-lib.so-unversioned:%=$(inst_slibdir)/%)
835 # Install all the unversioned shared libraries.
836 $(install-lib.so-unversioned:%=$(inst_slibdir)/%): $(inst_slibdir)/%.so: \
837 $(objpfx)%.so $(+force)
838 $(do-install-program)
840 ifneq ($(findstring -s,$(LN_S)),)
843 $(SHELL) $(..)scripts/rellns-sh $< $@.new
847 # If we have no symbolic links don't bother with rellns-sh.
855 ifeq (yes,$(build-shared))
856 ifeq (no,$(cross-compiling))
857 symbolic-link-prog := $(common-objpfx)elf/sln
858 symbolic-link-list := $(common-objpfx)elf/symlink.list
859 define make-shlib-link
860 echo $(<F) $@ >> $(symbolic-link-list)
862 else # cross-compiling
863 # We need a definition that can be used by elf/Makefile's install rules.
864 symbolic-link-prog = $(LN_S)
867 ifndef make-shlib-link
868 define make-shlib-link
874 ifdef libc.so-version
875 # For a library specified to be version N, install three files:
876 # libc.so -> libc.so.N (e.g. libc.so.6)
877 # libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so)
879 $(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so \
882 $(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so $(+force)
883 $(do-install-program)
884 install: $(inst_slibdir)/libc.so$(libc.so-version)
887 # What we install as libc.so for programs to link against is in fact a
888 # link script. It contains references for the various libraries we need.
889 # The libc.so object is not complete since some functions are only defined
890 # in libc_nonshared.a.
891 # We need to use absolute paths since otherwise local copies (if they exist)
892 # of the files are taken by the linker.
893 install: $(inst_libdir)/libc.so
894 $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
895 $(inst_libdir)/$(patsubst %,$(libtype.oS),\
896 $(libprefix)$(libc-name)) \
898 (echo '/* GNU ld script';\
899 echo ' Use the shared library, but some functions are only in';\
900 echo ' the static library, so try that secondarily. */';\
901 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
902 '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
910 install: $(inst_slibdir)/libc.so
911 $(inst_slibdir)/libc.so: $(common-objpfx)libc.so $(+force)
912 $(do-install-program)
915 ifneq (,$(versioned))
916 # Produce three sets of rules as above for all the smaller versioned libraries.
918 define o-iterator-doit
919 $(inst_libdir)/$o: $(inst_slibdir)/$o$($o-version) $(+force); $$(make-link)
921 object-suffixes-left := $(versioned)
922 include $(o-iterator)
924 # Make symlinks in the build directory, because the versioned names might
925 # be referenced by a DT_NEEDED in another library.
926 define o-iterator-doit
927 $(objpfx)$o$($o-version): $(objpfx)$o; $$(make-link)
929 object-suffixes-left := $(versioned)
930 include $(o-iterator)
932 generated += $(foreach o,$(versioned),$o$($o-version))
934 ifeq (,$($(subdir)-version))
935 define o-iterator-doit
936 $(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so \
940 object-suffixes-left := $(versioned)
941 include $(o-iterator)
943 define o-iterator-doit
944 $(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o $(+force);
945 $$(do-install-program)
947 object-suffixes-left := $(versioned)
948 include $(o-iterator)
950 define o-iterator-doit
951 $(inst_slibdir)/$o$($o-version): \
952 $(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so $(+force);
955 object-suffixes-left := $(versioned)
956 include $(o-iterator)
958 define o-iterator-doit
959 $(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o $(+force);
960 $$(do-install-program)
962 object-suffixes-left := $(versioned)
963 include $(o-iterator)
968 $(do-install-program)
969 $(patsubst %,ln -s -f $(@F) $(@D)/$(patsubst %$*.so,%,$(<F))$(libprefix)$*.so,\
970 $(filter-out %.so,$@))
973 so-versions := $(sort $(foreach so,$(install-lib.so),.so$($(so)-version)))
974 $(foreach v,$(so-versions),\
975 $(inst_slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so \
978 $(foreach v,$(so-versions),\
979 $(inst_slibdir)/$(libprefix)%$v): $(common-objpfx)%.so $(+force)
984 $(addprefix $(inst_bindir)/,$(install-bin)): \
985 $(inst_bindir)/%: $(objpfx)% $(+force)
986 $(do-install-program)
988 ifdef install-bin-script
989 $(addprefix $(inst_bindir)/,$(install-bin-script)): \
990 $(inst_bindir)/%: $(objpfx)% $(+force)
993 ifdef install-rootsbin
994 $(addprefix $(inst_rootsbindir)/,$(install-rootsbin)): \
995 $(inst_rootsbindir)/%: $(objpfx)% $(+force)
996 $(do-install-program)
999 $(addprefix $(inst_sbindir)/,$(install-sbin)): \
1000 $(inst_sbindir)/%: $(objpfx)% $(+force)
1001 $(do-install-program)
1004 install-lib.a := $(filter lib%.a,$(install-lib))
1005 install-lib-non.a := $(filter-out lib%.a,$(install-lib))
1006 ifdef install-lib-non.a
1007 $(addprefix $(inst_libdir)/$(libprefix),$(install-lib-non.a)): \
1008 $(inst_libdir)/$(libprefix)%: $(objpfx)% $(+force)
1012 $(install-lib.a:lib%.a=$(inst_libdir)/lib$(libprefix)%.a): \
1013 $(inst_libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a $(+force)
1015 $(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
1019 $(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: % $(+force)
1022 headers := $(strip $(headers))
1024 $(addprefix $(inst_includedir)/,$(headers)): $(inst_includedir)/%: % $(+force)
1028 .PHONY: install-bin-nosubdir install-bin-script-nosubdir \
1029 install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
1030 install-data-nosubdir install-headers-nosubdir
1031 install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
1032 install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script))
1033 install-rootsbin-nosubdir: \
1034 $(addprefix $(inst_rootsbindir)/,$(install-rootsbin))
1035 install-sbin-nosubdir: $(addprefix $(inst_sbindir)/,$(install-sbin))
1036 install-lib-nosubdir: $(addprefix $(inst_libdir)/,\
1037 $(patsubst lib%.a,lib$(libprefix)%.a,$(install-lib.a)) \
1038 $(addprefix $(libprefix),$(install-lib-non.a)))
1039 install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
1040 install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
1041 install-others-nosubdir: $(install-others)
1043 # We need all the `-nosubdir' targets so that `install' in the parent
1044 # doesn't depend on several things which each iterate over the subdirs.
1045 # This rule makes `install-FOO' always use `install-FOO-nosubdir' as a
1046 # subroutine. Then in the parent `install-FOO' also causes subdir makes.
1047 install-%:: install-%-nosubdir ;
1049 .PHONY: install install-no-libc.a-nosubdir
1050 ifeq ($(build-programs),yes)
1051 install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
1052 install-bin-nosubdir install-bin-script-nosubdir \
1053 install-lib-nosubdir install-others-nosubdir \
1054 install-rootsbin-nosubdir install-sbin-nosubdir
1056 install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
1057 install-lib-nosubdir install-others-nosubdir
1059 install: install-no-libc.a-nosubdir
1061 # Command to compile $< in $(objdir) using the native libraries.
1062 define native-compile
1063 $(make-target-directory)
1064 $(patsubst %/,cd % &&,$(objpfx)) \
1065 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
1066 $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
1069 # Command to compile $< in $(common-objdir) using the native libraries.
1070 # We must cd to $(objdir) anyway so that $(..)config.h is valid.
1071 define common-objdir-compile
1072 $(patsubst %/,cd % &&,$(objpfx)) \
1073 $(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
1074 $(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(..)$(@F)
1077 # We always want to use configuration definitions.
1078 # Note that this is only used for commands running in $(objpfx).
1079 ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
1081 # Support the GNU standard name for this target.
1084 # Special target to run tests which cannot be run unconditionally.
1085 # Maintainers should use this target.
1089 all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
1090 ifneq (,$(all-nonlib))
1091 cpp-srcs-left = $(all-nonlib:=.c)
1093 include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib))
1096 # The include magic above causes those files to use this variable for flags.
1097 CPPFLAGS-nonlib = -DNOT_IN_libc=1
1100 ifeq ($(versioning),yes)
1101 # Generate normalized lists of symbols, versions, and data sizes.
1102 # This is handy for checking against existing library binaries.
1104 %.symlist: $(..)scripts/abilist.awk %.dynsym
1109 $(OBJDUMP) --dynamic-syms $< > $@T
1112 tests: $(patsubst %.so,$(objpfx)%.symlist,$(install-lib.so-versioned))
1113 generated += $(install-lib.so-versioned:.so=.symlist)
1115 ifeq ($(subdir),elf)
1116 tests: $(common-objpfx)libc.symlist
1117 common-generated += libc.symlist
1122 TAGS: $(objpfx)distinfo $(..)MakeTAGS
1123 $(MAKE) $(addprefix -f ,$^) $@
1125 $(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE
1126 $(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
1130 .PHONY: echo-headers
1135 # Common cleaning targets.
1137 .PHONY: common-mostlyclean common-clean mostlyclean clean do-tests-clean
1139 mostlyclean: common-mostlyclean
1142 -rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) $(xtests) \
1144 $(addsuffix -bp.out,$(tests) $(xtests) \
1147 # Remove the object files.
1149 -rm -f $(addprefix $(objpfx),$(tests) $(xtests) $(test-srcs) \
1150 $(others) $(sysdep-others) stubs \
1151 $(addsuffix .o,$(tests) $(xtests) \
1152 $(test-srcs) $(others) \
1154 $(addsuffix -bp,$(tests) $(xtests) \
1156 $(addsuffix .out,$(tests) $(xtests) \
1158 $(addsuffix -bp.out,$(tests) $(xtests) \
1160 -rm -f $(addprefix $(objpfx),$(extra-objs) $(install-lib) \
1162 $(install-lib.so:%.so=%_pic.a))
1164 -rm -f $(objpfx)rtld-*.os
1167 $(foreach o,$(object-suffixes-for-libc),
1168 -rm -f $(objpfx)stamp$o $(o-objects))
1171 # Also remove the dependencies and generated source files.
1172 common-clean: common-mostlyclean
1173 -rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
1174 -rm -f $(objpfx)rtld-*.d
1175 -rm -fr $(addprefix $(objpfx),$(generated-dirs))
1176 -rm -f $(addprefix $(common-objpfx),$(common-generated))
1177 -rm -f $(objpfx)distinfo
1179 # Produce a file `stubs' which contains `#define __stub_FUNCTION'
1180 # for each function which is a stub. We grovel over all the .d files
1181 # looking for references to <stub-tag.h>. Then we grovel over each
1182 # referenced source file to see what stub function it defines.
1185 .PHONY: stubs # The parent Makefile calls this target.
1186 stubs: $(objpfx)stubs
1188 s = $(sysdep_dir)/generic
1189 $(objpfx)stubs: $(+depfiles)
1190 # Use /dev/null since `...` might expand to empty.
1191 (s=`cd $s && $(PWD_P)`; \
1192 $(patsubst %/,cd % &&,$(objpfx)) \
1193 sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
1194 `sed -n -e '\@ $s/[^ ]*\.c@{; s@^.* $s/\([^ ]*\.c\).*$$@'"$$s"'/\1@; h; }' \
1195 -e '/stub-tag\.h/{; g; p; }' \
1196 $(patsubst $(objpfx)%,%,$^) /dev/null` \
1200 # Make the distribution tar file.
1203 dist: $(objpfx)distinfo $(..)Make-dist
1204 $(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args)
1206 # Avoid depending on source files found in sysdeps dirs,
1207 # because the references affect implicit rule selection.
1208 dist: $(filter-out %.c %.S %.s,$(distribute))
1210 # We used to simply export all these variables, but that frequently made the
1211 # environment get too large. Instead, we write all the information into
1212 # a generated makefile fragment `distinfo', and then include it with -f in
1213 # the sub-make that makes the distribution (above).
1214 $(objpfx)distinfo: Makefile $(..)Makerules \
1215 $(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile))
1216 $(make-target-directory)
1219 .PHONY: subdir_distinfo
1220 subdir_distinfo: $(objpfx)distinfo
1222 define distinfo-vars
1224 echo > $@.new 'subdir := $(subdir)'
1225 $(foreach var,subdir-dirs sources elided-routines sysdep_routines \
1226 headers sysdep_headers distribute dont_distribute generated \
1227 others tests xtests test-srcs extra-libs versioned \
1228 $(extra-libs:%=%-routines) \
1229 $(addprefix install-,lib lib.so data bin bin-script sbin others),
1230 echo >> $@.new '$(subdir)-$(var) := $($(var))'
1231 echo >> $@.new '$(var) = $$($(subdir)-$(var))')
1234 ifneq (,$(strip $(gpl2lgpl)))
1235 ifneq (,$(wildcard $(..)gpl2lgpl.sed))
1236 # Snarf from the master source and frob the copying notice.
1237 $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
1239 # So I don't edit them by mistake.
1242 ifeq ($(with-cvs),yes)
1243 test ! -d CVS || cvs $(CVSOPTS) commit -m'Updated from $^' $@