summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-12-27 14:48:14 +0000
committerJakub Jelinek <jakub@redhat.com>2005-12-27 14:48:14 +0000
commit64cd3e83c9993f3c1a3c24ea3030a22ccf35e12d (patch)
tree8808fad08bb8677b0e0d2158c65096eae5484767 /Makerules
parente3173d2c996d8e30dfe44e9bf530881da6df6aaa (diff)
downloadglibc-64cd3e83c9993f3c1a3c24ea3030a22ccf35e12d.tar.gz
Updated to fedora-glibc-20051227T1426
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules23
1 files changed, 21 insertions, 2 deletions
diff --git a/Makerules b/Makerules
index d0b1d8975d..31939838d3 100644
--- a/Makerules
+++ b/Makerules
@@ -183,6 +183,7 @@ sed-remove-dotdot := -e 's@ *\([^ \/$$][^ \]*\)@ $$(..)\1@g' \
endif
+ifdef gen-as-const-headers
# Generating headers for assembly constants.
# We need this defined early to get into before-compile before
# it's used in sysd-rules, below.
@@ -201,6 +202,16 @@ $(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
mv -f $(@:.h.d=.h)T $(@:.h.d=.h)
vpath %.sym $(sysdirs)
before-compile += $(gen-as-const-headers:%.sym=$(common-objpfx)%.h)
+
+tests += $(gen-as-const-headers:%.sym=test-as-const-%)
+generated += $(gen-as-const-headers:%.sym=test-as-const-%.c)
+$(objpfx)test-as-const-%.c: $(..)scripts/gen-as-const.awk $(..)Makerules \
+ %.sym $(common-objpfx)%.h
+ ($(AWK) '{ sub(/^/, "asconst_", $$2); print; }' $(filter %.h,$^); \
+ $(AWK) -v test=1 -f $< $(filter %.sym,$^); \
+ echo '#include "$(..)test-skeleton.c"') > $@T
+ mv -f $@T $@
+endif
# Generate an ordered list of implicit rules which find the source files in
# each sysdep directory. The old method was to use vpath to search all the
@@ -295,6 +306,12 @@ endef
object-suffixes-left := $(all-object-suffixes)
include $(o-iterator)
+define o-iterator-doit
+$(objpfx)%$o: %.cc $(before-compile); $$(compile-command.cc)
+endef
+object-suffixes-left := $(all-object-suffixes)
+include $(o-iterator)
+
# Omit the objpfx rules when building in the source tree, because
# objpfx is empty and so these rules just override the ones above.
ifdef objpfx
@@ -370,9 +387,11 @@ compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
+compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
# GCC can grok options after the file name, and it looks nicer that way.
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
+compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS)
compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \
$(ASFLAGS) $(ASFLAGS-$(suffix $@))
COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
@@ -1169,9 +1188,9 @@ xcheck: xtests
all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others))
ifneq (,$(all-nonlib))
-cpp-srcs-left = $(all-nonlib:=.c)
+cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc)
lib := nonlib
-include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib))
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
# The include magic above causes those files to use this variable for flags.