about summary refs log tree commit diff
path: root/nptl/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-04-12 00:00:30 +0000
committerRoland McGrath <roland@gnu.org>2003-04-12 00:00:30 +0000
commit49916ec40ac31e264d0e5cddf98a39cc40124f00 (patch)
tree2b82d89efb20b9f62998d742a3ec379dccc8a570 /nptl/Makefile
parent4a2939f99712ba0990758f7ab3616fcdc89c756d (diff)
downloadglibc-49916ec40ac31e264d0e5cddf98a39cc40124f00.tar.gz
glibc-49916ec40ac31e264d0e5cddf98a39cc40124f00.tar.xz
glibc-49916ec40ac31e264d0e5cddf98a39cc40124f00.zip
2003-04-11 Roland McGrath <roland@redhat.com>
	* Makefile ($(objpfx)multidir.mk): New target, generated makefile that
	sets variable `multidir'; include that.
	(generated): Add it.
	($(objpfx)$(multidir)/crti.o): New target.
	[$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
Diffstat (limited to 'nptl/Makefile')
-rw-r--r--nptl/Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 0877b2a10e..cd8ad98c38 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -327,7 +327,27 @@ $(objpfx)defs.h: $(objpfx)pt-initfini.s
 $(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
 	$(compile.S) -g0 $(ASFLAGS-.os) -o $@
 
-generated += crti.S defs.h pt-initfini.s $(objpfx)tst-atfork2.mtrace \
+# Set the `multidir' variable by grabbing the variable from the compiler.
+# We do it once and save the result in a generated makefile.
+-include $(objpfx)multidir.mk
+$(objpfx)multidir.mk: $(common-objpfx)config.make
+	dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
+	echo "multidir := $$dir" > $@T
+	mv -f $@T $@
+
+generated += crti.S defs.h pt-initfini.s multidir.mk
+
+extra-objs += crti.o
+omit-deps += crti
+ifneq (,$(filter-out .,$(multidir)))
+generated-dirs := $(firstword $(subst /, , $(multidir)))
+extra-objs += $(multidir)/crti.o
+omit-deps += $(multidir)/crti
+$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/
+	ln -f $< $@
+endif
+
+generated += $(objpfx)tst-atfork2.mtrace \
 	     $(addsuffix .so,$(strip $(modules-names)))
 
 $(objpfx)version.d: $(objpfx)banner.h