mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
allow boards to customize compiler options on a per-file/dir basis
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 <vapier@gentoo.org> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
92afd368bb
commit
5ec5529b82
@ -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
|
$(obj)%.s: %.S
|
||||||
$(CPP) $(AFLAGS) -o $@ $<
|
$(CPP) $(AFLAGS) $(AFLAGS_$(@F)) $(AFLAGS_$(BCURDIR)) -o $@ $<
|
||||||
$(obj)%.o: %.S
|
$(obj)%.o: %.S
|
||||||
$(CC) $(AFLAGS) -c -o $@ $<
|
$(CC) $(AFLAGS) $(AFLAGS_$(@F)) $(AFLAGS_$(BCURDIR)) -o $@ $< -c
|
||||||
$(obj)%.o: %.c
|
$(obj)%.o: %.c
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CFLAGS_$(@F)) $(CFLAGS_$(BCURDIR)) -o $@ $< -c
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user