Patchwork [U-Boot] config.mk: unify duplicated flag setting

login
register
mail settings
Submitter Mike Frysinger
Date Dec. 15, 2010, 12:17 p.m.
Message ID <1292415451-18909-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/75641/
State Accepted
Delegated to: Wolfgang Denk
Headers show

Comments

Mike Frysinger - Dec. 15, 2010, 12:17 p.m.
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 |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
Wolfgang Denk - Dec. 17, 2010, 8:19 p.m.
Dear Mike Frysinger,

In message <1292415451-18909-1-git-send-email-vapier@gentoo.org> you wrote:
> 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 |   17 +++++++----------
>  1 files changed, 7 insertions(+), 10 deletions(-)

Applied to "next", thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/config.mk b/config.mk
index eb95093..d6ca9b9 100644
--- a/config.mk
+++ b/config.mk
@@ -242,20 +242,17 @@  export	TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
 
 # 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
 
 #########################################################################