1 GTEST_DIR = /usr/src/gtest
3 EIGEN_CXXFLAGS := $(shell pkg-config --cflags eigen3)
4 ifeq ($(EIGEN_CXXFLAGS),)
5 $(error Empty EIGEN_CXXFLAGS. You probably need to install Eigen3)
8 GLEW_CXXFLAGS := $(shell pkg-config --cflags glew)
9 ifeq ($(GLEW_CXXFLAGS),)
10 $(error Empty GLEW_CXXFLAGS. You probably need to install GLEW)
13 GLEW_LIBS := $(shell pkg-config --libs glew)
15 $(error Empty GLEW_LIBS. You probably need to install GLEW)
20 CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(EIGEN_CXXFLAGS) $(GLEW_CXXFLAGS)
21 LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread $(GLEW_LIBS)
25 CXXFLAGS += -fprofile-arcs -ftest-coverage
26 LDFLAGS += -fprofile-arcs -ftest-coverage
32 TESTS=effect_chain_test
33 TESTS += mix_effect_test
34 TESTS += gamma_expansion_effect_test
35 TESTS += gamma_compression_effect_test
36 TESTS += colorspace_conversion_effect_test
37 TESTS += saturation_effect_test
38 TESTS += deconvolution_sharpen_effect_test
39 TESTS += blur_effect_test
40 TESTS += unsharp_mask_effect_test
41 TESTS += diffusion_effect_test
42 TESTS += white_balance_effect_test
43 TESTS += lift_gamma_gain_effect_test
44 TESTS += resample_effect_test
45 TESTS += dither_effect_test
46 TESTS += flat_input_test
47 TESTS += ycbcr_input_test
50 LIB_OBJS=util.o widgets.o effect.o effect_chain.o init.o
53 LIB_OBJS += flat_input.o
54 LIB_OBJS += ycbcr_input.o
57 LIB_OBJS += lift_gamma_gain_effect.o
58 LIB_OBJS += white_balance_effect.o
59 LIB_OBJS += gamma_expansion_effect.o
60 LIB_OBJS += gamma_compression_effect.o
61 LIB_OBJS += colorspace_conversion_effect.o
62 LIB_OBJS += saturation_effect.o
63 LIB_OBJS += vignette_effect.o
64 LIB_OBJS += mirror_effect.o
65 LIB_OBJS += blur_effect.o
66 LIB_OBJS += diffusion_effect.o
67 LIB_OBJS += glow_effect.o
68 LIB_OBJS += unsharp_mask_effect.o
69 LIB_OBJS += mix_effect.o
70 LIB_OBJS += resize_effect.o
71 LIB_OBJS += resample_effect.o
72 LIB_OBJS += dither_effect.o
73 LIB_OBJS += deconvolution_sharpen_effect.o
74 LIB_OBJS += sandbox_effect.o
79 # Google Test and other test library functions.
80 TEST_OBJS = gtest-all.o gtest_sdl_main.o test_util.o
82 gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
83 $(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@
84 gtest_sdl_main.o: gtest_sdl_main.cpp
85 $(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@
88 $(TESTS): %: %.o $(TEST_OBJS) libmovit.a
89 $(CXX) -o $@ $^ $(LDFLAGS)
91 OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o)
93 # A small demo program.
94 demo: libmovit.a $(DEMO_OBJS)
95 $(CXX) -o demo $(DEMO_OBJS) libmovit.a $(LDFLAGS)
98 libmovit.a: $(LIB_OBJS)
99 $(AR) rc $@ $(LIB_OBJS)
103 $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
109 $(RM) demo $(TESTS) libmovit.a $(OBJS) $(OBJS:.o=.gcno) $(OBJS:.o=.gcda) $(DEPS) step-*.dot
110 $(RM) -r movit.info coverage/
114 for TEST in $(TESTS); do \
115 ./$$TEST || FAIL=1; \
119 # You need to build with COVERAGE=1 to use this target.
121 lcov -d . -c -o movit.info
122 lcov --remove movit.info '*_test.cpp' '*/test_util.{cpp,h}' -o movit.info
123 genhtml -o coverage movit.info
125 .PHONY: coverage clean check all