-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
29 lines (22 loc) · 750 Bytes
/
makefile
File metadata and controls
29 lines (22 loc) · 750 Bytes
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
CC := g++
debug: CXXFLAGS = -std=c++17 -Wall -Wextra -ggdb
release: CXXFLAGS = -std=c++17 -Wall -Wextra -O1
LDFLAGS := `pkg-config --libs --cflags opencv` -lpthread
TARGET := Test
INCLUDE_DIR := Include/
SOURCE_DIR := Source/
BUILD_DIR := Build/
BINARY_DIR := Bin/
SOURCE := $(shell find $(SOURCE_DIR) -name "*.cpp")
OBJECT := $(patsubst $(SOURCE_DIR)%.cpp, $(BUILD_DIR)%.o, $(SOURCE))
all: release
debug: pre_build $(OBJECT)
$(CC) $(OBJECT) $(LDFLAGS) -o $(BINARY_DIR)$(TARGET)Debug
release: pre_build $(OBJECT)
$(CC) $(OBJECT) $(LDFLAGS) -o $(BINARY_DIR)$(TARGET)
$(BUILD_DIR)%.o: $(SOURCE_DIR)%.cpp
$(CC) -I $(INCLUDE_DIR) $(CXXFLAGS) -c $< -o $@
pre_build:
mkdir -p $(BUILD_DIR) $(BINARY_DIR)
clean:
rm -rf $(BUILD_DIR) $(BINARY_DIR)