forked from pixop/video-compare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
52 lines (42 loc) · 1.4 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
CXXFLAGS = -g3 -Ofast -std=c++14 -D__STDC_CONSTANT_MACROS \
-Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations \
-Wdisabled-optimization -Wctor-dtor-privacy \
-Woverloaded-virtual -Wno-unused -Wno-missing-field-initializers
ifeq ($(findstring CYGWIN_NT-10.0, $(shell uname)), CYGWIN_NT-10.0)
CXX = x86_64-w64-mingw32-g++
CXXFLAGS += -Iffmpeg-5.1.2-full_build-shared/include/
LDLIBS = -Lffmpeg-5.1.2-full_build-shared/lib/ -lavformat -lavcodec -lavfilter -lavutil -lswresample -lswscale -lSDL2 -lSDL2_ttf
else
CXX = g++
LDLIBS = -lavformat -lavcodec -lavfilter -lavutil -lswscale -lSDL2 -lSDL2_ttf -pthread
endif
ifneq "$(wildcard /opt/homebrew)" ""
CXXFLAGS += -I/opt/homebrew/include/
LDLIBS += -L/opt/homebrew/lib/
BINDIR = /opt/homebrew/bin/
else ifneq "$(wildcard /opt/local)" ""
CXXFLAGS += -I/opt/local/include/
LDLIBS += -L/opt/local/lib/
BINDIR = /opt/local/bin/
else
CXXFLAGS += -I/usr/local/include/
LDLIBS += -L/usr/local/lib/
BINDIR = /usr/local/bin/
endif
src = $(wildcard *.cpp)
obj = $(src:.cpp=.o)
dep = $(obj:.o=.d)
target = video-compare
all: $(target)
$(target): $(obj)
$(CXX) -o $@ $^ $(LDLIBS)
-include $(dep)
%.d: %.cpp
@$(CXX) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
test: $(target)
./$(target) -w 800x screenshot_1.jpg screenshot_2.jpg
.PHONY: clean
clean:
$(RM) $(obj) $(target) $(dep)
install: $(target)
install -s video-compare $(BINDIR)