-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 812 Bytes
/
Makefile
File metadata and controls
44 lines (33 loc) · 812 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Cross-compiler
CC = g++
# C building settings
CFLAGS = -O2 -ansi -Wall `pkg-config --cflags opencv` -std=c++11
LIBS = `pkg-config --libs opencv`
# C++ source and object files
C_DIR = src
C_SRC = $(wildcard $(C_DIR)/*.cpp)
C_OBJ = $(C_SRC:$(C_DIR)/%.cpp=$(OBJ_DIR)/%.o)
# Object files directory
OBJ_DIR = obj
# Header source files
INC_DIR = include
HEADERS_SRC = $(wildcard $(INC_DIR)/*.hpp)
# All object files
OBJ = $(C_OBJ)
# Executable kernel file
EXEC = opencv2
.PHONY: all
all: $(EXEC)
$(EXEC): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
$(OBJ_DIR)/%.o: $(C_DIR)/%.cpp $(HEADERS_SRC)
$(CC) $(CFLAGS) -I./$(INC_DIR) -c $< -o $@
.PHONY: clean
clean:
-rm -f $(EXEC) $(OBJ_DIR)/*.o
.PHONY: print
print:
@echo C src: $(C_SRC)
@echo Obj: $(OBJ)
@echo Exec: $(EXEC)
@echo Header: $(HEADERS_SRC)