Debian Codegraph @

test/Makefile

raw symbols SCIP
1 # Where to find user code.
2 USER_DIR = ..
3
4 # Points to the root of Google Test, relative to where this file is.
5 # Remember to tweak this if you move this file.
6 GTEST_DIR = $(USER_DIR)/test/googletest/googletest
7
8 # Where to find sample files
9 SAMPLES_DIR =
10
11 # URL to sync samples from
12 SAMPLES_URL =
13
14 # Flags passed to the preprocessor.
15 # Set Google Test's header directory as a system directory, such that
16 # the compiler doesn't generate warnings in Google Test headers.
17 CPPFLAGS += -isystem $(GTEST_DIR)/include \
18 -I$(USER_DIR)/include \
19 -D_FILE_OFFSET_BITS=64 \
20 -DFFMS_EXPORTS \
21 -D__STDC_CONSTANT_MACROS \
22 -DSAMPLES_DIR=$(SAMPLES_DIR)
23
24 # Flags passed to the C++ compiler.
25 CXXFLAGS += -g -Wall -Wextra -pthread -std=c++11 -fvisibility=hidden
26
27 # All tests produced by this Makefile. Remember to add new tests you
28 # created to the list.
29 TESTS = indexer \
30 hdr \
31 display_matrix
32
33 RUNTESTS = $(subst $() $(),-run$() $(),$(TESTS))-run
34
35 # All the sample files we need to sync
36 SAMPLES = test.mp4 \
37 hdr10tags-both.mkv \
38 hdr10tags-container.mkv \
39 hdr10tags-stream.mp4 \
40 qrvideo_hflip_90.mov \
41 qrvideo_hflip_270.mov \
42 qrvideo_vflip.mov \
43 vp9_audfirst.webm \
44 qrvideo_24fps_1elist_1ctts.mov \
45 qrvideo_24fps_1elist_ends_last_bframe.mov \
46 qrvideo_24fps_1elist_noctts.mov \
47 qrvideo_24fps_2elist_elist1_dur_zero.mov \
48 qrvideo_24fps_2elist_elist1_ends_bframe.mov \
49 qrvideo_24fps_2s_3elist.mov \
50 qrvideo_24fps_3elist_1ctts.mov \
51 qrvideo_24fps_elist_starts_ctts_2ndsample.mov \
52 qrvideo_stream_shorter_than_movie.mov
53
54 # All Google Test headers. Usually you shouldn't change this
55 # definition.
56 GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h $(GTEST_DIR)/include/gtest/internal/*.h
57
58 # House-keeping build targets.
59
60 all: $(TESTS)
61
62 run: all $(RUNTESTS)
63
64 sync:
65 @for i in $(SAMPLES); do \
66 if [ ! -f "$(SAMPLES_DIR)/$$i" ]; then \
67 wget -O $(SAMPLES_DIR)/$$i $(SAMPLES_URL)/$$i; \
68 fi \
69 done
70
71 clean:
72 rm -f $(TESTS) gtest.a gtest_main.a *.o
73 rm -rf .libs
74
75 # Builds gtest.a and gtest_main.a.
76
77 # Usually you shouldn't tweak such internal variables, indicated by a
78 # trailing _.
79 GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
80
81 # For simplicity and to avoid depending on Google Test's
82 # implementation details, the dependencies specified below are
83 # conservative and not optimized. This is fine as Google Test
84 # compiles fast and for ordinary users its source rarely changes.
85 gtest-all.o: $(GTEST_SRCS_)
86 $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
87
88 gtest_main.o: $(GTEST_SRCS_)
89 $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest_main.cc
90
91 gtest.a: gtest-all.o
92 $(AR) $(ARFLAGS) $@ $^
93
94 gtest_main.a: gtest-all.o gtest_main.o
95 $(AR) $(ARFLAGS) $@ $^
96
97 tests.o: $(USER_DIR)/test/tests.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS)
98 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/tests.cpp
99
100 hdr.o: $(USER_DIR)/test/hdr.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS)
101 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/hdr.cpp
102
103 display_matrix.o: $(USER_DIR)/test/display_matrix.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS)
104 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/display_matrix.cpp
105
106 indexer.o: $(USER_DIR)/test/indexer.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS)
107 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/indexer.cpp
108
109 indexer: indexer.o tests.o gtest_main.a ../src/core/libffms2.la
110 ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o indexer indexer.o tests.o gtest_main.a -lavutil ../src/core/libffms2.la
111
112 indexer-run:
113 @./indexer
114
115 hdr: hdr.o gtest_main.a ../src/core/libffms2.la
116 ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o hdr hdr.o gtest_main.a -lavutil ../src/core/libffms2.la
117
118 hdr-run:
119 @./hdr
120
121 display_matrix: display_matrix.o gtest_main.a ../src/core/libffms2.la
122 ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o display_matrix display_matrix.o gtest_main.a -lavutil ../src/core/libffms2.la
123
124 display_matrix-run:
125 @./display_matrix