OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [or_debug_proxy/] [Makefile] - Diff between revs 353 and 498

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 353 Rev 498
Line 32... Line 32...
#  License along with this library; if not, write to the Free Software
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
#  USA.
#  USA.
#
#
 
 
#$$CHANGE HISTORY#
 
#****************************************************************************#
 
#                                                                            #
 
#                         C H A N G E  H I S T O R Y                         #
 
#                                                                            #
 
#****************************************************************************#
 
 
 
# Date          Version Description
 
#------------------------------------------------------------------------
 
# 090301        0.1.0   Makefile for OpenRISC debug proxy.              jb
 
#  2 Apr 09     0.1.1   Jeremy Bennett. Added static target
 
#  1 May 09     0.1.3   Added specific make target for VPI              jb
 
# 090828        0.1.4   Added ftdi_sio driver reload rule               jb
 
 
 
#DBGCPPFLAGS=-DDEBUG_GDB=1
#DBGCPPFLAGS=-DDEBUG_GDB=1
#DBGCPPFLAGS=-DDEBUG_USB_DRVR_FUNCS=1
#DBGCPPFLAGS=-DDEBUG_USB_DRVR_FUNCS=1
#DBGCPPFLAGS=-DDEBUG_USB_DRVR_FUNCS=1 -DDEBUG_GDB=1 -DDEBUG_CMDS=1
#DBGCPPFLAGS=-DDEBUG_USB_DRVR_FUNCS=1 -DDEBUG_GDB=1 -DDEBUG_CMDS=1
 
 
Line 57... Line 44...
COMMON_CXXFLAGS = -O3
COMMON_CXXFLAGS = -O3
COMMON_LDFLAGS  =
COMMON_LDFLAGS  =
 
 
# Flags for static library
# Flags for static library
STATIC_LIBDIR   = lib
STATIC_LIBDIR   = lib
STATIC_LIB      = libftd2xx.a.0.4.16
STATIC_LIB      = libftd2xx.a
STATIC_LDFLAGS  = $(COMMON_LDFLAGS) $(STATIC_LIBDIR)/$(STATIC_LIB) \
STATIC_LDFLAGS  = $(COMMON_LDFLAGS) $(STATIC_LIBDIR)/$(STATIC_LIB) \
                  -lpthread -ldl
                  -lrt -lpthread -ldl
# Defines to enable certain endpoint handling functions to be used
# Defines to enable certain endpoint handling functions to be used
USB_FLAGS          = -D USB_ENDPOINT_ENABLED=1
USB_FLAGS          = -D USB_ENDPOINT_ENABLED=1
VPI_FLAGS          = -D VPI_ENDPOINT_ENABLED=1
 
 
 
#Determine whether we're on Cygwin
#Determine whether we're on Cygwin
ifndef OSTYPE
ifndef OSTYPE
        # Basically we're interested in finding out if we're
        # Basically we're interested in finding out if we're
        # in a cygwin environement, so let's find out this way
        # in a cygwin environement, so let's find out this way
Line 93... Line 79...
                             src/gdb.c
                             src/gdb.c
        OR_DEBUG_PROXY_USB_SRC = src/FT2232c.cpp \
        OR_DEBUG_PROXY_USB_SRC = src/FT2232c.cpp \
                             src/FT2232cMpsseJtag.cpp \
                             src/FT2232cMpsseJtag.cpp \
                             src/usb_functions.c \
                             src/usb_functions.c \
                             src/linux_usb_driver_calls.c
                             src/linux_usb_driver_calls.c
        OR_DEBUG_PROXY_VPI_SRC = src/vpi_functions.c
 
        CXX                = g++
        CXX                = g++
        CPPFLAGS           = $(COMMON_CPPFLAGS) $(DBGCPPFLAGS)
        CPPFLAGS           = $(COMMON_CPPFLAGS) $(DBGCPPFLAGS)
        CXXFLAGS           = $(COMMON_CXXFLAGS)
        CXXFLAGS           = $(COMMON_CXXFLAGS)
        DYNAMIC_LDFLAGS    = $(COMMON_LDFLAGS) -lftd2xx
        DYNAMIC_LDFLAGS    = $(COMMON_LDFLAGS) -lftd2xx
        EXE                =
        EXE                =
