diff --git a/build/targets.device.n0110.mak b/build/targets.device.n0110.mak index 5b5078ac5..59902232d 100644 --- a/build/targets.device.n0110.mak +++ b/build/targets.device.n0110.mak @@ -31,15 +31,21 @@ $(BUILD_DIR)/test.external_flash.write.$(EXE): $(BUILD_DIR)/quiz/src/test_ion_ex .PHONY: binpack binpack: +ifndef USE_IN_FACTORY + @echo "CAUTION: You are building a binpack." + @echo "You must specify where this binpack will be used" + @echo "Please set the USE_IN_FACTORY environment variable to either 0 or 1 to proceed." + @exit -1 +endif rm -rf output/binpack mkdir -p output/binpack $(MAKE) clean - $(MAKE) $(BUILD_DIR)/flasher.light.bin + $(MAKE) $(BUILD_DIR)/flasher.light.bin IN_FACTORY=$(USE_IN_FACTORY) cp $(BUILD_DIR)/flasher.light.bin output/binpack - $(MAKE) $(BUILD_DIR)/bench.flash.bin - $(MAKE) $(BUILD_DIR)/bench.ram.bin + $(MAKE) $(BUILD_DIR)/bench.flash.bin IN_FACTORY=$(USE_IN_FACTORY) + $(MAKE) $(BUILD_DIR)/bench.ram.bin IN_FACTORY=$(USE_IN_FACTORY) cp $(BUILD_DIR)/bench.ram.bin $(BUILD_DIR)/bench.flash.bin output/binpack - $(MAKE) epsilon.official.onboarding.update.two_binaries + $(MAKE) epsilon.official.onboarding.update.two_binaries IN_FACTORY=$(USE_IN_FACTORY) cp $(BUILD_DIR)/epsilon.official.onboarding.update.internal.bin $(BUILD_DIR)/epsilon.official.onboarding.update.external.bin output/binpack $(MAKE) clean cd output && for binary in flasher.light.bin bench.flash.bin bench.ram.bin epsilon.official.onboarding.update.internal.bin epsilon.official.onboarding.update.external.bin; do shasum -a 256 -b binpack/$${binary} > binpack/$${binary}.sha256;done diff --git a/ion/src/device/Makefile b/ion/src/device/Makefile index ad9926bca..963690440 100644 --- a/ion/src/device/Makefile +++ b/ion/src/device/Makefile @@ -12,7 +12,9 @@ endif ion_src += ion/src/shared/collect_registers.cpp -ION_DEVICE_SFLAGS = -Iion/src/device/$(MODEL) -Iion/src/device/shared -DPCB_LATEST=$(PCB_LATEST) +IN_FACTORY ?= 0 + +ION_DEVICE_SFLAGS = -Iion/src/device/$(MODEL) -Iion/src/device/shared -DPCB_LATEST=$(PCB_LATEST) -DIN_FACTORY=$(IN_FACTORY) $(call object_for,$(ion_device_src) $(ion_device_flasher_src) $(ion_device_bench_src)): SFLAGS += $(ION_DEVICE_SFLAGS)