From 39c3f408e58bd0eb6b62638071f8de3e2659465b Mon Sep 17 00:00:00 2001 From: Mateusz Holenko Date: Wed, 10 Jul 2019 10:39:47 +0200 Subject: [PATCH] Create makefile targets Allow to change build target without modifiying the sources. In order to keep compatibilty `sim` target is built by default. --- src/main/c/emulator/makefile | 6 ++++++ src/main/c/emulator/src/config.h | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/c/emulator/makefile b/src/main/c/emulator/makefile index e861785..d9d9098 100755 --- a/src/main/c/emulator/makefile +++ b/src/main/c/emulator/makefile @@ -12,6 +12,12 @@ SRCS = $(wildcard src/*.c) \ LDSCRIPT = ${STANDALONE}/common/ram.ld +sim: CFLAGS += -DSIM +sim: all + +qemu: CFLAGS += -DQEMU +qemu: all + include ${STANDALONE}/common/riscv64-unknown-elf.mk include ${STANDALONE}/common/standalone.mk diff --git a/src/main/c/emulator/src/config.h b/src/main/c/emulator/src/config.h index 6e251ad..afce2d5 100644 --- a/src/main/c/emulator/src/config.h +++ b/src/main/c/emulator/src/config.h @@ -1,9 +1,6 @@ #ifndef CONFIG_H #define CONFIG_H -//#define QEMU -#define SIM - #ifndef OS_CALL #define OS_CALL 0xC0000000 #endif