-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (29 loc) · 804 Bytes
/
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
#
# Robot Vision Module Makefile
#
NAME=vision_module.out
#
# TODO: Do we need to link to all OpenCV libs? Reduce this
#
OPENCV_LDFLAGS := $(shell pkg-config opencv --libs)
OPENCV_CPPFLAGS := $(shell pkg-config opencv --cflags)
CPP=g++
CPPFLAGS=-g -O2 -MMD -std=c++11 -pthread
LDFLAGS=-lrt -pthread
MODULES :=
SOURCES := $(wildcard *.cpp)
-include $(patsubst %, %/module.mk, $(MODULES))
OBJECTS := $(patsubst %.cpp, %.o, $(filter %.cpp,$(SOURCES)))
.PHONY: all
all : compile_all
%.o : %.cpp
$(CPP) $(CPPFLAGS) $(OPENCV_CPPFLAGS) $(INCLUDES) -c -o $@ $<
$(NAME) : $(OBJECTS)
$(CPP) -o $@ $^ $(LDFLAGS) $(OPENCV_LDFLAGS)
.PHONY: compile_all
compile_all: $(NAME)
.PHONY: clean
clean :
@rm -f $(OBJECTS) $(NAME)
@rm -f $(patsubst %.o, %.d, $(filter %.o,$(OBJECTS)))
-include $(OBJECTS:.o=.d)