-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
119 lines (67 loc) · 2.98 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
########################################################################
####################### Makefile Template ##############################
########################################################################
OPT = -O0
# Armadillo
## As the Armadillo library uses recursive templates, compilation times depend on the level of optimisation:
##
## -O0: quick compilation, but the resulting program will be slow
## -O1: good trade-off between compilation time and execution speed
## -O2: produces programs which have almost all possible speedups, but compilation takes longer
## -O3: enables auto vectorisation when using gcc
#-------------------------------------------------------------------------------------------
# OpenCV
OPENCV_SRC_DIR := /usr/local/include/opencv4
OPENCV = `pkg-config opencv4 --cflags --libs`
OPENCVLIBRARIES = $(OPENCV)
#-------------------------------------------------------------------------------------------
# ARDroneSDK3
VISP_BUILD_DIR = /home/rodrigo/RESEARCH/visp-ws/visp-build
VISP_CFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --cflags`
VISP_LDFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --libs`
VISP_shared = -Wl,-rpath=/home/rodrigo/RESEARCH/visp-ws/visp-build/lib
VISP_lib = /home/rodrigo/RESEARCH/visp-ws/visp-build/lib
# Eigen
EIGEN_SRC_DIR := /usr/include/eigen3 # The place you unpacked or cloned Eigen.
#-------------------------------------------------------------------------------------------
# bebopcampure (this app)
LIB_DEPENDENCIES := -lpthread -lboost_system -lboost_thread
LIB_DEPENDENCIES_DIR := /usr/local/lib
LIB_DIR := lib
LIB_INCLUDE := include
BIN := bin
OBJ := obj
SRC := src
# Extra source code directories
CPPsrc = $(wildcard src/*.cpp) \
#-------------------------------------------------------------------------------------------
DEBUG = -ggdb
CXX := g++
CXX_FLAGS := -pthread -Wfatal-errors -g -Wall -Wextra -std=c++11 -fpermissive -static $(DEBUG) $(OPT)
#-fpermissive
INCLUDE := -I$(LIB_INCLUDE) -I$(OPENCV_SRC_DIR) -I$(EIGEN_SRC_DIR)
INCLUDE2 :=
LIB := -L$(LIB_DIR) -L$(LIB_DEPENDENCIES_DIR) -L$(VISP_lib)
LIBRARIES := $(LIB_DEPENDENCIES) $(LIB_ARDrone_DEP)
EXECUTABLE := bebop2capture
APPLICATION_OBJS = $(CPPsrc:.cpp=.o)
.PHONY: all
all: $(BIN)/$(EXECUTABLE)
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXX_FLAGS) $(INCLUDE) $(VISP_CFLAGS)
$(BIN)/$(EXECUTABLE):$(APPLICATION_OBJS)
$(CXX) -o $(BIN)/$(EXECUTABLE) $(APPLICATION_OBJS) $(VISP_shared)$(LIB) $(LIB_DEPENDENCIES) $(OPENCVLIBRARIES) $(VISP_LDFLAGS)
$(shell mkdir -p $(BIN))
run: clean all
#clear
./$(BIN)/$(EXECUTABLE)
clean:
-rm $(BIN)/*
-rm $(APPLICATION_OBJS)
#SRCDIR := $(CPPsrc)
#SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
#OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
#$(OBJ)/%.o: %.cpp
# $(CXX) -c -o $@ $< $(CXX_FLAGS) $(INCLUDE)
#$(OBJ)/$(EXECUTABLE):$(OBJ)/*.o
# $(CXX) $(APPLICATION_OBJS) $(LIB) $(OPENCVLIBRARIES) $(LIBRARIES) -o $(BIN)/$(EXECUTABLE)