aboutsummaryrefslogtreecommitdiff
path: root/libgloss
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-29 20:34:38 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-19 20:20:46 -0500
commit58da25856169ca9e64105079f00f4adaefeca35b (patch)
tree323f205c3af0f4bc497031bce31dffa380cbe8eb /libgloss
parent0714c6305adfb91b6560da03dc871a564450495c (diff)
downloadnewlib-58da25856169ca9e64105079f00f4adaefeca35b.zip
newlib-58da25856169ca9e64105079f00f4adaefeca35b.tar.gz
newlib-58da25856169ca9e64105079f00f4adaefeca35b.tar.bz2
libgloss: add per-file & per-dir flag support
This logic is copied from what's used in newlib today. This allows subdirs to easily define per-directory flags & per-file flags without having to setup unique automake rules for each one.
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/Makefile.am8
-rw-r--r--libgloss/Makefile.in8
2 files changed, 14 insertions, 2 deletions
diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index a035f8d..ccfbfc1 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -24,7 +24,13 @@ includetool_DATA =
includesystooldir = $(tooldir)/include/sys
includesystool_DATA =
-AM_CPPFLAGS = -idirafter $(srcroot)/include
+# These are useful for standalone object files like crt0.o.
+AM_CFLAGS = $(AM_CFLAGS_$(subst /,_,$(@D))) $(AM_CFLAGS_$(subst /,_,$(@D)_$(<F)))
+AM_CCASFLAGS = $(AM_CCASFLAGS_$(subst /,_,$(@D))) $(AM_CCASFLAGS_$(subst /,_,$(@D)_$(<F)))
+AM_CPPFLAGS = $(AM_CPPFLAGS_$(subst /,_,$(@D))) $(AM_CPPFLAGS_$(subst /,_,$(@D)_$(<F)))
+AM_LDFLAGS = $(AM_LDFLAGS_$(subst /,_,$(@D))) $(AM_LDFLAGS_$(subst -,_,$(subst /,_,$(@D)_$(@F))))
+
+AM_CPPFLAGS += -idirafter $(srcroot)/include
# A fake library so automake will generate rules for plain objects that we want
# to install (e.g. our crt0.o objects).
diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in
index eff9887..a085dcd 100644
--- a/libgloss/Makefile.in
+++ b/libgloss/Makefile.in
@@ -995,7 +995,13 @@ includetooldir = $(tooldir)/include
includetool_DATA = $(am__append_16)
includesystooldir = $(tooldir)/include/sys
includesystool_DATA = $(am__append_17)
-AM_CPPFLAGS = -idirafter $(srcroot)/include
+
+# These are useful for standalone object files like crt0.o.
+AM_CFLAGS = $(AM_CFLAGS_$(subst /,_,$(@D))) $(AM_CFLAGS_$(subst /,_,$(@D)_$(<F)))
+AM_CCASFLAGS = $(AM_CCASFLAGS_$(subst /,_,$(@D))) $(AM_CCASFLAGS_$(subst /,_,$(@D)_$(<F)))
+AM_CPPFLAGS = $(AM_CPPFLAGS_$(subst /,_,$(@D))) $(AM_CPPFLAGS_$(subst \
+ /,_,$(@D)_$(<F))) -idirafter $(srcroot)/include
+AM_LDFLAGS = $(AM_LDFLAGS_$(subst /,_,$(@D))) $(AM_LDFLAGS_$(subst -,_,$(subst /,_,$(@D)_$(@F))))
# A fake library so automake will generate rules for plain objects that we want
# to install (e.g. our crt0.o objects).