From: Yann Sionneau <y...@minet.net>

---
 cores/lm32/test/Makefile           |   10 +++++++---
 cores/lm32/test/unittests/Makefile |    4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/cores/lm32/test/Makefile b/cores/lm32/test/Makefile
index 65375f6..6e66de3 100644
--- a/cores/lm32/test/Makefile
+++ b/cores/lm32/test/Makefile
@@ -1,6 +1,10 @@
 SOURCES=tb_lm32.v lm32_config.v
 SOURCES+=../rtl/lm32_adder.v ../rtl/lm32_addsub.v ../rtl/lm32_cpu.v 
../rtl/lm32_dcache.v ../rtl/lm32_debug.v ../rtl/lm32_decoder.v 
../rtl/lm32_dp_ram.v ../rtl/lm32_icache.v ../rtl/lm32_instruction_unit.v 
../rtl/lm32_interrupt.v ../rtl/lm32_jtag.v ../rtl/lm32_load_store_unit.v 
../rtl/lm32_logic_op.v ../rtl/lm32_mc_arithmetic.v ../rtl/lm32_multiplier.v 
../rtl/lm32_ram.v ../rtl/lm32_shifter.v ../rtl/lm32_itlb.v ../rtl/lm32_dtlb.v 
../rtl/lm32_top.v
 
+CROSS  ?= lm32-elf-
+CC      = $(CROSS)gcc
+OBJCOPY = $(CROSS)objcopy
+
 all: tb_lm32
 
 sim_%: %.vh tb_lm32
@@ -10,13 +14,13 @@ trace_%: %.vh tb_lm32
        @vvp tb_lm32 +trace=trace_$*.txt +prog=$<
 
 hello_world.elf: crt.S hello_world.c
-       lm32-elf-gcc -Tlinker.ld -fno-builtin -o $@ $^
+       $(CC) -Tlinker.ld -fno-builtin -nostdinc -nostdlib -lgcc -o $@ $^
 
 pipe1.elf: pipe1.S
-       lm32-elf-gcc -Tlinker.ld -fno-builtin -o $@ $^
+       $(CC) -Tlinker.ld -fno-builtin -nostdinc -nostdlib -lgcc -o $@ $^
 
 %.vh: %.elf
-       lm32-elf-objcopy -O verilog $< $@
+       $(OBJCOPY) -O verilog $< $@
 
 clean:
        rm -f tb_lm32 *.vcd *.elf *.vh trace*.txt
diff --git a/cores/lm32/test/unittests/Makefile 
b/cores/lm32/test/unittests/Makefile
index 7ef9a19..f26c3a1 100644
--- a/cores/lm32/test/unittests/Makefile
+++ b/cores/lm32/test/unittests/Makefile
@@ -1,4 +1,4 @@
-CROSS=lm32-elf-
+CROSS  ?= lm32-elf-
 
 CC      = $(CROSS)gcc
 AS      = $(CROSS)as
@@ -7,7 +7,7 @@ SIZE    = $(CROSS)size
 LD      = $(CC)
 OBJCOPY = $(CROSS)objcopy
 
-LDFLAGS = -Tlinker.ld
+LDFLAGS = -Tlinker.ld -nostdinc -nostdlib -lgcc
 ASFLAGS += -Wa,-I,.
 
 CRT        = crt.o
-- 
1.7.2.5

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to