From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 14 Jun 2009 16:29:39 +0200 Subject: [U-Boot] [PATCH/next v3] allow boards to customize compiler options on a per-file/dir basis In-Reply-To: <1244986380-24157-1-git-send-email-vapier@gentoo.org> References: <1242630364-2510-1-git-send-email-vapier@gentoo.org> <1244986380-24157-1-git-send-email-vapier@gentoo.org> Message-ID: <20090614142939.GG22102@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09:33 Sun 14 Jun , Mike Frysinger wrote: > With our Blackfin boards, we like to build the compression routines with > -O2 as our tests show a pretty good size/speed tradeoff. For the rest of > U-Boot though, we want to stick with the default -Os as that is mostly > control code. So in our case, we would add a line like so to the board > specific config.mk file: > CFLAGS_lib_generic += -O2 > > Now all files under lib_generic/ will have -O2 appended to their build. > > Signed-off-by: Mike Frysinger > Acked-by: Jean-Christophe PLAGNIOL-VILLARD > --- > v3 > - updated to apply to next after Jean's changes > > config.mk | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/config.mk b/config.mk > index 8d47a8e..f5b9c28 100644 > --- a/config.mk > +++ b/config.mk > @@ -206,11 +206,13 @@ export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS > > ######################################################################### > > +# Allow boards to use custom optimize flags on a per dir/file basis > +BCURDIR := $(notdir $(CURDIR)) > $(obj)%.s: %.S > - $(CPP) $(AFLAGS) -o $@ $< > + $(CPP) $(AFLAGS) $(AFLAGS_$(@F)) $(AFLAGS_$(BCURDIR)) -o $@ $< we can drop this one as there is no obj %.s Best Regards, J.