[U-Boot-Users] [PATCH] Allow per file CFLAGS and AFLAGS

Mimic the linux kernel build system's ability to have per source file CFLAGS or AFLAGS. In the makefile you can now do:
CFLAGS_<file>.o += MY_FLAGS_OPTIONS
Signed-off-by: Kumar Gala galak@kernel.crashing.org --- config.mk | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/config.mk b/config.mk index b08b7a7..1359f7d 100644 --- a/config.mk +++ b/config.mk @@ -237,20 +237,20 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS ifndef REMOTE_BUILD
%.s: %.S - $(CPP) $(AFLAGS) -o $@ $< + $(CPP) $(AFLAGS) $(AFLAGS_$@) -o $@ $< %.o: %.S - $(CC) $(AFLAGS) -c -o $@ $< + $(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $@ $< %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(CFLAGS_$@) -c -o $@ $<
else
$(obj)%.s: %.S - $(CPP) $(AFLAGS) -o $@ $< + $(CPP) $(AFLAGS) $(AFLAGS_$@) -o $@ $< $(obj)%.o: %.S - $(CC) $(AFLAGS) -c -o $@ $< + $(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $@ $< $(obj)%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(CFLAGS_$@) -c -o $@ $< endif
#########################################################################

In message Pine.LNX.4.64.0805291257420.31402@blarg.am.freescale.net you wrote:
Mimic the linux kernel build system's ability to have per source file CFLAGS or AFLAGS. In the makefile you can now do:
CFLAGS_<file>.o += MY_FLAGS_OPTIONS
Signed-off-by: Kumar Gala galak@kernel.crashing.org
I'm not sure why this would be needed. I tend to think that using a homogenuous set of compiler flags for all source fines is a good thing. If single source files need different handling,we should rather think why this is the case and probably fix the cause instead of doctoring with the symptoms or finally giving in and twek compiler options until we don't see the warnings / errors any more.
Best regards,
Wolfgang Denk
participants (2)
-
Kumar Gala
-
Wolfgang Denk