-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.in
206 lines (173 loc) · 6.93 KB
/
Makefile.in
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
GTEST_DIR ?= /usr/src/gtest
# This will be upgraded for each release, although not necessarily for every git commit.
# See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# for the rules as of how this is changed. This does not really mean that Movit will
# strive towards having a rock-stable ABI, but at least the soversion will increase
# whenever it breaks, so that you will not have silent failures, and distribution package
# management can run its course.
movit_ltversion = 8:2:0
movit_version = 1.6.2
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
libdir = @libdir@
datarootdir = @datarootdir@
datadir = @datadir@
top_builddir = @top_builddir@
with_demo_app = @with_demo_app@
with_benchmark = @with_benchmark@
with_coverage = @with_coverage@
CC=@CC@
CXX=@CXX@
CXXFLAGS=-Wall @CXXFLAGS@ -fvisibility-inlines-hidden -I$(GTEST_DIR)/include @SDL2_CFLAGS@ @Eigen3_CFLAGS@ @epoxy_CFLAGS@ @FFTW3_CFLAGS@ @benchmark_CFLAGS@
ifeq ($(with_benchmark),yes)
CXXFLAGS += -DHAVE_BENCHMARK
endif
LDFLAGS=@LDFLAGS@
LDLIBS=@epoxy_LIBS@ @FFTW3_LIBS@ -lpthread
TEST_LDLIBS=@epoxy_LIBS@ @SDL2_LIBS@ @benchmark_LIBS@ -lpthread
DEMO_LDLIBS=@SDL2_image_LIBS@ -lrt -lpthread @libpng_LIBS@ @FFTW3_LIBS@
SHELL=@SHELL@
LIBTOOL=@LIBTOOL@ --tag=CXX
RANLIB=ranlib
INSTALL=install
MKDIR=mkdir
ifeq ($(with_coverage),yes)
CXXFLAGS += -fprofile-arcs -ftest-coverage --coverage
LDFLAGS += -fprofile-arcs -ftest-coverage
LDLIBS += -lgcov
endif
DEMO_OBJS=demo.o widgets.o
# Inputs.
TESTED_INPUTS = flat_input
TESTED_INPUTS += ycbcr_input
TESTED_INPUTS += ycbcr_422interleaved_input
INPUTS = $(TESTED_INPUTS) $(UNTESTED_INPUTS)
# Effects.
TESTED_EFFECTS = lift_gamma_gain_effect
TESTED_EFFECTS += white_balance_effect
TESTED_EFFECTS += gamma_expansion_effect
TESTED_EFFECTS += gamma_compression_effect
TESTED_EFFECTS += colorspace_conversion_effect
TESTED_EFFECTS += alpha_multiplication_effect
TESTED_EFFECTS += alpha_division_effect
TESTED_EFFECTS += saturation_effect
TESTED_EFFECTS += blur_effect
TESTED_EFFECTS += diffusion_effect
TESTED_EFFECTS += glow_effect
TESTED_EFFECTS += unsharp_mask_effect
TESTED_EFFECTS += mix_effect
TESTED_EFFECTS += overlay_effect
TESTED_EFFECTS += padding_effect
TESTED_EFFECTS += resample_effect
TESTED_EFFECTS += dither_effect
TESTED_EFFECTS += deconvolution_sharpen_effect
TESTED_EFFECTS += fft_pass_effect
TESTED_EFFECTS += vignette_effect
TESTED_EFFECTS += slice_effect
TESTED_EFFECTS += complex_modulate_effect
TESTED_EFFECTS += luma_mix_effect
TESTED_EFFECTS += fft_convolution_effect
TESTED_EFFECTS += ycbcr_conversion_effect
TESTED_EFFECTS += deinterlace_effect
UNTESTED_EFFECTS = sandbox_effect
UNTESTED_EFFECTS += mirror_effect
UNTESTED_EFFECTS += resize_effect
UNTESTED_EFFECTS += multiply_effect
UNTESTED_EFFECTS += fft_input
EFFECTS = $(TESTED_EFFECTS) $(UNTESTED_EFFECTS)
# Unit tests.
TESTS=effect_chain_test fp16_test $(TESTED_INPUTS:=_test) $(TESTED_EFFECTS:=_test)
LIB_OBJS=effect_util.o util.o effect.o effect_chain.o init.o resource_pool.o ycbcr.o $(INPUTS:=.o) $(EFFECTS:=.o)
# Default target:
all: libmovit.la $(TESTS)
ifeq ($(with_demo_app),yes)
all: demo
endif
# Google Test and other test library functions.
OWN_TEST_OBJS = gtest_sdl_main.o test_util.o
TEST_OBJS = gtest-all.o $(OWN_TEST_OBJS)
gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
$(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@
gtest_sdl_main.o: gtest_sdl_main.cpp
$(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@
# Unit tests.
$(TESTS): %: %.o $(TEST_OBJS) libmovit.la
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)
OWN_OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(OWN_TEST_OBJS) $(TESTS:=.o)
OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o)
# A small demo program.
demo: libmovit.la $(DEMO_OBJS)
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o demo $(DEMO_OBJS) libmovit.la $(LDLIBS) $(DEMO_LDLIBS)
# The library itself.
libmovit.la: $(LIB_OBJS:.o=.lo)
$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -rpath $(libdir) -version-info $(movit_ltversion) -o $@ $^ $(LDLIBS)
%.lo: %.cpp
$(LIBTOOL) --mode=compile $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
[ ! -r $(@:.lo=.d) ] || sed 's/\.o:/\.lo:/' < $(@:.lo=.d) > $(@:.lo=.ld)
[ ! -r .libs/$(@:.lo=.d) ] || sed 's/\.o:/\.lo:/' < .libs/$(@:.lo=.d) > .libs/$(@:.lo=.ld)
%.o: %.cpp
$(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
DEPS=$(OBJS:.o=.d) $(OBJS:.o=.ld)
-include $(DEPS)
clean:
$(LIBTOOL) --mode=clean $(RM) demo $(TESTS) libmovit.la $(OBJS) $(OBJS:.o=.lo)
$(RM) $(OBJS:.o=.gcno) $(OBJS:.o=.gcda) $(DEPS) step*.dot chain*.frag
$(RM) -r movit.info coverage/ .libs/
distclean: clean
$(RM) Makefile movit.pc config.status config.log
check: $(TESTS)
FAILED_TESTS=""; \
for TEST in $(TESTS); do \
./$$TEST || FAILED_TESTS="$$TEST $$FAILED_TESTS"; \
done; \
if [ "$$FAILED_TESTS" ]; then \
echo Failed tests: $$FAILED_TESTS; \
exit 1; \
fi
ifeq ($(with_coverage),yes)
coverage: check
lcov -d . -c -o movit.info
lcov --remove movit.info '*_test.cpp' 'test_util.*' 'sandbox_effect.*' widgets.cpp -o movit.info
genhtml -o coverage movit.info
else
coverage:
@echo You need to compile with --enable-coverage to use this target.
@exit 1
endif
HDRS = effect_chain.h effect_util.h effect.h input.h image_format.h init.h util.h defs.h resource_pool.h fp16.h ycbcr.h version.h
HDRS += $(INPUTS:=.h)
HDRS += $(EFFECTS:=.h)
SHADERS = vs.vert vs.130.vert vs.150.vert vs.300es.vert
SHADERS += header.130.frag header.150.frag header.300es.frag header.comp
SHADERS += footer.frag identity.frag footer.comp
SHADERS += texture1d.130.frag texture1d.150.frag texture1d.300es.frag
SHADERS += $(INPUTS:=.frag)
SHADERS += $(EFFECTS:=.frag) deinterlace_effect.comp
SHADERS += highlight_cutoff_effect.frag
SHADERS += overlay_matte_effect.frag
# These purposefully do not exist.
MISSING_SHADERS = diffusion_effect.frag glow_effect.frag unsharp_mask_effect.frag resize_effect.frag
MISSING_SHADERS += fft_convolution_effect.frag fft_input.frag
SHADERS := $(filter-out $(MISSING_SHADERS),$(SHADERS))
install: libmovit.la
$(MKDIR) -p $(DESTDIR)$(libdir)/
$(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(DESTDIR)$(libdir)/
$(MKDIR) -p $(DESTDIR)$(includedir)/movit/
$(INSTALL) -m 0644 $(HDRS) $(DESTDIR)$(includedir)/movit/
$(MKDIR) -p $(DESTDIR)$(datadir)/movit/
$(INSTALL) -m 0644 $(SHADERS) $(DESTDIR)$(datadir)/movit/
$(MKDIR) -p $(DESTDIR)$(libdir)/pkgconfig/
$(INSTALL) -m 644 movit.pc $(DESTDIR)$(libdir)/pkgconfig/
DISTDIR=movit-$(movit_version)
OTHER_DIST_FILES=add.frag autogen.sh blue.frag configure.ac d65.h identity.frag invert_effect.frag Makefile.in mipmap_needing_effect.frag movit.pc.in README NEWS test_util.h widgets.h
dist:
$(MKDIR) $(DISTDIR)
cp $(OWN_OBJS:.o=.cpp) $(DISTDIR)/
cp $(HDRS) $(DISTDIR)/
cp $(SHADERS) $(DISTDIR)/
cp $(OTHER_DIST_FILES) $(DISTDIR)/
( cd $(DISTDIR) && aclocal && libtoolize --install --copy && autoconf && $(RM) -r autom4te.cache/ )
tar zcvvf ../$(DISTDIR).tar.gz $(DISTDIR)
$(RM) -r $(DISTDIR)
.PHONY: coverage clean distclean check all install dist