URL
https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk
Subversion Repositories riscv_vhdl
[/] [riscv_vhdl/] [trunk/] [debugger/] [makefiles/] [make_cpu_sysc_plugin] - Rev 4
Compare with Previous | Blame | View Log
###
## @file
## @copyright Copyright 2016 GNSS Sensor Ltd. All right reserved.
## @author Sergey Khabarov - sergeykhbr@gmail.com
##
include util.mak
ifeq ($(SYSTEMC_SRC), )
$(error SYSTEMC_SRC variable must be defined)
endif
ifeq ($(SYSTEMC_LIB), )
$(error SYSTEMC_LIB variable must be defined)
endif
CC=gcc
CPP=gcc
CFLAGS=-g -c -Wall -Werror -fPIC -pthread
LDFLAGS=-shared -pthread -L$(SYSTEMC_LIB) -L$(PLUGINS_ELF_DIR)/..
INCL_KEY=-I
DIR_KEY=-B
# include sub-folders list
INCL_PATH= \
$(SYSTEMC_SRC) \
$(TOP_DIR)src/common
# source files directories list:
SRC_PATH =\
$(TOP_DIR)src/common \
$(TOP_DIR)src/common/generic \
$(TOP_DIR)src/cpu_sysc_plugin \
$(TOP_DIR)src/cpu_sysc_plugin/riverlib \
$(TOP_DIR)src/cpu_sysc_plugin/riverlib/core \
$(TOP_DIR)src/cpu_sysc_plugin/riverlib/core/arith \
$(TOP_DIR)src/cpu_sysc_plugin/riverlib/cache
VPATH = $(SRC_PATH)
SOURCES = \
attribute \
autobuffer \
async_tqueue \
plugin_init \
cpu_riscv_rtl \
rtl_wrapper \
river_top \
icache \
dcache \
cache_top \
int_mul \
int_div \
shift \
br_predic \
csr \
decoder \
execute \
fetch \
memaccess \
proc \
regibank \
stacktrbuf \
dbg_port
LIBS = \
dbg64g \
pthread \
m \
stdc++
SRC_FILES = $(addsuffix .cpp,$(SOURCES))
OBJ_FILES = $(addprefix $(PLUGINS_OBJ_DIR)/,$(addsuffix .o,$(SOURCES)))
EXECUTABLE = $(addprefix $(PLUGINS_ELF_DIR)/,cpu_sysc_plugin.so)
all: $(EXECUTABLE)
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJ_FILES)
echo $(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@ -Wl,-Bstatic -lsystemc -Wl,-Bdynamic $(addprefix -l,$(LIBS))
$(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@ -Wl,-Bstatic -lsystemc -Wl,-Bdynamic $(addprefix -l,$(LIBS))
$(ECHO) "\n Plugin '"$@"' has been built successfully.\n"
$(addprefix $(PLUGINS_OBJ_DIR)/,%.o): %.cpp
echo $(CPP) $(CFLAGS) -std=c++0x $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@
$(CPP) $(CFLAGS) -std=c++0x $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@
$(addprefix $(PLUGINS_OBJ_DIR)/,%.o): %.c
echo $(CC) $(CFLAGS) -std=c99 $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@
$(CC) $(CFLAGS) -std=c99 $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@