[scripts] Makefile: Remove objs variable and add all_objs

This commit is contained in:
Émilie Feral
2019-06-28 17:46:57 +02:00
parent 5345a8f278
commit 86487567d4
4 changed files with 11 additions and 12 deletions

View File

@@ -72,22 +72,23 @@ include scripts/struct_layout/Makefile
include scripts/scenario/Makefile
include quiz/Makefile # Quiz needs to be included at the end
objs = $(call object_for,$(src))
.SECONDARY: $(objs)
all_src = src ion_device_dfu_relocated_src ion_device_dfu_xip flasher_src bench_src epsilon_src runner_src tests
all_objs = $(call object_for,$(all_src))
.SECONDARY: $(all_objs)
# Load source-based dependencies
# Compilers can generate Makefiles that states the dependencies of a given
# objet to other source and headers. This serve no purpose for a clean build,
# but allows correct yet optimal incremental builds.
-include $(objs:.o=.d)
-include $(all_objs:.o=.d)
executables = epsilon test
#define platform generic targets
$(BUILD_DIR)/epsilon.$(EXE): $(objs) $(call object_for,$(ion_device_dfu_relocated_src) $(epsilon_src))
$(BUILD_DIR)/epsilon.$(EXE): $(call object_for,$(src) $(ion_device_dfu_relocated_src) $(epsilon_src))
$(BUILD_DIR)/test.$(EXE): $(BUILD_DIR)/quiz/src/tests_symbols.o $(objs) $(call object_for,$(ion_device_dfu_relocated_src) $(tests) $(runner_src))
$(BUILD_DIR)/test.$(EXE): $(BUILD_DIR)/quiz/src/tests_symbols.o $(call object_for,$(src) $(ion_device_dfu_relocated_src) $(tests) $(runner_src))
# Load platform-specific targets
# We include them before the standard ones to give them precedence.

View File

@@ -35,6 +35,4 @@ $(BUILD_DIR)/ion/src/device/console.o: SFLAGS+=-O3
$(BUILD_DIR)/ion/src/device/display.o: SFLAGS+=-O3
$(BUILD_DIR)/ion/src/device/swd.o: SFLAGS+=-O3
endif
endif
#objs += $(addprefix ion/src/device/keyboard/, keyboard.o)
endif

View File

@@ -55,12 +55,12 @@ $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.$(EXE)
openocd:
openocd -f scripts/$(PLATFORM)/openocd.$(MODEL).cfg
# The flasher target is defined here because otherwise $(objs) has not been
# The flasher target is defined here because otherwise $(src) has not been
# fully filled
ifeq ($(EPSILON_DEVICE_BENCH),0)
$(BUILD_DIR)/flasher.%.$(EXE): LDFLAGS += -Lion/src/$(PLATFORM)/flasher
$(BUILD_DIR)/flasher.%.$(EXE): LDSCRIPT = ion/src/$(PLATFORM)/shared/ram.ld
flasher_objs = $(objs) $(call object_for,$(flasher_src)) $(call object_for,$(ion_device_dfu_xip_src))
flasher_objs = $(call object_for,$(src) $(flasher_src) $(ion_device_dfu_xip_src))
$(BUILD_DIR)/flasher.light.$(EXE): $(BUILD_DIR)/ion/src/$(PLATFORM)/flasher/display_light.o $(flasher_objs)
$(BUILD_DIR)/flasher.verbose.$(EXE): $(BUILD_DIR)/ion/src/$(PLATFORM)/flasher/display_verbose.o $(flasher_objs)
else
@@ -73,7 +73,7 @@ ifeq ($(EPSILON_DEVICE_BENCH),1)
$(BUILD_DIR)/bench.ram.$(EXE): LDFLAGS += -Lion/src/$(PLATFORM)/bench
$(BUILD_DIR)/bench.ram.$(EXE): LDSCRIPT = ion/src/$(PLATFORM)/shared/ram.ld
$(BUILD_DIR)/bench.flash.$(EXE): LDSCRIPT = ion/src/$(PLATFORM)/$(MODEL)/internal_flash.ld
$(BUILD_DIR)/bench.%.$(EXE): $(objs) $(call object_for,$(bench_src)) $(call object_for,$(ion_device_dfu_xip_src))
$(BUILD_DIR)/bench.%.$(EXE): $(call object_for,$(src) $(bench_src) $(ion_device_dfu_xip_src))
else
$(BUILD_DIR)/bench.ram.$(EXE):
@echo "Error: bench.*.bin requires EPSILON_DEVICE_BENCH=1"

View File

@@ -1,5 +1,5 @@
$(BUILD_DIR)/epsilon.packed.js: LDFLAGS += --memory-init-file 0
$(BUILD_DIR)/epsilon.packed.js: $(objs) $(call object_for,$(epsilon_src))
$(BUILD_DIR)/epsilon.packed.js: $(call object_for,$(src) $(epsilon_src))
$(BUILD_DIR)/simulator.zip: $(BUILD_DIR)/epsilon.packed.js
@rm -rf $(basename $@)