-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 858 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 858 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
# Define the C++ compiler
CXX = g++
# Define any compile-time flags
CXXFLAGS = -Wall -std=c++11 $(shell pkg-config --cflags opencv4)
# Define any libraries to link into executable
LDFLAGS = $(shell pkg-config --libs opencv4)
# Define the source files, header files, and the resultant executable
SRCS = ZhangWan24.cpp
HEADERS = ZhangWan24.hpp
OBJS = $(SRCS:.cpp=.o)
MAIN = ZhangWan24
.PHONY: depend clean
all: $(MAIN)
@echo Compiled $(MAIN) successfully!
$(MAIN): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(MAIN) $(OBJS) $(LDFLAGS)
# This is a suffix replacement rule for building .o's from .cpp's
# It uses automatic variables $<: the name of the prerequisite of the rule (a .cpp file)
# and $@: the name of the target of the rule (a .o file)
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
$(RM) *.o *~ $(MAIN)
depend: $(SRCS)
makedepend $(CXXFLAGS) $^