-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (45 loc) · 1.39 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
55
56
57
58
59
60
61
62
63
64
65
66
67
## Makefile
SHELL = /bin/bash
source_dir := src
binary_dir := bin
data_dir := data
rpcfolder = ./deps/rpclib
program := gtrack
modules := $(shell basename -a $(shell find ./src -mindepth 1 -type d))
sources := $(shell find $(source_dir) -type f -name "*.cpp")
objects := $(patsubst $(source_dir)/%, $(binary_dir)/%, $(subst .cpp,.o, $(sources)))
include_dirs := ./include
include_dirs += $(rpcfolder)/include
CXXFLAGS += -g
CPPFLAGS += $(addprefix -I, $(include_dirs))
CPPFLAGS += `pkg-config opencv4 --cflags` `pkg-config eigen3 --cflags`
LDFLAGS += `pkg-config opencv4 --libs` `pkg-config eigen3 --libs` -lrealsense2 -lpthread -ljsoncpp
LDFLAGS += -L$(rpcfolder)/build -lrpc
_obj_fld := $(dir $(objects))
_build_dirs := $(shell for d in $(_obj_fld) $(data_dir); \
do \
echo -e "$$d\n";\
[ ! -d $$d ] && mkdir -p $$d;\
done)
vpath %.cpp $(source_dir)
#CPPFLAGS += -DGATLAS_DEBUG
#CPPFLAGS += -DDEVINTERFACE_DEBUG
CPPFLAGS += -DHIST_DEBUG
CPPFLAGS += -DMASK_DEBUG
CPPFLAGS += -DARUCO_DEBUG
#CPPFLAGS += -DMMTRACKER_DEBUG
CPPFLAGS += -DRSTRACKER_DEBUG
.PHONY: program
program: $(objects)
$(CXX) -o $(binary_dir)/$(program) $^ $(LDFLAGS)
$(binary_dir)/%.o: $(source_dir)/%.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $^ -o $@
.PHONY: clean
clean:
@rm -fr bin/*
.PHONY: print
print:
@echo "Application: " $(program)
@echo "Modules: " $(modules)
@echo "Sources: " $(sources)
@echo "Objects:" $(objects)