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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or_debug_proxy/] [Makefile] - Blame information for rev 1779

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

Line No. Rev Author Line
1 1779 julius
#
2
#****************************************************************************#
3
#                                                                            #
4
#                    H E A D E R   I N F O R M A T I O N                     #
5
#                                                                            #
6
#****************************************************************************#
7
 
8
# Project Name                   : OpenRISC Debug Proxy
9
# File Name                      : Makefile
10
# Prepared By                    : jb
11
# Project Start                  : 2008-10-01
12
 
13
#$$COPYRIGHT NOTICE#
14
#****************************************************************************#
15
#                                                                            #
16
#                      C O P Y R I G H T   N O T I C E                       #
17
#                                                                            #
18
#****************************************************************************#
19
 
20
#  This library is free software; you can redistribute it and/or
21
#  modify it under the terms of the GNU Lesser General Public
22
#  License as published by the Free Software Foundation;
23
#  version 2.1 of the License, a copy of which is available from
24
#  http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt.
25
#
26
#  This library is distributed in the hope that it will be useful,
27
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
28
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29
#  Lesser General Public License for more details.
30
#
31
#  You should have received a copy of the GNU Lesser General Public
32
#  License along with this library; if not, write to the Free Software
33
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
34
#  USA.
35
#
36
 
37
#$$CHANGE HISTORY#
38
#****************************************************************************#
39
#                                                                            #
40
#                         C H A N G E  H I S T O R Y                         #
41
#                                                                            #
42
#****************************************************************************#
43
 
44
# Date          Version Description
45
#------------------------------------------------------------------------
46
# 090301        0.1.0   Makefile for OpenRISC debug proxy.             jb
47
#  2 Apr 09     0.1.1   Jeremy Bennett. Added static target
48
 
49
#DBGCPPFLAGS=-D DEBUG_GDB=1
50
#DBGCPPFLAGS=-D DEBUG_USB_DRVR_FUNCS=1
51
#DBGCPPFLAGS=-D DEBUG_USB_DRVR_FUNCS=1 -D DEBUG_GDB=1 -D DEBUG_CMDS=1
52
 
53
 
54
# Common Flags
55
COMMON_CPPFLAGS = -I./includes
56
COMMON_CXXFLAGS = -O2 -g
57
COMMON_LDFLAGS  = -Wall -g
58
 
59
# Flags for static library
60
STATIC_LIBDIR   = lib
61
STATIC_LIB      = libftd2xx.a.0.4.16
62
STATIC_LDFLAGS  = $(COMMON_LDFLAGS) $(STATIC_LIBDIR)/$(STATIC_LIB) \
63
                  -lpthread -ldl
64
 
65
#Determine whether we're on Cygwin
66
ifndef OSTYPE
67
        # Basically we're interested in finding out if we're
68
        # in a cygwin environement, so let's find out this way
69
        # Note: Typically in a bash environment, $OSTYPE is set
70
        # but sometimes make can't figure it out. So we'll do it
71
        # this way:
72
        ifeq (CYGWIN, $(findstring CYGWIN, $(shell uname)))
73
                OSTYPE=cygwin
74
        endif
75
endif
76
 
77
ifeq ($(OSTYPE),cygwin)
78
        OR_DEBUG_PROXY_SRC = src/or_debug_proxy.c \
79
                             src/gdb.c \
80
                             src/usb_functions.c \
81
                             src/win_usb_driver_calls.c \
82
                             src/vpi_functions.c
83
        CXX                = gcc
84
        CPPFLAGS           = $(COMMON_CPPFLAGS) -I./obj -DCYGWIN_COMPILE=1 $(DBGCPPFLAGS)
85
        CXXFLAGS           = $(COMMON_CXXFLAGS)
86
        DYNAMIC_LDFLAGS    = $(COMMON_LDFLAGS)
87
        EXE                = .exe
88
else
89
        OR_DEBUG_PROXY_SRC = src/or_debug_proxy.c \
90
                             src/gdb.c \
91
                             src/FT2232c.cpp \
92
                             src/FT2232cMpsseJtag.cpp \
93
                             src/usb_functions.c \
94
                             src/linux_usb_driver_calls.c \
95
                             src/vpi_functions.c
96
        CXX                = g++
97
        CPPFLAGS           = $(COMMON_CPPFLAGS) $(DBGCPPFLAGS)
98
        CXXFLAGS           = $(COMMON_CXXFLAGS)
99
        DYNAMIC_LDFLAGS    = $(COMMON_LDFLAGS) -lftd2xx
100
        EXE                =
101
endif
102
 
103
APP             = or_debug_proxy
104
APP_DYNAMIC = $(APP)$(EXE)
105
APP_STATIC  = $(APP)_static$(EXE)
106
 
107
 
108
# -----------------------------------------------------------------------------
109
# Build dynamic and static targets from scratch
110
.PHONY: all
111
all: clean $(APP_DYNAMIC)
112
 
113
static: clean $(APP_STATIC)
114
 
115
# Dynamic target
116
$(APP_DYNAMIC): $(OR_DEBUG_PROXY_SRC)
117
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $+ $(DYNAMIC_LDFLAGS) -o $@
118
 
119
# Static target
120
$(APP_STATIC): $(OR_DEBUG_PROXY_SRC) $(STATIC_LIBDIR)/$(STATIC_LIB)
121
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $+ $(STATIC_LDFLAGS) -o $@
122
        cp $(APP_STATIC) $(APP)
123
 
124
# -----------------------------------------------------------------------------
125
# Target for checking the static lib is in the place it should be
126
$(STATIC_LIBDIR)/$(STATIC_LIB):
127
        @echo
128
        @echo "The static library, $(STATIC_LIB), is missing."
129
        @echo "Please download the driver to build a statically linked version"
130
        @echo "of this app. For Linux, try:"
131
        @echo "\twget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz"
132
        @echo "\ttar xzf libftd2xx0.4.16.tar.gz"
133
        @echo "\tcp libftd2xx0.4.16/static_lib/libftd2xx.a.0.4.16 lib"
134
        @echo
135
        @exit 1
136
# -----------------------------------------------------------------------------
137
# Tidy up
138
clean:
139
        $(RM) $(APP_DYNAMIC)
140
        $(RM) $(APP_STATIC)
141
        find ./ -name "*~" | xargs $(RM)

powered by: WebSVN 2.1.0

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