diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -13,7 +13,8 @@ SIM_ELF = build/altimeter_sim.elf # options for native (i.e. unit test) UNITY_SRC ?= unity/src -CFLAGS += -Wall -Wextra -I$(UNITY_SRC) -g3 +TEST_RUNNER ?= unity-test-runner +CFLAGS += -Wall -Wextra -I$(UNITY_SRC) -I$(TEST_RUNNER) -g3 LDFLAGS += -lm # options for cross-compile @@ -30,7 +31,7 @@ AVR_COMMON_LDFLAGS += -Wl,-u,vfprintf -lprintf_flt AVR_LDFLAGS += $(AVR_COMMON_LDFLAGS) -mmcu=$(MCU) SIM_LDFLAGS += $(AVR_COMMON_LDFLAGS) -mmcu=$(SIM_MCU) -$(shell mkdir -p build/{real,sim,native{,/$(UNITY_SRC)}}) +$(shell mkdir -p build/{real,sim,native{,/$(UNITY_SRC),/$(TEST_RUNNER)}}) all: build/altimeter_sim.elf build/altimeter.hex test size @@ -56,7 +57,7 @@ NATIVE_DIR = $(BUILD_DIR)/native TEST_OBJ = \ $(NATIVE_DIR)/$(UNITY_SRC)/unity.o \ - $(NATIVE_DIR)/test_runner.o \ + $(NATIVE_DIR)/$(TEST_RUNNER)/test_runner.o \ $(NATIVE_DIR)/test_util.o \ $(NATIVE_DIR)/test_data_manager.o \ $(NATIVE_DIR)/data_manager.o \ @@ -80,11 +81,11 @@ SIM_OBJ = \ ALL_OBJ = $(TEST_OBJ) $(REAL_OBJ) $(SIM_OBJ) ALL_SOURCE = $(ALL_OBJ:.o=.c) -test: build/native/test_runner +test: build/native/unity-test-runner/test_runner ./$^ -build/native/test_runner: $(TEST_OBJ) - $(CC) $(LDFLAGS) -Wl,-T,linker_list.lds -o $@ $^ +build/native/unity-test-runner/test_runner: $(TEST_OBJ) + $(CC) $(LDFLAGS) -Wl,-T,$(TEST_RUNNER)/linker_list.lds -o $@ $^ # ELF for real hardware. No mock/sim hardware included (except barometer, # haven't written that code yet) |