summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-06-26 09:48:04 -0700
committerGerrit <chrome-bot@google.com>2012-06-26 13:58:54 -0700
commitfb123b48384cdf2eb1c5008324fac6f8d2811e16 (patch)
tree32f5a582794db1d253fadc2c6427b7905fae3640 /Makefile.rules
parent90afebac6406e02ce306a4a6eaf7b66097a81931 (diff)
downloadchrome-ec-fb123b48384cdf2eb1c5008324fac6f8d2811e16.tar.gz
Only one RW image is now the default
And if RW B isn't enabled, it's not even linked. BUG=chrome-os-partner:10881 TEST=on link, should be no B image, and 'sysjump B' should fail On BDS, still should be A and B images Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: Icb2af07881cc7e28b9b877f45824486a22fde8d7 Reviewed-on: https://gerrit.chromium.org/gerrit/26116
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules27
1 files changed, 17 insertions, 10 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 7b3274f914..7a06001237 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -48,16 +48,21 @@ cmd_sign = vbutil_ec --sign $@ \
--signpubkey $(VBOOT_DEVKEYS)/ec_root_key.vbpubk \
$(silent)
cmd_mv = mv $^ $@
-cmd_extractab = cd $(out) && \
- dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_A RW_SECTION_B $(silent) && \
- mv RW_SECTION_A $(PROJECT).A.bin && mv RW_SECTION_B $(PROJECT).B.bin
-cmd_copyab = cd $(out) && cp $(PROJECT).A.flat $(PROJECT).A.bin && \
- cp $(PROJECT).B.flat $(PROJECT).B.bin
+cmd_extractab-y = cd $(out) && \
+ dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_A $(silent) && \
+ mv RW_SECTION_A $(PROJECT).A.bin
+cmd_extractab-$(CONFIG_RW_B) += && \
+ dump_fmap -x $(PROJECT).bin.tmp RW_SECTION_B $(silent) && \
+ mv RW_SECTION_B $(PROJECT).B.bin
+cmd_copyab-y = cd $(out) && cp $(PROJECT).A.flat $(PROJECT).A.bin
+cmd_copyab-$(CONFIG_RW_B) += && cp $(PROJECT).B.flat $(PROJECT).B.bin
.PHONY: all tests utils
all: $(out)/$(PROJECT).bin utils
-dis: $(foreach s,A B RO,$(out)/$(PROJECT).$(s).dis)
+dis-y = $(out)/$(PROJECT).RO.dis $(out)/$(PROJECT).A.dis
+dis-$(CONFIG_RW_B) += $(out)/$(PROJECT).B.dis
+dis: $(dis-y)
utils: $(build-utils) $(host-utils)
@@ -88,11 +93,13 @@ $(out)/%.bin: $(out)/%.bin.tmp
$(out)/%.bin.tmp: $(out)/%.obj
$(call quiet,obj_to_bin,OBJCOPY)
$(if $(sign-y),$(call quiet,sign,SIGN ),)
- $(if $(sign-y),$(call quiet,extractab,EXTR_AB), \
- $(call quiet,copyab,COPY_AB))
+ $(if $(sign-y),$(call quiet,extractab-y,EXTR_AB), \
+ $(call quiet,copyab-y,COPY_AB))
-$(out)/%.obj: common/firmware_image.S $(out)/firmware_image.lds \
- $(out)/%.RO.flat $(out)/%.A.flat $(out)/%.B.flat
+flat-y = $(out)/$(PROJECT).RO.flat $(out)/$(PROJECT).A.flat
+flat-$(CONFIG_RW_B) += $(out)/$(PROJECT).B.flat
+
+$(out)/%.obj: common/firmware_image.S $(out)/firmware_image.lds $(flat-y)
$(call quiet,flat_to_obj,CAT )
$(out)/%.dis: $(out)/%.elf