diff options
author | Mike Frysinger <vapier@gentoo.org> | 2023-12-30 04:34:38 +0300 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2023-12-30 05:14:56 +0300 |
commit | 616db3e80ca4d49c138f2f9db49b3b81b40c4504 (patch) | |
tree | b3571937ac86d17e13ada24dcdd1e8d2650656d0 | |
parent | 6a1b0abc3d243f2524b738b990a85728d54bdbe9 (diff) |
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.
-rw-r--r-- | libgloss/Makefile.am | 6 | ||||
-rw-r--r-- | libgloss/Makefile.in | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am index aa1c430e3..9d6988ace 100644 --- a/libgloss/Makefile.am +++ b/libgloss/Makefile.am @@ -24,7 +24,11 @@ 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))) -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). diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index e6441a4c5..2574c7021 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -913,7 +913,12 @@ 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). |