forked from hirayaku/DAC2018-TGIIF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 1.25 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
PROJECT = libssd.so
OBJ := main.o dpu_ssd.elf ssd_detector.o prior_boxes.o
CXX := g++
CC := gcc
# linking libraries of OpenCV
# Please modify the line if OpenCV in your borad is installed at a different location
LDFLAGS = -L /opt/opencv/lib/ -lopencv_highgui -lopencv_imgproc -lopencv_core -lopencv_imgcodecs
# LDFLAGS = $(shell pkg-config --libs opencv)
# linking libraries of DNNDK
LDFLAGS += -lhineon -ln2cube -lpthread -ldputils
CUR_DIR = $(shell pwd)
SRC = $(CUR_DIR)/src
BUILD = $(CUR_DIR)/build
MODEL = $(CUR_DIR)/model
VPATH = $(SRC)
SUDO = sudo
DST_DIR = $(CUR_DIR)/TGIIF/libraries/
#DST_DIR = /home/xilinx/jupyter_notebooks/dac_2018/TGIIF/libraries/
CFLAGS := -O3 -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=neon -Wall -Wpointer-arith -std=c++11 -ffast-math -I /opt/opencv/include/ -fPIC -shared -rdynamic
all: $(BUILD) $(PROJECT)
$(PROJECT): $(OBJ)
$(CXX) $(CFLAGS) $(addprefix $(BUILD)/, $^) -o $@ $(LDFLAGS)
%.o : %.cc
$(CXX) -c $(CFLAGS) $< -o $(BUILD)/$@
%.o : %.cpp
$(CXX) -c $(CFLAGS) $< -o $(BUILD)/$@
%.elf :
cp $(MODEL)/$@ $(BUILD)/$@
clean:
$(RM) -r $(BUILD)
$(RM) $(PROJECT)
$(BUILD) :
-mkdir -p $@
copy:
$(SUDO) cp $(CUR_DIR)/$(PROJECT) $(DST_DIR)