-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
49 lines (41 loc) · 1.02 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
CXXFLAGS=-std=c++0x -g -Wall
SRCS = debug_if.cpp breakpoints.cpp rsp.cpp cache.cpp bridge.cpp memmap.cpp
CXX=g++
ifdef pulpemu
CXXFLAGS+=-DFPGA -DPULPEMU
CXX=arm-linux-gnueabihf-g++
SRCS += mem_zynq_apb_spi.cpp
else ifdef pulpino
CXXFLAGS+=-DFPGA
CXX=arm-xilinx-linux-gnueabi-g++
SRCS += mem_zynq_spi.cpp
else
CXX=g++
SRCS += sim.cpp
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 root@$(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