OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [makefiles/] [make_cpu_fnc_plugin] - Rev 2

Go to most recent revision | 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

CC=gcc
CPP=gcc
CFLAGS=-g -c -Wall -Werror -fPIC -pthread
LDFLAGS=-shared -pthread -L$(PLUGINS_ELF_DIR)/..
INCL_KEY=-I
DIR_KEY=-B


# include sub-folders list
INCL_PATH= \
        $(TOP_DIR)src/common

# source files directories list:
SRC_PATH =\
        $(TOP_DIR)src/common \
        $(TOP_DIR)src/cpu_fnc_plugin

VPATH = $(SRC_PATH)

SOURCES = \
        attribute \
        autobuffer \
        async_tqueue \
        plugin_init \
        cpu_riscv_func \
        riscv-rv64i-user \
        riscv-rv64i-priv \
        instructions \
        riscv-ext-a \
        riscv-ext-m \
        riscv-ext-f

LIBS = \
        m \
        stdc++ \
        dbg64g

SRC_FILES = $(addsuffix .cpp,$(SOURCES))
OBJ_FILES = $(addprefix $(PLUGINS_OBJ_DIR)/,$(addsuffix .o,$(SOURCES)))
EXECUTABLE = $(addprefix $(PLUGINS_ELF_DIR)/,cpu_fnc_plugin.so)

all: $(EXECUTABLE)

all: $(EXECUTABLE)

$(EXECUTABLE): $(OBJ_FILES)
        echo $(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@
        $(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@ $(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 $@

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.