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

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [soc/] [sw/] [adv_jtag_bridge/] [Makefile] - Blame information for rev 21

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 xianfeng
prefix = /usr/local
2
 
3
# Your build environment. selects libs, lib dirs, and include dirs
4
# Supported: linux, cygwin
5
BUILD_ENVIRONMENT=linux
6
 
7
# Set this to 'true' if you want to build for the legacy debug unit ('debug_if' core),
8
# leave 'false' if you are building for the Advanced Debug Unit.
9
SUPPORT_LEGACY=false
10
 
11
# Set this to 'true' to include support for cables which require libusb
12
# currently includes Altera USB-Blaster and Xilinx XPC DLC8
13
SUPPORT_USB_CABLES=true
14
 
15
# Set this to 'true' to support cables which require libFTDI
16
# SUPPORT_USB_CABLES must also be set to 'true' to support FTDI-based cables.
17
SUPPORT_FTDI_CABLES=true
18
 
19 21 xianfeng
# Some users have reported failures with the standard libusb-based USBBlaster
20
# driver, but success using a libftdi-based driver.  Set this 'true' to use
21
# this libftdi-based driver.  Do not use except as a last resort - this driver
22
# does not use the USB-Blaster's high speed transfer mode, making it very slow.
23
# SUPPORT_FTDI_CABLES must also be set 'true' to use this driver.
24
USE_ALT_FTDI_USBBLASTER_DRIVER=true
25 12 xianfeng
 
26 21 xianfeng
# Normal error-checking on every word of a burst write can cause a significant
27
# slowdown, especially when using the USB-Blaster cable.  Setting this option
28
# true will eliminate this slowdown, at the cost of per-word error checking.
29
USE_HISPEED=true
30
 
31 12 xianfeng
# ----------------------------------------------------------------------------
32
# Most people shouldn't have to change anything below this line
33
 
34
ifeq ($(BUILD_ENVIRONMENT),linux)
35
# These are for native Linux.  You may need to put the path to libusb into the LIBS variable
36
# with the -L command.
37
CFLAGS = -g -O2 -Wall
38
CC = gcc
39
LIBS = -lpthread
40
INCLUDEDIRS = -I/usr/local/include/libusb-1.0/ -I/usr/local/include/
41
 
42
else
43
 
44
ifeq ($(BUILD_ENVIRONMENT),cygwin)
45
# These are for cygwin.  It assumes libusb.a is in the current directory.
46
CFLAGS = -g -O2 -Wall
47
CC = gcc
48
LIBS = -L. -lioperm -lpthread
49
INCLUDEDIRS = -I/usr/local/include/
50
endif
51
 
52
endif
53
 
54
ifeq ($(SUPPORT_LEGACY),true)
55
CFLAGS +=  -D__LEGACY__
56
endif
57
 
58 21 xianfeng
ifeq ($(USE_HISPEED),true)
59
CFLAGS += -DADBG_OPT_HISPEED
60
endif
61 12 xianfeng
 
62 21 xianfeng
 
63 12 xianfeng
PROGRAMS = adv_jtag_bridge
64
 
65
HEADERS = adv_jtag_bridge.h chain_commands.h opencores_tap.h \
66
        altera_virtual_jtag.h rsp-server.h bsdl.h or32_selftest.c cable_common.h \
67
        cable_parallel.h cable_sim.h \
68
        bsdl_parse.h errcodes.h spr-defs.h except.h adv_dbg_commands.h dbg_api.h \
69
        legacy_dbg_commands.h
70
 
71
SOURCES = adv_jtag_bridge.c rsp-server.c chain_commands.c cable_common.c bsdl.c \
72
        or32_selftest.c cable_parallel.c cable_sim.c \
73
        bsdl_parse.c errcodes.c adv_dbg_commands.c dbg_api.c legacy_dbg_commands.c
74
 
75
OBJECTS = adv_jtag_bridge.o rsp-server.o chain_commands.o cable_common.o bsdl.o \
76
        or32_selftest.o cable_parallel.o cable_sim.o \
77
        bsdl_parse.o errcodes.o adv_dbg_commands.o dbg_api.o legacy_dbg_commands.o
78
 
79
 
80
ifeq ($(SUPPORT_USB_CABLES),true)
81
CFLAGS += -D__SUPPORT_USB_CABLES__
82 21 xianfeng
HEADERS += cable_xpc_dlc9.h
83
SOURCES += cable_xpc_dlc9.c
84
OBJECTS += cable_xpc_dlc9.o
85 12 xianfeng
 
86 21 xianfeng
ifeq ($(USE_ALT_FTDI_USBBLASTER_DRIVER),false)
87
HEADERS += cable_usbblaster.h
88
SOURCES += cable_usbblaster.c
89
OBJECTS += cable_usbblaster.o
90
endif
91
 
92 12 xianfeng
ifeq ($(SUPPORT_FTDI_CABLES),true)
93
CFLAGS += -D__SUPPORT_FTDI_CABLES__
94
LIBS += -lftdi
95
HEADERS += cable_ft2232.h
96
SOURCES += cable_ft2232.c
97
OBJECTS += cable_ft2232.o
98 21 xianfeng
 
99
ifeq ($(USE_ALT_FTDI_USBBLASTER_DRIVER),true)
100
HEADERS += cable_usbblaster.h
101
SOURCES += cable_usbblaster_ftdi.c
102
OBJECTS += cable_usbblaster_ftdi.o
103 12 xianfeng
endif
104
 
105 21 xianfeng
endif
106
 
107 12 xianfeng
# libusb must follow libftdi in the list of libraries
108
LIBS += -lusb
109
endif
110
 
111
 
112
all: $(PROGRAMS)
113
 
114
default: $(PROGRAMS)
115
 
116
.c.o:
117
        $(CC) $(CFLAGS) -c $<
118
 
119
adv_jtag_bridge: Makefile $(OBJECTS) $(HEADERS)
120
        rm -f $@
121
        $(CC) -o $@ $(CFLAGS) $(OBJECTS) $(LIBS) $(INCLUDEDIRS)
122
 
123
 
124
install: all
125
        [ -d $(prefix)/bin ] || mkdir -p $(prefix)/bin
126
        for p in $(PROGRAMS) ; do \
127
            /bin/rm -f $(prefix)/bin/$$p; \
128
            /bin/cp -p $$p $(prefix)/bin/$$p; \
129
        done
130
 
131
clean: Makefile
132
        rm -f $(PROGRAMS) *.o *~

powered by: WebSVN 2.1.0

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