forked from americast/Snakes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 988 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
CXX := g++
CXXFLAGS := -g -Wall -O3
LDFLAGS := -L/usr/lib -lstdc++ -lm
BUILD := build
PACKAGE := `pkg-config --cflags --libs opencv`
LIBS := -L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d - lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_viz -lopencv_core
OBJ_DIR := obj
APP_DIR := bin
TARGET := snakes
INCLUDE := -Iinclude/
SRC := \
$(wildcard src/*.cpp)\
OBJECTS := $(SRC:%.cpp=$(OBJ_DIR)/%.o)
all: build $(APP_DIR)/$(TARGET)
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ -c $< $(PACKAGE)
$(APP_DIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(INCLUDE) $(LDFLAGS) -o $(APP_DIR)/$(TARGET) $(OBJECTS) $(PACKAGE)
.PHONY: all build clean
build:
@mkdir -p $(APP_DIR)
@mkdir -p $(OBJ_DIR)
clean:
rm -rf build/*