[U-Boot-Users] [PATCH] Allow per file CFLAGS and AFLAGS
    Kumar Gala 
    galak at kernel.crashing.org
       
    Thu May 29 19:57:54 CEST 2008
    
    
  
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 at 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
 #########################################################################
-- 
1.5.4.5
    
    
More information about the U-Boot
mailing list