]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
config.mk: unify duplicated flag setting
authorMike Frysinger <vapier@gentoo.org>
Wed, 15 Dec 2010 12:17:31 +0000 (07:17 -0500)
committerWolfgang Denk <wd@denx.de>
Fri, 17 Dec 2010 20:19:37 +0000 (21:19 +0100)
Multiple rules are using the expanded AFLAGS/CFLAGS settings and some are
getting so long that the rules need to be line wrapped.  So unify them in
one variable, use that variable in the rule, and then unwrap things.  This
makes the actual `make` output nicer as it doesn't have line continuations
in it anymore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
config.mk

index c6d6f7b12c61454d18559cf32bda1b5a0c07523e..66f8fe67f73d89cc7edb41db4eb3724ba21b4a26 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -242,21 +242,18 @@ export    CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS
 
 # Allow boards to use custom optimize flags on a per dir/file basis
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
+ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
+ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
 $(obj)%.s:     %.S
-       $(CPP) $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR)) \
-               -o $@ $<
+       $(CPP) $(ALL_AFLAGS) -o $@ $<
 $(obj)%.o:     %.S
-       $(CC)  $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR)) \
-               -o $@ $< -c
+       $(CC)  $(ALL_AFLAGS) -o $@ $< -c
 $(obj)%.o:     %.c
-       $(CC)  $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-               -o $@ $< -c
+       $(CC)  $(ALL_CFLAGS) -o $@ $< -c
 $(obj)%.i:     %.c
-       $(CPP) $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-               -o $@ $< -c
+       $(CPP) $(ALL_CFLAGS) -o $@ $< -c
 $(obj)%.s:     %.c
-       $(CC)  $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-               -o $@ $< -c -S
+       $(CC)  $(ALL_CFLAGS) -o $@ $< -c -S
 
 #########################################################################