forked from pulp-platform/debug_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
CXXFLAGS=-std=c++0x -g
SRCS = debug_if.cpp breakpoints.cpp rsp.cpp cache.cpp bridge.cpp
CXX=g++
SRCS += sim.cpp
ifdef pulpemu
CXXFLAGS+=-DFPGA -DPULPEMU
CXX=arm-linux-gnueabihf-g++
SRCS += mem_zynq_apb_spi.cpp
endif
ifdef pulpino
CXXFLAGS+=-DFPGA
CXX=arm-xilinx-linux-gnueabi-g++
SRCS += mem_zynq_spi.cpp
endif
ifndef pulpino
ifndef pulpemu
CXX=g++
SRCS += sim.cpp
endif
endif
EXE_SRCS = main.cpp $(SRCS)
LIB_SRCS = $(SRCS)
ifdef GEN_LIB
all: debug_bridge libdebugbridge.so
else
all: debug_bridge
endif
clean:
rm -f ./*.o
rm -f ./debug_bridge
rm -f ./libdebugbridge.so
debug_bridge: $(EXE_SRCS)
$(CXX) $(CXXFLAGS) -o $@ $^
libdebugbridge.so: $(LIB_SRCS)
$(CXX) $(CXXFLAGS) -g -O3 -fPIC -shared -o $@ $^
ifdef pulpino
push: debug_bridge
scp ./debug_bridge $(FPGA_HOSTNAME):/root/
endif
sdk:
make clean all GEN_LIB=1
mkdir -p $(PULP_SDK_HOME)/install/ws/lib
mkdir -p $(PULP_SDK_HOME)/install/ws/include
cp *.h $(PULP_SDK_HOME)/install/ws/include
cp debug_bridge $(PULP_SDK_HOME)/install/ws/bin
cp libdebugbridge.so $(PULP_SDK_HOME)/install/ws/lib