diff options
author | Marc Jones <marc.jones@se-eng.com> | 2012-11-30 17:15:36 -0700 |
---|---|---|
committer | Anton Kochkov <anton.kochkov@gmail.com> | 2012-12-13 10:37:28 +0100 |
commit | 9915b37f10828874dcc699bfb0298303fbc356c8 (patch) | |
tree | b072c6326262cafba7d6a77d76fe8fb16d0b6f65 /payloads/coreinfo/Makefile | |
parent | 0b97f2978f389a51953da11224a525b470ae82b4 (diff) | |
download | coreboot-9915b37f10828874dcc699bfb0298303fbc356c8.tar.xz |
coreinfo: Build libpayload from coreinfo makefile
Build libpayload and install it in the coreinfo directory.
Allows coreinfo to be built with a single make command.
Change-Id: I56982265555aae16e482b0a0040989c1f5317423
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/1995
Tested-by: build bot (Jenkins)
Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Diffstat (limited to 'payloads/coreinfo/Makefile')
-rw-r--r-- | payloads/coreinfo/Makefile | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index 573631445f..1879901bf9 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -45,9 +45,12 @@ HOSTCXX ?= g++ HOSTCFLAGS := -I$(srck) -I$(objk) HOSTCXXFLAGS := -I$(srck) -I$(objk) -LIBPAYLOAD_DIR := ../libpayload/install/libpayload -LPCC := $(LIBPAYLOAD_DIR)/bin/lpgcc -LPAS := $(LIBPAYLOAD_DIR)/bin/lpas +LIBCONFIG_PATH := ../libpayload +LIBPAYLOAD_DIR := ./libpayloadbin +LPCC := $(LIBPAYLOAD_DIR)/libpayload/bin/lpgcc +LPAS := $(LIBPAYLOAD_DIR)/libpayload/bin/lpas +HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_DIR)/libpayload/lib/libpayload.a) +LIB_CONFIG ?= defconfig OBJCOPY ?= objcopy INCLUDES = -I$(obj) @@ -62,18 +65,18 @@ ifneq ($(strip $(HAVE_DOTCONFIG)),) include $(src)/.config all: $(TARGET) -$(TARGET): $(src)/.config $(OBJS) prepare +$(TARGET): $(src)/.config $(OBJS) prepare libpayload $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(LPCC) -o $@ $(OBJS) $(Q)$(OBJCOPY) --only-keep-debug $@ $(TARGET).debug $(Q)$(OBJCOPY) --strip-debug $@ $(Q)$(OBJCOPY) --add-gnu-debuglink=$(TARGET).debug $@ -$(obj)/%.S.o: $(src)/%.S +$(obj)/%.S.o: $(src)/%.S libpayload $(Q)printf " LPAS $(subst $(shell pwd)/,,$(@))\n" $(Q)$(LPAS) -o $@ $< -$(obj)/%.o: $(src)/%.c +$(obj)/%.o: $(src)/%.c libpayload $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n" $(Q)$(LPCC) $(CFLAGS) -c -o $@ $< @@ -81,6 +84,16 @@ else all: config endif +ifneq ($(strip $(HAVE_LIBPAYLOAD)),) +libpayload: + $(Q)printf "Found Libpayload $(LIBPAYLOAD_DIR).\n" +else +libpayload: + $(Q)printf "Building libpayload @ $(LIBCONFIG_PATH).\n" + $(Q)make -C $(LIBCONFIG_PATH) distclean + $(Q)make -C $(LIBCONFIG_PATH) $(LIB_CONFIG) + $(Q)make -C $(LIBCONFIG_PATH) DESTDIR=$(shell pwd)/$(LIBPAYLOAD_DIR) install +endif prepare: $(Q)mkdir -p $(obj)/util/kconfig/lxdialog |