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 include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
24 CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
26 include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
27 CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
29 include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
30 CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
33 ifeq ($(CONFIG_VP8_ENCODER),yes)
35 include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
36 CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
37 CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
38 CODEC_SRCS-yes += $(VP8_PREFIX)vp8cx.mk vpx/vp8.h vpx/vp8cx.h vpx/vp8e.h
39 CODEC_SRCS-$(ARCH_ARM) += $(VP8_PREFIX)vp8cx_arm.mk
40 INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8e.h include/vpx/vp8cx.h
41 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
42 CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
43 CODEC_DOC_SECTIONS += vp8 vp8_encoder
46 ifeq ($(CONFIG_VP8_DECODER),yes)
48 include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk
49 CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS))
50 CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS))
51 CODEC_SRCS-yes += $(VP8_PREFIX)vp8dx.mk vpx/vp8.h vpx/vp8dx.h
52 INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
53 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
54 CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
55 CODEC_DOC_SECTIONS += vp8 vp8_decoder
59 ifeq ($(CONFIG_ENCODERS),yes)
60 CODEC_DOC_SECTIONS += encoder
62 ifeq ($(CONFIG_DECODERS),yes)
63 CODEC_DOC_SECTIONS += decoder
67 ifeq ($(CONFIG_MSVS),yes)
68 CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
69 # This variable uses deferred expansion intentionally, since the results of
70 # $(wildcard) may change during the course of the Make.
71 VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
74 # The following pairs define a mapping of locations in the distribution
75 # tree to locations in the source/build trees.
76 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
77 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
78 INSTALL_MAPS += $(LIBSUBDIR)/% %
79 INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
80 ifeq ($(CONFIG_MSVS),yes)
81 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
82 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
85 # If this is a universal (fat) binary, then all the subarchitectures have
86 # already been built and our job is to stitch them together. The
87 # BUILD_LIBVPX variable indicates whether we should be building
88 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
89 # that we're stitching.
90 $(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
92 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
93 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
94 CODEC_SRCS-$(BUILD_LIBVPX) += vpx/vpx_integer.h
95 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/asm_offsets.h
96 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_timer.h
97 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem.h
98 CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
99 INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
100 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
101 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emms.asm
102 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86.h
103 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_abi_support.asm
104 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_cpuid.c
106 CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm_cpudetect.c
107 CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm.h
108 CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
109 CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
110 CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
112 INSTALL-LIBS-yes += include/vpx/vpx_codec.h
113 INSTALL-LIBS-yes += include/vpx/vpx_image.h
114 INSTALL-LIBS-yes += include/vpx/vpx_integer.h
115 INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_top.h
116 INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.h
117 INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
118 INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder_compat.h
119 INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
120 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
121 ifeq ($(CONFIG_MSVS),yes)
122 INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
123 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib)
124 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll)
125 INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
128 INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
129 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
132 CODEC_SRCS=$(filter-out %_test.cc,$(call enabled,CODEC_SRCS))
133 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)
134 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
137 # Generate a list of all enabled sources, in particular for exporting to gyp
138 # based build systems.
141 @echo $(CODEC_SRCS) | xargs -n1 echo | sort -u > $@
144 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
145 ifeq ($(CONFIG_MSVS),yes)
147 obj_int_extract.vcproj: $(SRC_PATH_BARE)/build/make/obj_int_extract.c
148 @cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat .
150 $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
152 --target=$(TOOLCHAIN) \
153 --name=obj_int_extract \
154 --ver=$(CONFIG_VS_VERSION) \
155 --proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2 \
156 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
159 -I"$(SRC_PATH_BARE)" \
161 PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.vcproj
162 PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.bat
164 vpx.def: $(call enabled,CODEC_EXPORTS)
166 $(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
169 CLEAN-OBJS += vpx.def
171 vpx.vcproj: $(CODEC_SRCS) vpx.def
173 $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
175 --target=$(TOOLCHAIN) \
176 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
178 --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
179 --module-def=vpx.def \
180 --ver=$(CONFIG_VS_VERSION) \
181 --out=$@ $(CFLAGS) $^ \
182 --src-path-bare="$(SRC_PATH_BARE)" \
184 PROJECTS-$(BUILD_LIBVPX) += vpx.vcproj
186 vpx.vcproj: vpx_config.asm
187 vpx.vcproj: vpx_rtcd.h
191 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
192 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
193 LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
194 $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
196 BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
197 LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
198 LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\
199 $(notdir $(LIBVPX_SO_SYMLINKS))
200 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) libvpx.ver
201 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
202 $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
203 $(BUILD_PFX)$(LIBVPX_SO): SO_VERSION_SCRIPT = libvpx.ver
204 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
205 libvpx.so libvpx.so.$(VERSION_MAJOR) \
206 libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR))
208 libvpx.ver: $(call enabled,CODEC_EXPORTS)
210 $(qexec)echo "{ global:" > $@
211 $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done
212 $(qexec)echo "local: *; };" >> $@
213 CLEAN-OBJS += libvpx.ver
215 define libvpx_symlink_template
218 $(qexec)ln -sf $(LIBVPX_SO) $$@
221 $(eval $(call libvpx_symlink_template,\
222 $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
223 $(BUILD_PFX)$(LIBVPX_SO)))
224 $(eval $(call libvpx_symlink_template,\
225 $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
226 $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)))
228 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
229 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
231 LIBS-$(BUILD_LIBVPX) += vpx.pc
232 vpx.pc: config.mk libs.mk
234 $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
235 $(qexec)echo 'prefix=$(PREFIX)' >> $@
236 $(qexec)echo 'exec_prefix=$${prefix}' >> $@
237 $(qexec)echo 'libdir=$${prefix}/lib' >> $@
238 $(qexec)echo 'includedir=$${prefix}/include' >> $@
239 $(qexec)echo '' >> $@
240 $(qexec)echo 'Name: vpx' >> $@
241 $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@
242 $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@
243 $(qexec)echo 'Requires:' >> $@
244 $(qexec)echo 'Conflicts:' >> $@
245 $(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
246 $(qexec)echo 'Cflags: -I$${includedir}' >> $@
247 INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
248 INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
252 LIBS-$(LIPO_LIBVPX) += libvpx.a
253 $(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
256 # Rule to make assembler configuration file from C configuration file
258 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
260 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
262 @egrep "#define [A-Z0-9_]+ [01]" $< \
263 | awk '{print $$2 " equ " $$3}' > $@
265 ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION))
266 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
268 @egrep "#define [A-Z0-9_]+ [01]" $< \
269 | awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@
270 @echo " END" $(ADS2GAS) >> $@
271 CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm
275 # Add assembler dependencies for configuration and offsets
277 $(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
278 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
281 # Calculate platform- and compiler-specific offsets for hand coded assembly
284 OFFSET_PATTERN:='^[a-zA-Z0-9_]* EQU'
286 ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC))
287 $(BUILD_PFX)asm_com_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
288 grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
289 $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S: $(VP8_PREFIX)common/asm_com_offsets.c
290 CLEAN-OBJS += $(BUILD_PFX)asm_com_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
292 $(BUILD_PFX)asm_enc_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
293 grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
294 $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S: $(VP8_PREFIX)encoder/asm_enc_offsets.c
295 CLEAN-OBJS += $(BUILD_PFX)asm_enc_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
297 $(BUILD_PFX)asm_dec_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
298 grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
299 $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S: $(VP8_PREFIX)decoder/asm_dec_offsets.c
300 CLEAN-OBJS += $(BUILD_PFX)asm_dec_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
302 ifeq ($(filter rvct,$(TGT_CC)), $(TGT_CC))
303 asm_com_offsets.asm: obj_int_extract
304 asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
305 ./obj_int_extract rvds $< $(ADS2GAS) > $@
306 OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
307 CLEAN-OBJS += asm_com_offsets.asm
308 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
310 asm_enc_offsets.asm: obj_int_extract
311 asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
312 ./obj_int_extract rvds $< $(ADS2GAS) > $@
313 OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
314 CLEAN-OBJS += asm_enc_offsets.asm
315 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
317 asm_dec_offsets.asm: obj_int_extract
318 asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
319 ./obj_int_extract rvds $< $(ADS2GAS) > $@
320 OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
321 CLEAN-OBJS += asm_dec_offsets.asm
322 $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
326 $(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
327 CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
330 # Rule to generate runtime cpu detection files
332 $(OBJS-yes:.o=.d): vpx_rtcd.h
333 vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
335 $(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
337 --config=$(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk \
338 $(RTCD_OPTIONS) $^ > $@
339 CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
341 CODEC_DOC_SRCS += vpx/vpx_codec.h \
347 ## libvpx test directives
350 ifeq ($(CONFIG_UNIT_TESTS),yes)
351 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
352 ifeq ($(CONFIG_MSVS),yes)
354 LIBVPX_TEST_SRCS=$(filter %_test.cc,$(call enabled,CODEC_SRCS))
355 LIBVPX_TEST_BINS=$(sort $(LIBVPX_TEST_SRCS:.cc.o=))
357 gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
359 $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
361 --target=$(TOOLCHAIN) \
362 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
364 --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \
365 --ver=$(CONFIG_VS_VERSION) \
366 --src-path-bare="$(SRC_PATH_BARE)" \
367 --out=gtest.vcproj $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \
368 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src"
370 PROJECTS-$(CONFIG_MSVS) += gtest.vcproj
372 define unit_test_vcproj_template
373 $(notdir $(1:.cc=.vcproj)): $(SRC_PATH_BARE)/$(1)
374 @echo " [vcproj] $$@"
375 $$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
377 --target=$$(TOOLCHAIN)\
378 --name=$(notdir $(1:.cc=))\
379 --ver=$$(CONFIG_VS_VERSION)\
380 $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
381 --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
382 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
383 -L. -lvpxmt -lwinmm -lgtestmt $$^
386 $(foreach proj,$(LIBVPX_TEST_BINS),\
387 $(eval $(call unit_test_vcproj_template,$(proj))))
389 PROJECTS-$(CONFIG_MSVS) += $(foreach proj,$(LIBVPX_TEST_BINS),\
390 $(notdir $(proj:.cc=.vcproj)))
393 @set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
397 include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
398 GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS))
399 GTEST_OBJS=$(call objs,$(GTEST_SRCS))
400 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
401 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
402 OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
403 LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
404 $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
406 LIBVPX_TEST_SRCS=$(filter %_test.cc,$(call enabled,CODEC_SRCS))
407 LIBVPX_TEST_OBJS=$(call objs,$(LIBVPX_TEST_SRCS))
408 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
409 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
410 LIBVPX_TEST_BINS=$(sort $(LIBVPX_TEST_OBJS:.cc.o=))
411 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
413 $(foreach bin,$(LIBVPX_TEST_BINS),\
414 $(if $(BUILD_LIBVPX),$(eval $(bin): libvpx.a libgtest.a ))\
415 $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
417 -L. -lvpx -lgtest -lpthread -lm)\
419 $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
421 test:: $(LIBVPX_TEST_BINS)
422 @set -e; for t in $(LIBVPX_TEST_BINS); do $$t; done
428 ## documentation directives
430 CLEAN-OBJS += libs.doxy
431 DOCS-yes += libs.doxy
432 libs.doxy: $(CODEC_DOC_SRCS)
435 @echo "INPUT += $^" >> $@
436 @echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
437 @echo "INCLUDE_PATH += ." >> $@;
438 @echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@