2 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 ## Use of this source code is governed by a BSD-style license
5 ## that can be found in the LICENSE file in the root of the source
6 ## tree. An additional intellectual property rights grant can be found
7 ## in the file PATENTS. All contributing project authors may
8 ## be found in the AUTHORS file in the root of the source tree.
12 # ARM assembly files are written in RVCT-style. We use some make magic to
13 # filter those files to allow GCC compilation
14 ifeq ($(ARCH_ARM),yes)
15 ASM:=$(if $(filter yes,$(CONFIG_GCC)),.asm.s,.asm)
20 CODEC_SRCS-yes += CHANGELOG
21 CODEC_SRCS-yes += libs.mk
23 # If this is a universal (fat) binary, then all the subarchitectures have
24 # already been built and our job is to stitch them together. The
25 # BUILD_LIBVPX variable indicates whether we should be building
26 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
27 # that we're stitching.
28 $(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
30 include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
31 CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
33 include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
34 CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
36 include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
37 CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
39 include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
40 CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
43 ifeq ($(CONFIG_VP8_ENCODER),yes)
45 include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
46 CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
47 CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
48 INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
49 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
50 CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
51 CODEC_DOC_SECTIONS += vp8 vp8_encoder
54 ifeq ($(CONFIG_VP8_DECODER),yes)
56 include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk
57 CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS))
58 CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS))
59 INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
60 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
61 CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
62 CODEC_DOC_SECTIONS += vp8 vp8_decoder
66 ifeq ($(CONFIG_ENCODERS),yes)
67 CODEC_DOC_SECTIONS += encoder
69 ifeq ($(CONFIG_DECODERS),yes)
70 CODEC_DOC_SECTIONS += decoder
74 ifeq ($(CONFIG_MSVS),yes)
75 CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
76 GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd)
77 # This variable uses deferred expansion intentionally, since the results of
78 # $(wildcard) may change during the course of the Make.
79 VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
82 # The following pairs define a mapping of locations in the distribution
83 # tree to locations in the source/build trees.
84 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
85 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
86 INSTALL_MAPS += $(LIBSUBDIR)/% %
87 INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
88 ifeq ($(CONFIG_MSVS),yes)
89 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
90 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
93 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
94 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
95 CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
96 INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
97 CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
98 CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
99 CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
101 INSTALL-LIBS-yes += include/vpx/vpx_codec.h
102 INSTALL-LIBS-yes += include/vpx/vpx_image.h
103 INSTALL-LIBS-yes += include/vpx/vpx_integer.h
104 INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_top.h
105 INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.h
106 INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
107 INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
108 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
109 ifeq ($(CONFIG_MSVS),yes)
110 INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
111 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib)
112 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll)
113 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
116 INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
117 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
120 CODEC_SRCS=$(filter-out %_test.cc,$(call enabled,CODEC_SRCS))
121 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)
122 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
125 # Generate a list of all enabled sources, in particular for exporting to gyp
126 # based build systems.
129 @echo $(CODEC_SRCS) | xargs -n1 echo | sort -u > $@
132 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
133 ifeq ($(CONFIG_MSVS),yes)
135 obj_int_extract.vcproj: $(SRC_PATH_BARE)/build/make/obj_int_extract.c
136 @cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat .
138 $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
140 --target=$(TOOLCHAIN) \
141 --name=obj_int_extract \
142 --ver=$(CONFIG_VS_VERSION) \
143 --proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2 \
144 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
147 -I"$(SRC_PATH_BARE)" \
149 PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.vcproj
150 PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.bat
152 vpx.def: $(call enabled,CODEC_EXPORTS)
154 $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
157 CLEAN-OBJS += vpx.def
159 vpx.vcproj: $(CODEC_SRCS) vpx.def
161 $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
163 --target=$(TOOLCHAIN) \
164 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
166 --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
167 --module-def=vpx.def \
168 --ver=$(CONFIG_VS_VERSION) \
169 --out=$@ $(CFLAGS) $^ \
170 --src-path-bare="$(SRC_PATH_BARE)" \
172 PROJECTS-$(BUILD_LIBVPX) += vpx.vcproj
174 vpx.vcproj: vpx_config.asm
175 vpx.vcproj: vpx_rtcd.h
179 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
180 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
181 LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
182 $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
184 BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
185 LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
186 LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\
187 $(notdir $(LIBVPX_SO_SYMLINKS))
188 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) libvpx.ver
189 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
190 $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
191 $(BUILD_PFX)$(LIBVPX_SO): SO_VERSION_SCRIPT = libvpx.ver
192 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
193 libvpx.so libvpx.so.$(VERSION_MAJOR) \
194 libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR))
196 libvpx.ver: $(call enabled,CODEC_EXPORTS)
198 $(qexec)echo "{ global:" > $@
199 $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done
200 $(qexec)echo "local: *; };" >> $@
201 CLEAN-OBJS += libvpx.ver
203 define libvpx_symlink_template
206 $(qexec)ln -sf $(LIBVPX_SO) $$@
209 $(eval $(call libvpx_symlink_template,\
210 $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
211 $(BUILD_PFX)$(LIBVPX_SO)))
212 $(eval $(call libvpx_symlink_template,\
213 $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
214 $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)))
216 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
217 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
219 LIBS-$(BUILD_LIBVPX) += vpx.pc
220 vpx.pc: config.mk libs.mk
222 $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
223 $(qexec)echo 'prefix=$(PREFIX)' >> $@
224 $(qexec)echo 'exec_prefix=$${prefix}' >> $@
225 $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
226 $(qexec)echo 'includedir=$${prefix}/include' >> $@
227 $(qexec)echo '' >> $@
228 $(qexec)echo 'Name: vpx' >> $@
229 $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@
230 $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@
231 $(qexec)echo 'Requires:' >> $@
232 $(qexec)echo 'Conflicts:' >> $@
233 $(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
234 $(qexec)echo 'Libs.private: -lm -lpthread' >> $@
235 $(qexec)echo 'Cflags: -I$${includedir}' >> $@
236 INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
237 INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
241 LIBS-$(LIPO_LIBVPX) += libvpx.a
242 $(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
245 # Rule to make assembler configuration file from C configuration file
247 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
249 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
251 @egrep "#define [A-Z0-9_]+ [01]" $< \
252 | awk '{print $$2 " equ " $$3}' > $@
254 ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION))
255 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
257 @egrep "#define [A-Z0-9_]+ [01]" $< \
258 | awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@
259 @echo " END" $(ADS2GAS) >> $@
260 CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm
264 # Add assembler dependencies for configuration and offsets
266 $(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
267 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
270 # Calculate platform- and compiler-specific offsets for hand coded assembly
273 OFFSET_PATTERN:='^[a-zA-Z0-9_]* EQU'
275 ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC))
276 $(BUILD_PFX)asm_com_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
278 $(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
279 $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S: $(VP8_PREFIX)common/asm_com_offsets.c
280 CLEAN-OBJS += $(BUILD_PFX)asm_com_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
282 $(BUILD_PFX)asm_enc_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
284 $(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
285 $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S: $(VP8_PREFIX)encoder/asm_enc_offsets.c
286 CLEAN-OBJS += $(BUILD_PFX)asm_enc_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
288 $(BUILD_PFX)asm_dec_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
290 $(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
291 $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S: $(VP8_PREFIX)decoder/asm_dec_offsets.c
292 CLEAN-OBJS += $(BUILD_PFX)asm_dec_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
294 ifeq ($(filter rvct,$(TGT_CC)), $(TGT_CC))
295 asm_com_offsets.asm: obj_int_extract
296 asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
298 $(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
299 OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
300 CLEAN-OBJS += asm_com_offsets.asm
301 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
303 asm_enc_offsets.asm: obj_int_extract
304 asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
306 $(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
307 OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
308 CLEAN-OBJS += asm_enc_offsets.asm
309 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
311 asm_dec_offsets.asm: obj_int_extract
312 asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
314 $(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
315 OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
316 CLEAN-OBJS += asm_dec_offsets.asm
317 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
321 $(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
322 CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
325 # Rule to generate runtime cpu detection files
327 $(BUILD_PFX)vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
329 $(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
331 --config=$(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk \
332 $(RTCD_OPTIONS) $^ > $@
333 CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
335 CODEC_DOC_SRCS += vpx/vpx_codec.h \
341 ## libvpx test directives
343 ifeq ($(CONFIG_UNIT_TESTS),yes)
344 LIBVPX_TEST_DATA_PATH ?= .
346 include $(SRC_PATH_BARE)/test/test.mk
347 LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
348 LIBVPX_TEST_BINS=./test_libvpx
349 LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
350 $(call enabled,LIBVPX_TEST_DATA))
351 libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
354 @echo " [DOWNLOAD] $@"
355 $(qexec)trap 'rm -f $@' INT TERM &&\
356 curl -L -o $@ $(call libvpx_test_data_url,$(@F))
358 testdata:: $(LIBVPX_TEST_DATA)
359 $(qexec)if [ -x "$$(which sha1sum)" ]; then\
360 echo "Checking test data:";\
361 if [ -n "$(LIBVPX_TEST_DATA)" ]; then\
362 for f in $(call enabled,LIBVPX_TEST_DATA); do\
363 grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
364 (cd $(LIBVPX_TEST_DATA_PATH); sha1sum -c);\
368 echo "Skipping test data integrity check, sha1sum not found.";\
371 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
372 ifeq ($(CONFIG_MSVS),yes)
374 gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
376 $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
378 --target=$(TOOLCHAIN) \
379 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
381 --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \
382 --ver=$(CONFIG_VS_VERSION) \
383 --src-path-bare="$(SRC_PATH_BARE)" \
384 --out=gtest.vcproj $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \
385 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src"
387 PROJECTS-$(CONFIG_MSVS) += gtest.vcproj
389 test_libvpx.vcproj: $(LIBVPX_TEST_SRCS)
391 $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
393 --target=$(TOOLCHAIN) \
395 --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
396 --ver=$(CONFIG_VS_VERSION) \
397 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
398 --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
399 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
400 -L. -l$(CODEC_LIB) -lwinmm -l$(GTEST_LIB) $^
402 PROJECTS-$(CONFIG_MSVS) += test_libvpx.vcproj
405 @set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
409 include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
410 GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS))
411 GTEST_OBJS=$(call objs,$(GTEST_SRCS))
412 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
413 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
414 OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
415 LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
416 $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
418 LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
419 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
420 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
421 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
422 BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
424 # Install test sources only if codec source is included
425 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
426 $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
427 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
429 CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
430 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
431 $(foreach bin,$(LIBVPX_TEST_BINS),\
432 $(if $(BUILD_LIBVPX),$(eval $(bin): \
433 lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\
434 $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
435 $(LIBVPX_TEST_OBJS) \
436 -L. -lvpx -lgtest -lpthread -lm)\
438 $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
440 test:: $(LIBVPX_TEST_BINS) testdata
441 @set -e; for t in $(LIBVPX_TEST_BINS); do $$t; done
447 ## documentation directives
449 CLEAN-OBJS += libs.doxy
450 DOCS-yes += libs.doxy
451 libs.doxy: $(CODEC_DOC_SRCS)
454 @echo "INPUT += $^" >> $@
455 @echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
456 @echo "INCLUDE_PATH += ." >> $@;
457 @echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@
459 ## Generate vpx_rtcd.h for all objects
460 $(OBJS-yes:.o=.d): $(BUILD_PFX)vpx_rtcd.h