summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-12-08 09:37:32 -0800
committerRandall Spangler <rspangler@chromium.org>2011-12-08 10:55:27 -0800
commitbc4c1b4eb9ca3b30f07ba78d0c3f591e057874b1 (patch)
treee1f9b00a10d6d4d84a82375a51b580550ffd39d4 /Makefile.rules
parente24fa592d2a215d8ae67917c1d89e68cdf847a03 (diff)
downloadchrome-ec-bc4c1b4eb9ca3b30f07ba78d0c3f591e057874b1.tar.gz
Separate utility build for build and host utils
Build is the system doing the build (e.g. 64-bit linux) and host is the target platform on top of the ec (e.g. 32-bit Chromium OS). Necessary to get ectool properly compiling for Chromium OS. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=make && file build/bds/util/ectool; ectool should be a 32-bit binary Change-Id: I50eba4c164ece236646a7c6087b1b86769beeb28
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile.rules b/Makefile.rules
index c60ba7034e..888425daa1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
@@ -7,7 +7,8 @@
objs := $(all-objs)
deps := $(objs:%.o=%.o.d)
-all-utils := $(foreach u,$(util-bin),$(out)/util/$(u))
+build-utils := $(foreach u,$(build-util-bin),$(out)/util/$(u))
+host-utils := $(foreach u,$(host-util-bin),$(out)/util/$(u))
# Create output directories if necessary
_dir_create := $(foreach d,$(dirs),$(shell [ -d $(out)/$(d) ] || mkdir -p $(out)/$(d)))
@@ -28,6 +29,7 @@ cmd_elf_to_flat = $(OBJCOPY) -O binary $^ $@
cmd_elf_to_dis = $(OBJDUMP) -D $< > $@
cmd_elf = $(LD) $(LDFLAGS) $(objs) -o $@ -T $< -Map $(out)/$*.map
cmd_c_to_o = $(CC) $(CFLAGS) -MMD -MF $@.d -c $< -o $@
+cmd_c_to_build = $(BUILDCC) $(BUILD_CFLAGS) -MMD -MF $@.d $< -o $@
cmd_c_to_host = $(HOSTCC) $(HOST_CFLAGS) -MMD -MF $@.d $< -o $@
cmd_qemu = ./util/run_qemu_test --image=build/$(BOARD)/$*/$*.bin test/$*.py $(silent)
@@ -35,7 +37,7 @@ cmd_qemu = ./util/run_qemu_test --image=build/$(BOARD)/$*/$*.bin test/$*.py $(si
.PHONY: all tests utils
all: $(out)/$(PROJECT).bin $(foreach s,A B RO,$(out)/$(PROJECT).$(s).dis) utils
-utils: $(all-utils)
+utils: $(build-utils) $(host-utils)
test-targets=$(foreach t,$(test-list),test-$(t))
qemu-test-targets=$(foreach t,$(test-list),qemu-$(t))
@@ -79,7 +81,10 @@ $(out)/%.o:%.c
$(out)/%.o:%.S
$(call quiet,c_to_o,AS )
-$(all-utils): $(out)/%:%.c
+$(build-utils): $(out)/%:%.c
+ $(call quiet,c_to_build,BUILDCC)
+
+$(host-utils): $(out)/%:%.c
$(call quiet,c_to_host,HOSTCC )
.PHONY: clean