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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [makefiles/] [make_appdbg64g] - 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 -std=c++0x
LDFLAGS=-L$(ELF_DIR)
INCL_KEY=-I
DIR_KEY=-B


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

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

VPATH = $(SRC_PATH)

SOURCES = \
        attribute \
        autobuffer \
        main

LIBS = \
        m \
        stdc++ \
        dbg64g

SRC_FILES = $(addsuffix .cpp,$(SOURCES))
OBJ_FILES = $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(SOURCES)))
EXECUTABLE = $(addprefix $(ELF_DIR)/,appdbg64g.exe)

all: $(EXECUTABLE)

$(EXECUTABLE): $(OBJ_FILES)
        echo $(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@
        $(CPP) $(LDFLAGS) $(OBJ_FILES) -o $@ $(addprefix -l,$(LIBS))
        # Generate starting scripts:
        @echo "#!/bin/bash\nexport LD_LIBRARY_PATH=\$$(pwd):\$$(pwd)/qtlib\n./appdbg64g.exe -c ../../targets/functional_sim_gui.json \"\$$@\"" > $(ELF_DIR)/_run_functional_sim.sh
        @echo "#!/bin/bash\nexport LD_LIBRARY_PATH=\$$(pwd):\$$(pwd)/qtlib\n./appdbg64g.exe -c ../../targets/sysc_river_gui.json \"\$$@\"" > $(ELF_DIR)/_run_systemc_sim.sh
        @echo "#!/bin/bash\nexport LD_LIBRARY_PATH=\$$(pwd):\$$(pwd)/qtlib\n./appdbg64g.exe -c ../../targets/fpga_gui.json \"\$$@\"" > $(ELF_DIR)/_run_fpga_gui.sh
        @echo "#!/bin/bash\nexport LD_LIBRARY_PATH=\$$(pwd):\$$(pwd)/qtlib\ngdb --args ./appdbg64g.exe -c ../../targets/functional_sim_gui.json \"\$$@\"" > $(ELF_DIR)/_run_gdb.sh
        chmod +x $(ELF_DIR)/_run_functional_sim.sh
        chmod +x $(ELF_DIR)/_run_systemc_sim.sh
        chmod +x $(ELF_DIR)/_run_fpga_gui.sh
        chmod +x $(ELF_DIR)/_run_gdb.sh
        $(ECHO) "\n  Debugger Test application has been built successfully."
        $(ECHO) "  To start debugger use one of the prepared targets scripts:."
        $(ECHO) "      cd ../linuxbuild/bin"
        $(ECHO) "      ./_run_functional_sim.sh     - Start functional simulation"
        $(ECHO) "      ./_run_systemc_sim.sh        - Start cycle-true SystemC simulation"
        $(ECHO) "      ./_run_fpga_gui.sh           - Start with FPGA (COM3, 195.168.0.53)\n"

$(addprefix $(OBJ_DIR)/,%.o): %.cpp
        echo $(CPP) $(CFLAGS) $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@
        $(CPP) $(CFLAGS) $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@

$(addprefix $(OBJ_DIR)/,%.o): %.c
        echo $(CC) $(CFLAGS) $(addprefix $(INCL_KEY),$(INCL_PATH)) $< -o $@
        $(CC) $(CFLAGS) $(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.