aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2012-03-31 19:53:51 +0200
committerMichael Walle <michael@walle.cc>2012-03-31 19:56:03 +0200
commit927b241d66c17501013ccea9f1b56a3d9c7ebb79 (patch)
tree6d141c532d8dcdb02de05073c97a979cdae3fdb4 /tests/tcg
parentb7c8e15a146a7b20021b524f41d6b8072ee093b5 (diff)
tests: fix out-of-tree building for lm32 target
Signed-off-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/lm32/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/tcg/lm32/Makefile b/tests/tcg/lm32/Makefile
index 03a1abbcfb..9a00ef7ea9 100644
--- a/tests/tcg/lm32/Makefile
+++ b/tests/tcg/lm32/Makefile
@@ -1,4 +1,4 @@
--include ../../config-host.mak
+-include ../../../config-host.mak
CROSS=lm32-elf-
@@ -12,7 +12,10 @@ SIZE = $(CROSS)size
LD = $(CC)
OBJCOPY = $(CROSS)objcopy
-LDFLAGS = -Tlinker.ld
+TSRC_PATH = $(SRC_PATH)/tests/tcg/lm32
+
+LDFLAGS = -T$(TSRC_PATH)/linker.ld
+ASFLAGS += -Wa,-I,$(TSRC_PATH)/
CRT = crt.o
TESTCASES += test_add.tst
@@ -82,13 +85,13 @@ TESTCASES += test_xori.tst
all: build
-%.o: $(SRC_PATH)/tests/lm32/%.c
+%.o: $(TSRC_PATH)/%.c
$(CC) $(CFLAGS) -c $< -o $@
-%.o: $(SRC_PATH)/tests/lm32/%.S
+%.o: $(TSRC_PATH)/%.S
$(AS) $(ASFLAGS) -c $< -o $@
-%.tst: %.o macros.inc $(CRT)
+%.tst: %.o $(TSRC_PATH)/macros.inc $(CRT)
$(LD) $(LDFLAGS) $(NOSTDFLAGS) $(CRT) $< -o $@
build: $(CRT) $(TESTCASES)