summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-11-18 14:57:08 -0800
committerGerrit <chrome-bot@google.com>2011-12-14 12:13:34 -0800
commit776e37efbbb881930332b06cd7e8b44551fda3f7 (patch)
treec1473b8099eebb6f14d26b0fdadd2efd78baafde
parent4b7e793e368910dd7daaaa55689975e358c08ced (diff)
Build vboot_reference-firmware library directly from U-Boot
To test this, add VBOOT_SOURCE=/home/${USER}/trunk/src/platform/vboot_reference to the make command line. You can also use MAKEFLAGS_VBOOT to pass flags to the vboot Makefile. BUG=chromium-os:20453 TEST=build using my script, see that it builds vboot also; emerge on seaboard Change-Id: Iedf02b5d4601726142db26b5baa2a2792d143735 Reviewed-on: https://gerrit.chromium.org/gerrit/11954 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
-rw-r--r--Makefile24
-rw-r--r--config.mk9
2 files changed, 28 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 066a6d271d..d2835cdd78 100644
--- a/Makefile
+++ b/Makefile
@@ -341,10 +341,31 @@ LDPPFLAGS += \
__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
+
+ifdef VBOOT_SOURCE
+# Go off and build vboot_reference directory with the same CFLAGS
+# This is a eng convenience, not used by ebuilds
+# set VBOOT_MAKEFLAGS to required make flags, e.g. MOCK_TPM=1 if no TPM
+CFLAGS_VBOOT = $(filter-out -I%, $(CFLAGS))
+
+# Always call the vboot Makefile, since we don't have its dependencies
+.PHONY : vboot
+vboot:
+ FIRMWARE_ARCH="$(ARCH)" CFLAGS="$(CFLAGS_VBOOT)" \
+ $(MAKE) -C $(VBOOT_SOURCE) \
+ BUILD=$(OBJTREE)/include/generated/vboot \
+ $(MAKEFLAGS_VBOOT)
+
+__LIBS += $(obj)include/generated/vboot/vboot_fw.a
+VBOOT_TARGET := vboot
+endif
+
# Add vboot_reference lib
ifdef VBOOT
+ifndef VBOOT_SOURCE
__LIBS += $(VBOOT)/lib/vboot_fw.a
endif
+endif
#########################################################################
#########################################################################
@@ -449,7 +470,8 @@ GEN_UBOOT = \
--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
-Map u-boot.map -o u-boot
$(obj)u-boot: depend \
- $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
+ $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) \
+ $(obj)u-boot.lds $(VBOOT_TARGET)
$(GEN_UBOOT)
ifeq ($(CONFIG_KALLSYMS),y)
smap=`$(call SYSTEM_MAP,u-boot) | \
diff --git a/config.mk b/config.mk
index aeafbd4c98..5ee6c783a8 100644
--- a/config.mk
+++ b/config.mk
@@ -201,10 +201,6 @@ ifneq ($(OBJTREE),$(SRCTREE))
CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
endif
-ifdef VBOOT
-CPPFLAGS += -I$(VBOOT)/include/vboot
-endif
-
ifdef DEV_TREE_SEPARATE
CPPFLAGS += -DCONFIG_OF_SEPARATE
endif
@@ -213,6 +209,11 @@ CPPFLAGS += -I$(TOPDIR)/include
CPPFLAGS += -fno-builtin -ffreestanding -nostdinc \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
+ifdef VBOOT
+CPPFLAGS += -I$(if $(VBOOT_SOURCE),$(VBOOT_SOURCE)/firmware/include,\
+ $(VBOOT)/include/vboot)
+endif
+
ifdef BUILD_TAG
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes \
-DBUILD_TAG='"$(BUILD_TAG)"'