mirror of
https://gitlab.com/brendanhaines/cpu.git
synced 2024-11-09 21:14:57 -07:00
trying to also use .c files. Not yet working but doesn't break .as files
This commit is contained in:
parent
b79c572a22
commit
2225ccd311
10
Makefile
10
Makefile
|
@ -11,7 +11,13 @@ TESTBENCH_V = hdl/tb/core_tb.v
|
||||||
# ================
|
# ================
|
||||||
# Software options
|
# Software options
|
||||||
# ================
|
# ================
|
||||||
CC = riscv64-linux-gnu-gcc
|
# SOURCE_C = $(wildcard test/*.c)
|
||||||
|
SOURCE_C =
|
||||||
|
SOURCE_AS = $(wildcard test/*.S)
|
||||||
|
OBJ = $(addprefix $(BUILD_DIR)/, $(notdir $(SOURCE_AS:.S=.o)))
|
||||||
|
OBJ += $(addprefix $(BUILD_DIR)/, $(notdir $(SOURCE_C:.c=.o)))
|
||||||
|
|
||||||
|
CC = riscv64-linux-gnu-gcc-8
|
||||||
# CFLAGS = -march=rv32i -mabi=ilp32
|
# CFLAGS = -march=rv32i -mabi=ilp32
|
||||||
CFLAGS = -march=rv64i -mabi=lp64
|
CFLAGS = -march=rv64i -mabi=lp64
|
||||||
|
|
||||||
|
@ -34,7 +40,7 @@ $(BUILD_DIR)/%.o: test/%.S | $(BUILD_DIR)
|
||||||
$(BUILD_DIR)/%.o: test/%.c | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: test/%.c | $(BUILD_DIR)
|
||||||
$(CC) $(CFLAGS) $^ -o $@
|
$(CC) $(CFLAGS) $^ -o $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.elf: test/%.ld $(BUILD_DIR)/%.o | $(BUILD_DIR)
|
$(BUILD_DIR)/%.elf: test/%.ld $(OBJ) | $(BUILD_DIR)
|
||||||
$(LD) $(LDFLAGS) $^ -o $@
|
$(LD) $(LDFLAGS) $^ -o $@
|
||||||
|
|
||||||
%.hex: %.elf
|
%.hex: %.elf
|
||||||
|
|
4
test/main.c
Normal file
4
test/main.c
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user