mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[scripts] Makefile: Remove objs variable and add all_objs
This commit is contained in:
11
Makefile
11
Makefile
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -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 $@)
|
||||
|
||||
Reference in New Issue
Block a user