endif
endif
 
 
APP             = or_debug_proxy
APP             = or_debug_proxy
APP_DYNAMIC = $(APP)$(EXE)
APP_DYNAMIC = $(APP)$(EXE)
APP_STATIC  = $(APP)_static$(EXE)
APP_STATIC  = $(APP)_static$(EXE)
APP_VPI     = $(APP)_vpi$(EXE)
 
 
 
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Build dynamic and static targets from scratch
# Build dynamic and static targets from scratch
.PHONY: all
.PHONY: all
all: clean $(APP_DYNAMIC)
all: clean $(APP_DYNAMIC)
 
 
static: clean $(APP_STATIC)
static: clean $(APP_STATIC)
 
 
vpi: clean $(APP_VPI)
 
 
 
# Dynamic target
# Dynamic target
$(APP_DYNAMIC): $(OR_DEBUG_PROXY_SRC) $(OR_DEBUG_PROXY_USB_SRC)
$(APP_DYNAMIC): $(OR_DEBUG_PROXY_SRC) $(OR_DEBUG_PROXY_USB_SRC)
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(USB_FLAGS) $+ $(DYNAMIC_LDFLAGS) -o $@
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(USB_FLAGS) $+ $(DYNAMIC_LDFLAGS) -o $@
 
 
# Static target
# Static target
$(APP_STATIC): $(OR_DEBUG_PROXY_SRC) $(OR_DEBUG_PROXY_USB_SRC) $(STATIC_LIBDIR)/$(STATIC_LIB)
$(APP_STATIC): $(OR_DEBUG_PROXY_SRC) $(OR_DEBUG_PROXY_USB_SRC) $(STATIC_LIBDIR)/$(STATIC_LIB)
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(USB_FLAGS) $+ $(STATIC_LDFLAGS) -o $@
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(USB_FLAGS) $+ $(STATIC_LDFLAGS) -o $@
        cp $(APP_STATIC) $(APP)
        cp $(APP_STATIC) $(APP)
 
 
# VPI target only
 
$(APP_VPI): $(OR_DEBUG_PROXY_SRC) $(OR_DEBUG_PROXY_VPI_SRC)
 
        $(CXX) $(CPPFLAGS) $(VPI_FLAGS) $(CXXFLAGS) $+ -o $@
 
 
 
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Target for checking the static lib is in the place it should be
# Target for checking the static lib is in the place it should be
$(STATIC_LIBDIR)/$(STATIC_LIB):
$(STATIC_LIBDIR)/$(STATIC_LIB):
        @echo
        @echo
        @echo "The static library, $(STATIC_LIB), is missing."
        @echo "The static library, $(STATIC_LIB), is missing."
        @echo "Please download the driver to build a statically linked version"
        @echo "Please download the driver to build a statically linked version"
        @echo "of this app. For Linux, try:"
        @echo "of this app. For 32-bit Linux, try:"; echo
        @echo "\twget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz"
        @echo "\twget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx1.0.4.tar.gz"
        @echo "\ttar xzf libftd2xx0.4.16.tar.gz"
        @echo "\ttar xzf libftd2xx1.0.4.tar.gz"
        @echo "\tcp libftd2xx0.4.16/static_lib/libftd2xx.a.0.4.16 lib"
        @echo "\tcp libftd2xx1.0.4/build/i386/libftd2xx.a lib"
        @echo
        @echo
        @exit 1
        @exit 1
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Tidy up
# Tidy up
clean:
clean:
        $(RM) $(APP_DYNAMIC)
        $(RM) $(APP_DYNAMIC)
        $(RM) $(APP_STATIC)
        $(RM) $(APP_STATIC)
        $(RM) $(APP_VPI)
 
        find ./ -name "*~" | xargs $(RM)
        find ./ -name "*~" | xargs $(RM)
 
 
ifneq ($(OSTYPE),cygwin)
ifneq ($(OSTYPE),cygwin)
reset_driver:
reset_driver:
        @echo; echo "    Re-installing FTDI serial IO drivers"echo
        @echo; echo "    Re-installing FTDI serial IO drivers"echo

powered by: WebSVN 2.1.0

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