summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-12-17 13:18:08 +1100
committerDamien George <damien.p.george@gmail.com>2019-12-17 13:32:07 +1100
commit1e2f7515917345ee2937f2870827cf15c29509ab (patch)
treefde86e0d27e055e936786ee2ddc6acc89261786e
parent0bd7d1f7f03d086a0789caa8e007cf15068c689c (diff)
qemu-arm: Let tinytest.o be built by standard build rules.
This makes sure tinytest.o is rebuilt if any of its dependencies change.
-rw-r--r--ports/qemu-arm/Makefile5
-rw-r--r--ports/qemu-arm/Makefile.test3
-rw-r--r--ports/qemu-arm/test_main.c5
3 files changed, 4 insertions, 9 deletions
diff --git a/ports/qemu-arm/Makefile b/ports/qemu-arm/Makefile
index e06e5dd5e..4f12173c3 100644
--- a/ports/qemu-arm/Makefile
+++ b/ports/qemu-arm/Makefile
@@ -33,12 +33,9 @@ endif
CROSS_COMPILE = arm-none-eabi-
-TINYTEST = $(TOP)/lib/tinytest
-
INC += -I.
INC += -I$(TOP)
INC += -I$(BUILD)
-INC += -I$(TINYTEST)
CFLAGS += $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 $(COPT) \
-ffunction-sections -fdata-sections
@@ -71,6 +68,7 @@ SRC_RUN_C = \
SRC_TEST_C = \
test_main.c \
+ lib/tinytest/tinytest.c \
LIB_SRC_C += $(addprefix lib/,\
libc/string0.c \
@@ -108,7 +106,6 @@ ALL_OBJ_RUN = $(OBJ_COMMON) $(OBJ_RUN)
OBJ_TEST =
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_TEST_C:.c=.o))
-OBJ_TEST += $(BUILD)/tinytest.o
ALL_OBJ_TEST = $(OBJ_COMMON) $(OBJ_TEST)
diff --git a/ports/qemu-arm/Makefile.test b/ports/qemu-arm/Makefile.test
index df0ba9939..340e1c3b9 100644
--- a/ports/qemu-arm/Makefile.test
+++ b/ports/qemu-arm/Makefile.test
@@ -13,8 +13,7 @@ $(BUILD)/genhdr/tests.h:
(cd $(TOP)/tests; ./run-tests --target=qemu-arm --write-exp)
$(Q)echo "Generating $@";(cd $(TOP)/tests; ../tools/tinytest-codegen.py) > $@
-$(BUILD)/tinytest.o:
- $(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c $(TINYTEST)/tinytest.c
+$(BUILD)/lib/tinytest/tinytest.o: CFLAGS += -DNO_FORKING
$(BUILD)/firmware-test.elf: $(LDSCRIPT) $(ALL_OBJ_TEST)
$(Q)$(LD) $(LDFLAGS) -o $@ $(ALL_OBJ_TEST) $(LIBS)
diff --git a/ports/qemu-arm/test_main.c b/ports/qemu-arm/test_main.c
index 3a85d65f3..3fd2c0148 100644
--- a/ports/qemu-arm/test_main.c
+++ b/ports/qemu-arm/test_main.c
@@ -12,9 +12,8 @@
#include "py/gc.h"
#include "py/mperrno.h"
#include "lib/utils/gchelper.h"
-
-#include "tinytest.h"
-#include "tinytest_macros.h"
+#include "lib/tinytest/tinytest.h"
+#include "lib/tinytest/tinytest_macros.h"
#define HEAP_SIZE (100 * 1024)