Makefile: add a target for an "accumulate" effect
[experiments/opencv_trail_effect.git] / Makefile
1 CXXFLAGS = -std=c++11 -pedantic -pedantic-errors -Wall -g3 -O2 -D_ANSI_SOURCE_
2 CXXFLAGS += -fno-common \
3             -fvisibility=hidden \
4             -Wall \
5             -Wextra \
6             -Wformat=2 \
7             -Winit-self \
8             -Winline \
9             -Wpacked \
10             -Wpointer-arith \
11             -Wlarger-than-65500 \
12             -Wmissing-declarations \
13             -Wmissing-format-attribute \
14             -Wmissing-noreturn \
15             -Wredundant-decls \
16             -Wsign-compare \
17             -Wstrict-aliasing=2 \
18             -Wswitch-enum \
19             -Wundef \
20             -Wunreachable-code \
21             -Wwrite-strings \
22             -Wp,-D_FORTIFY_SOURCE=2 \
23             -fstack-protector \
24             --param=ssp-buffer-size=4
25
26 COMPILER = $(shell $(CXX) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
27
28 ifeq ($(COMPILER), gcc)
29   CXXFLAGS += -Wunsafe-loop-optimizations \
30               -Wunused-but-set-variable
31 endif
32
33 ifeq ($(COMPILER), clang)
34   LDFLAGS += -Qunused-arguments
35 endif
36
37 CXXFLAGS += $(shell pkg-config --cflags opencv4 | sed -e 's/-I/-isystem/g')
38 LDLIBS += $(shell pkg-config --libs opencv4)
39
40 LINK.o = $(LINK.cpp)
41 opencv_trail_effect:
42
43 opencv_trail_effect.o: $(wildcard *.hpp)
44
45 # Some command lines to imitate different trail styles
46
47 blame_it_on_the_boogie: opencv_trail_effect
48         ./opencv_trail_effect -l 12 -s background -d fadeaccumulate
49
50 wtf: opencv_trail_effect
51         ./opencv_trail_effect -l -1 -s background -d copy
52
53 l_anima_vola: opencv_trail_effect
54         ./opencv_trail_effect -l 30 -s background -d copy -r
55
56 average: opencv_trail_effect
57         ./opencv_trail_effect -l 10 -s background -d average -B
58
59 accumulate: opencv_trail_effect
60         ./opencv_trail_effect -b 0 -t 5 -l 25 -s threshold -d accumulate
61
62 clean:
63         rm -f *.o opencv_trail_effect vgdump gtk.suppression
64
65 test: opencv_trail_effect
66         [ -f gtk.suppression ] || wget -nv https://people.gnome.org/~johan/gtk.suppression
67         G_DEBUG=gc-friendly G_SLICE=always-malloc \
68                 valgrind --tool=memcheck --leak-check=full --leak-resolution=high \
69                 --num-callers=20 --log-file=vgdump \
70                 --suppressions=gtk.suppression ./opencv_trail_effect