public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libgloss: add per-file & per-dir flag support
@ 2023-12-30  1:56 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2023-12-30  1:56 UTC (permalink / raw)
  To: newlib

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.
---
 libgloss/Makefile.am | 6 +++++-
 libgloss/Makefile.in | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index f74f515adba2..982b9e77e712 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).
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-30  1:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-30  1:56 [PATCH] libgloss: add per-file & per-dir flag support Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).