cbootimage: Add HOSTCC and flags

Add the flags used by the Nvidia makefile and use HOSTCC
to build cbootimage. Note that adding -g makes the BCT
very large, so leave that flag out.

Change-Id: I4431efffdfdcbd030665b26f5b799352e38d1f95
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/8411
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Marc Jones 2015-02-10 14:15:45 -07:00 committed by Patrick Georgi
parent bde6d309df
commit e77e37b957
1 changed files with 5 additions and 2 deletions

View File

@ -37,12 +37,15 @@ CBOOTIMAGE_RAW_SRCS:= \
CBOOTIMAGE_SRCS:=$(addprefix util/nvidia/cbootimage/src/,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS)))
CBOOTIMAGE_OBJS:=$(addprefix $(objutil)/nvidia/cbootimage/,$(patsubst %.c,%.o,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS))))
CBOOTIMAGE_FLAGS:=-Wall -std=c99 -O2
additional-dirs += $(sort $(dir $(CBOOTIMAGE_OBJS)))
$(objutil)/nvidia/cbootimage/%.o: util/nvidia/cbootimage/src/%.c
gcc -c -o $@ $<
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
$(HOSTCC) $(CBOOTIMAGE_FLAGS) -c -o $@ $<
$(CBOOTIMAGE): $(CBOOTIMAGE_OBJS)
gcc -o $@.tmp $^ -lm
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
$(HOSTCC) $(CBOOTIMAGE_FLAGS) -o $@.tmp $^ -lm
mv $@.tmp $@