aboutsummaryrefslogtreecommitdiff
path: root/extra-lib.mk
diff options
context:
space:
mode:
Diffstat (limited to 'extra-lib.mk')
-rw-r--r--extra-lib.mk16
1 files changed, 7 insertions, 9 deletions
diff --git a/extra-lib.mk b/extra-lib.mk
index d48f0faaa1..5428523e06 100644
--- a/extra-lib.mk
+++ b/extra-lib.mk
@@ -6,7 +6,7 @@
# to be included in that library. A sysdep Makefile can add to
# $(lib)-sysdep_routines to include additional modules.
-override lib := $(firstword $(extra-libs-left))
+lib := $(firstword $(extra-libs-left))
extra-libs-left := $(filter-out $(lib),$(extra-libs-left))
object-suffixes-$(lib) := $(filter-out $($(lib)-inhibit-o),$(object-suffixes))
@@ -79,12 +79,10 @@ endif
endif
-cpp-srcs-left = $(lib)-routines
-ifneq (,$($(lib)-routines))
-cpp-srcs-left = $($(lib)-routines)
-include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-routines))
-endif
-ifneq (,$($(lib)-sysdep_routines))
-cpp-srcs-left = $($(lib)-sysdep_routines)
-include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-sysdep_routines))
+# This will define `libof-ROUTINE := LIB' for each of the routines.
+cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
+ifneq (,$(cpp-srcs-left))
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
+
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1