Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 08, 2013
@fallen fallen lm32 test Makefiles cleanup
Make the makefiles more portable and able to use different toolchain than
lm32-elf (for instance lm32-rtems4.11).

Signed-off-by: Yann Sionneau <yann@minet.net>
Signed-off-by: Michael Walle <michael@walle.cc>
e937900
@fallen fallen fix compilation of lm32 tests
Fix compiling when using RTEMS toolchain (or any other non-bare-metal
toolchain).

Signed-off-by: Yann Sionneau <yann@minet.net>
Signed-off-by: Michael Walle <michael@walle.cc>
68d407f
Showing with 16 additions and 15 deletions.
  1. +7 −6 test/Makefile
  2. +9 −9 test/unittests/Makefile
View
13 test/Makefile
@@ -1,4 +1,4 @@
-PREFIX ?= lm32-elf-
+CROSS_COMPILE ?= lm32-elf-
# extra plusargs for simulation
# eg. EXTRA_PLUSARGS = "+dump=dump.vcd"
@@ -8,8 +8,9 @@ EXTRA_PLUSARGS ?=
# eg. EXTRA_DEFINES = "-DTB_ENABLE_WB_TRACES"
EXTRA_DEFINES ?=
-CC := $(PREFIX)gcc
-OBJCOPY := $(PREFIX)objcopy
+CC = $(CROSS_COMPILE)gcc
+OBJCOPY = $(CROSS_COMPILE)objcopy
+LDFLAGS = -Tlinker.ld -fno-builtin -nostdlib -lgcc
RTL ?= ../rtl
SOURCES = tb_lm32_system.v lm32_config.v
@@ -32,19 +33,19 @@ trace_%: %.vh tb_lm32_system
@vvp tb_lm32_system +trace=trace_$*.txt +prog=$< $(EXTRA_PLUSARGS)
%.elf:
- $(CC) -Tlinker.ld -fno-builtin -o $@ $^
+ $(CC) $(LDFLAGS) -o $@ $^
%.vh: %.elf
$(OBJCOPY) -O verilog $< $@
clean:
- rm -f tb_lm32_system *.vcd *.elf *.vh trace*.txt
+ $(RM) tb_lm32_system *.vcd *.elf *.vh trace*.txt
tb_lm32_system: $(SOURCES)
iverilog -I. -I$(RTL) -o $@ $(SOURCES) $(EXTRA_DEFINES)
unittest:
- make -C unittests check
+ $(MAKE) -C unittests check
.PHONY: clean unittest
View
18 test/unittests/Makefile
@@ -1,13 +1,13 @@
-CROSS=lm32-elf-
+CROSS_COMPILE ?= lm32-elf-
-CC = $(CROSS)gcc
-AS = $(CROSS)as
+CC = $(CROSS_COMPILE)gcc
+AS = $(CROSS_COMPILE)as
AS = $(CC) -x assembler
-SIZE = $(CROSS)size
+SIZE = $(CROSS_COMPILE)size
LD = $(CC)
-OBJCOPY = $(CROSS)objcopy
+OBJCOPY = $(CROSS_COMPILE)objcopy
-LDFLAGS = -Tlinker.ld
+LDFLAGS = -Tlinker.ld -nostdlib -lgcc
ASFLAGS += -Wa,-I,.
CRT = crt.o
@@ -108,15 +108,15 @@ test_mmu_nop3.S: test_mmu.S
build: $(CRT) $(TESTCASES) $(TESTCASES:.elf=.vh)
check: $(TESTCASES:.elf=.vh)
- @make -C .. tb_lm32_system
+ @$(MAKE) -C .. tb_lm32_system
@for case in $(TESTCASES:.elf=.vh); do \
echo -e "\nRunning test case $$case"; \
vvp ../tb_lm32_system +prog=$$case; \
done
check_%: test_%.vh
- @make -C .. tb_lm32_system
+ @$(MAKE) -C .. tb_lm32_system
vvp ../tb_lm32_system +prog=$<
clean:
- $(RM) -fr $(TESTCASES) $(TESTCASES:.elf=.vh) $(CRT) *nop?.S tb_lm32.vcd
+ $(RM) $(TESTCASES) $(TESTCASES:.elf=.vh) $(CRT) *nop?.S tb_lm32.vcd

No commit comments for this range

Something went wrong with that request. Please try again.