Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: source/libvpx/libs.mk

Issue 1162573005: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/examples/vpx_temporal_svc_encoder.c ('k') | source/libvpx/md5_utils.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ## 1 ##
2 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 ## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 ## 3 ##
4 ## Use of this source code is governed by a BSD-style license 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 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 6 ## tree. An additional intellectual property rights grant can be found
7 ## in the file PATENTS. All contributing project authors may 7 ## in the file PATENTS. All contributing project authors may
8 ## be found in the AUTHORS file in the root of the source tree. 8 ## be found in the AUTHORS file in the root of the source tree.
9 ## 9 ##
10 10
11 11
12 # ARM assembly files are written in RVCT-style. We use some make magic to 12 # ARM assembly files are written in RVCT-style. We use some make magic to
13 # filter those files to allow GCC compilation 13 # filter those files to allow GCC compilation
14 ifeq ($(ARCH_ARM),yes) 14 ifeq ($(ARCH_ARM),yes)
15 ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.s,.asm) 15 ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.s,.asm)
16 else 16 else
17 ASM:=.asm 17 ASM:=.asm
18 endif 18 endif
19 19
20 # 20 #
21 # Rule to generate runtime cpu detection files 21 # Rule to generate runtime cpu detection files
22 # 22 #
23 define rtcd_h_template 23 define rtcd_h_template
24 $$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2) 24 $$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
25 @echo " [CREATE] $$@" 25 @echo " [CREATE] $$@"
26 $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \ 26 $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
27 --sym=$(1) \ 27 --sym=$(1) \
28 --config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)). mk \ 28 --config=$$(CONFIG_DIR)$$(target)-$$(TOOLCHAIN).mk \
29 $$(RTCD_OPTIONS) $$^ > $$@ 29 $$(RTCD_OPTIONS) $$^ > $$@
30 CLEAN-OBJS += $$(BUILD_PFX)$(1).h 30 CLEAN-OBJS += $$(BUILD_PFX)$(1).h
31 RTCD += $$(BUILD_PFX)$(1).h 31 RTCD += $$(BUILD_PFX)$(1).h
32 endef 32 endef
33 33
34 CODEC_SRCS-yes += CHANGELOG 34 CODEC_SRCS-yes += CHANGELOG
35 CODEC_SRCS-yes += libs.mk 35 CODEC_SRCS-yes += libs.mk
36 36
37 # If this is a universal (fat) binary, then all the subarchitectures have
38 # already been built and our job is to stitch them together. The
39 # BUILD_LIBVPX variable indicates whether we should be building
40 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
41 # that we're stitching.
42 $(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
43
44 include $(SRC_PATH_BARE)/vpx/vpx_codec.mk 37 include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
45 CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS)) 38 CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
46 CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS)) 39 CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
47 40
48 include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk 41 include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
49 CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS)) 42 CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
50 43
51 include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk 44 include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
52 CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS)) 45 CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
53 46
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 # tree to locations in the source/build trees. 126 # tree to locations in the source/build trees.
134 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/% 127 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
135 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/% 128 INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
136 INSTALL_MAPS += $(LIBSUBDIR)/% % 129 INSTALL_MAPS += $(LIBSUBDIR)/% %
137 INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% 130 INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
138 ifeq ($(CONFIG_MSVS),yes) 131 ifeq ($(CONFIG_MSVS),yes)
139 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%) 132 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
140 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%) 133 INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
141 endif 134 endif
142 135
143 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh 136 CODEC_SRCS-yes += build/make/version.sh
144 CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl 137 CODEC_SRCS-yes += build/make/rtcd.pl
145 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h 138 CODEC_SRCS-yes += vpx_ports/emmintrin_compat.h
146 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h 139 CODEC_SRCS-yes += vpx_ports/mem_ops.h
147 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h 140 CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h
148 CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h 141 CODEC_SRCS-yes += vpx_ports/vpx_once.h
149 CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c 142 CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c
150 INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c 143 INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
151 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) 144 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
152 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm 145 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
153 endif 146 endif
154 CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com 147 CODEC_EXPORTS-yes += vpx/exports_com
155 CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc 148 CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
156 CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec 149 CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
157 150
158 INSTALL-LIBS-yes += include/vpx/vpx_codec.h 151 INSTALL-LIBS-yes += include/vpx/vpx_codec.h
159 INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h 152 INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h
160 INSTALL-LIBS-yes += include/vpx/vpx_image.h 153 INSTALL-LIBS-yes += include/vpx/vpx_image.h
161 INSTALL-LIBS-yes += include/vpx/vpx_integer.h 154 INSTALL-LIBS-yes += include/vpx/vpx_integer.h
162 INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h 155 INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
163 INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h 156 INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
164 ifeq ($(CONFIG_EXTERNAL_BUILD),yes) 157 ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ 204 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
212 --name=vpx \ 205 --name=vpx \
213 --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \ 206 --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
214 --module-def=vpx.def \ 207 --module-def=vpx.def \
215 --ver=$(CONFIG_VS_VERSION) \ 208 --ver=$(CONFIG_VS_VERSION) \
216 --src-path-bare="$(SRC_PATH_BARE)" \ 209 --src-path-bare="$(SRC_PATH_BARE)" \
217 --out=$@ $(CFLAGS) \ 210 --out=$@ $(CFLAGS) \
218 $(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \ 211 $(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \
219 --src-path-bare="$(SRC_PATH_BARE)" \ 212 --src-path-bare="$(SRC_PATH_BARE)" \
220 213
221 PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX) 214 PROJECTS-yes += vpx.$(VCPROJ_SFX)
222 215
223 vpx.$(VCPROJ_SFX): vpx_config.asm 216 vpx.$(VCPROJ_SFX): vpx_config.asm
224 vpx.$(VCPROJ_SFX): $(RTCD) 217 vpx.$(VCPROJ_SFX): $(RTCD)
225 218
226 endif 219 endif
227 else 220 else
228 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS)) 221 LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
229 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS) 222 OBJS-yes += $(LIBVPX_OBJS)
230 LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX) libvpx_g.a 223 LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
231 $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS) 224 $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
232 225
233
234 BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
235
236 SO_VERSION_MAJOR := 2 226 SO_VERSION_MAJOR := 2
237 SO_VERSION_MINOR := 0 227 SO_VERSION_MINOR := 0
238 SO_VERSION_PATCH := 0 228 SO_VERSION_PATCH := 0
239 ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS)) 229 ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
240 LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib 230 LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib
241 EXPORT_FILE := libvpx.syms 231 EXPORT_FILE := libvpx.syms
242 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ 232 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
243 libvpx.dylib ) 233 libvpx.dylib )
244 else 234 else
245 LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(S O_VERSION_PATCH) 235 LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(S O_VERSION_PATCH)
246 EXPORT_FILE := libvpx.ver 236 EXPORT_FILE := libvpx.ver
247 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ 237 LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
248 libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \ 238 libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
249 libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR)) 239 libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
250 endif 240 endif
251 241
252 LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\ 242 LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
253 $(notdir $(LIBVPX_SO_SYMLINKS)) 243 $(notdir $(LIBVPX_SO_SYMLINKS))
254 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE) 244 $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
255 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm 245 $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
256 $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR) 246 $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
257 $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE) 247 $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
258 248
259 libvpx.ver: $(call enabled,CODEC_EXPORTS) 249 libvpx.ver: $(call enabled,CODEC_EXPORTS)
260 @echo " [CREATE] $@" 250 @echo " [CREATE] $@"
261 $(qexec)echo "{ global:" > $@ 251 $(qexec)echo "{ global:" > $@
262 $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done 252 $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done
(...skipping 13 matching lines...) Expand all
276 endef 266 endef
277 267
278 $(eval $(call libvpx_symlink_template,\ 268 $(eval $(call libvpx_symlink_template,\
279 $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\ 269 $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
280 $(BUILD_PFX)$(LIBVPX_SO))) 270 $(BUILD_PFX)$(LIBVPX_SO)))
281 $(eval $(call libvpx_symlink_template,\ 271 $(eval $(call libvpx_symlink_template,\
282 $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\ 272 $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
283 $(LIBVPX_SO))) 273 $(LIBVPX_SO)))
284 274
285 275
286 INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS) 276 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
287 INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBSUBDIR)/$(LIBVPX_SO) 277 INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
288 278
289 279
290 LIBS-$(BUILD_LIBVPX) += vpx.pc 280 LIBS-yes += vpx.pc
291 vpx.pc: config.mk libs.mk 281 vpx.pc: config.mk libs.mk
292 @echo " [CREATE] $@" 282 @echo " [CREATE] $@"
293 $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@ 283 $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
294 $(qexec)echo 'prefix=$(PREFIX)' >> $@ 284 $(qexec)echo 'prefix=$(PREFIX)' >> $@
295 $(qexec)echo 'exec_prefix=$${prefix}' >> $@ 285 $(qexec)echo 'exec_prefix=$${prefix}' >> $@
296 $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@ 286 $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
297 $(qexec)echo 'includedir=$${prefix}/include' >> $@ 287 $(qexec)echo 'includedir=$${prefix}/include' >> $@
298 $(qexec)echo '' >> $@ 288 $(qexec)echo '' >> $@
299 $(qexec)echo 'Name: vpx' >> $@ 289 $(qexec)echo 'Name: vpx' >> $@
300 $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@ 290 $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@
301 $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH )' >> $@ 291 $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH )' >> $@
302 $(qexec)echo 'Requires:' >> $@ 292 $(qexec)echo 'Requires:' >> $@
303 $(qexec)echo 'Conflicts:' >> $@ 293 $(qexec)echo 'Conflicts:' >> $@
304 $(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@ 294 $(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
305 ifeq ($(HAVE_PTHREAD_H),yes) 295 ifeq ($(HAVE_PTHREAD_H),yes)
306 $(qexec)echo 'Libs.private: -lm -lpthread' >> $@ 296 $(qexec)echo 'Libs.private: -lm -lpthread' >> $@
307 else 297 else
308 $(qexec)echo 'Libs.private: -lm' >> $@ 298 $(qexec)echo 'Libs.private: -lm' >> $@
309 endif 299 endif
310 $(qexec)echo 'Cflags: -I$${includedir}' >> $@ 300 $(qexec)echo 'Cflags: -I$${includedir}' >> $@
311 INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc 301 INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
312 INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc 302 INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
313 CLEAN-OBJS += vpx.pc 303 CLEAN-OBJS += vpx.pc
314 endif 304 endif
315 305
316 LIBS-$(LIPO_LIBVPX) += libvpx.a
317 $(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
318
319 # 306 #
320 # Rule to make assembler configuration file from C configuration file 307 # Rule to make assembler configuration file from C configuration file
321 # 308 #
322 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) 309 ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
323 # YASM 310 # YASM
324 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h 311 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
325 @echo " [CREATE] $@" 312 @echo " [CREATE] $@"
326 @egrep "#define [A-Z0-9_]+ [01]" $< \ 313 @egrep "#define [A-Z0-9_]+ [01]" $< \
327 | awk '{print $$2 " equ " $$3}' > $@ 314 | awk '{print $$2 " equ " $$3}' > $@
328 else 315 else
(...skipping 18 matching lines...) Expand all
347 334
348 335
349 ## 336 ##
350 ## libvpx test directives 337 ## libvpx test directives
351 ## 338 ##
352 ifeq ($(CONFIG_UNIT_TESTS),yes) 339 ifeq ($(CONFIG_UNIT_TESTS),yes)
353 LIBVPX_TEST_DATA_PATH ?= . 340 LIBVPX_TEST_DATA_PATH ?= .
354 341
355 include $(SRC_PATH_BARE)/test/test.mk 342 include $(SRC_PATH_BARE)/test/test.mk
356 LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS)) 343 LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
357 LIBVPX_TEST_BINS=./test_libvpx$(EXE_SFX) 344 LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)
358 LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\ 345 LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
359 $(call enabled,LIBVPX_TEST_DATA)) 346 $(call enabled,LIBVPX_TEST_DATA))
360 libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1) 347 libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
361 348
349 TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
350 TEST_INTRA_PRED_SPEED_SRCS=$(addprefix test/,$(call enabled,TEST_INTRA_PRED_SPEE D_SRCS))
351
362 libvpx_test_srcs.txt: 352 libvpx_test_srcs.txt:
363 @echo " [CREATE] $@" 353 @echo " [CREATE] $@"
364 @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@ 354 @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
365 CLEAN-OBJS += libvpx_test_srcs.txt 355 CLEAN-OBJS += libvpx_test_srcs.txt
366 356
367 $(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1 357 $(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
368 @echo " [DOWNLOAD] $@" 358 @echo " [DOWNLOAD] $@"
369 $(qexec)trap 'rm -f $@' INT TERM &&\ 359 $(qexec)trap 'rm -f $@' INT TERM &&\
370 curl -L -o $@ $(call libvpx_test_data_url,$(@F)) 360 curl -L -o $@ $(call libvpx_test_data_url,$(@F))
371 361
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \ 405 --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
416 --ver=$(CONFIG_VS_VERSION) \ 406 --ver=$(CONFIG_VS_VERSION) \
417 --src-path-bare="$(SRC_PATH_BARE)" \ 407 --src-path-bare="$(SRC_PATH_BARE)" \
418 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ 408 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
419 --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \ 409 --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
420 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \ 410 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
421 -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^ 411 -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
422 412
423 PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX) 413 PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
424 414
425 LIBVPX_TEST_BINS := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_T EST_BINS))) 415 LIBVPX_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TE ST_BIN)))
416
417 ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
418 PROJECTS-$(CONFIG_MSVS) += test_intra_pred_speed.$(VCPROJ_SFX)
419 test_intra_pred_speed.$(VCPROJ_SFX): $(TEST_INTRA_PRED_SPEED_SRCS) vpx.$(VCPROJ_ SFX) gtest.$(VCPROJ_SFX)
420 » @echo " [CREATE] $@"
421 » $(qexec)$(GEN_VCPROJ) \
422 --exe \
423 --target=$(TOOLCHAIN) \
424 --name=test_intra_pred_speed \
425 -D_VARIADIC_MAX=10 \
426 --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
427 --ver=$(CONFIG_VS_VERSION) \
428 --src-path-bare="$(SRC_PATH_BARE)" \
429 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
430 --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
431 -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
432 -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
433 endif # TEST_INTRA_PRED_SPEED
426 endif 434 endif
427 else 435 else
428 436
429 include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk 437 include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
430 GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS) ) 438 GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS) )
431 GTEST_OBJS=$(call objs,$(GTEST_SRCS)) 439 GTEST_OBJS=$(call objs,$(GTEST_SRCS))
432 ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS)) 440 ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS))
433 # Disabling pthreads globally will cause issues on darwin and possibly elsewhere 441 # Disabling pthreads globally will cause issues on darwin and possibly elsewhere
434 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0 442 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0
435 endif 443 endif
436 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/go ogletest/src 444 GTEST_INCLUDES := -I$(SRC_PATH_BARE)/third_party/googletest/src
437 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/go ogletest/src/include 445 GTEST_INCLUDES += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
438 OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS) 446 $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
439 LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a 447 OBJS-yes += $(GTEST_OBJS)
448 LIBS-yes += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
440 $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS) 449 $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
441 450
442 LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS))) 451 LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
443 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/th ird_party/googletest/src 452 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
444 $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/th ird_party/googletest/src/include 453 OBJS-yes += $(LIBVPX_TEST_OBJS)
445 OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS) 454 BINS-yes += $(LIBVPX_TEST_BIN)
446 BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
447 455
448 CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) 456 CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
449 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a) 457 CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
450 $(foreach bin,$(LIBVPX_TEST_BINS),\ 458 TEST_LIBS := lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a
451 $(if $(BUILD_LIBVPX),$(eval $(bin): \ 459 $(LIBVPX_TEST_BIN): $(TEST_LIBS)
452 lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\ 460 $(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
453 $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\ 461 $(LIBVPX_TEST_OBJS) \
454 $(LIBVPX_TEST_OBJS) \ 462 -L. -lvpx -lgtest $(extralibs) -lm))
455 -L. -lvpx -lgtest $(extralibs) -lm)\
456 )))\
457 $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
458 463
459 endif 464 TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
465 ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
466 $(TEST_INTRA_PRED_SPEED_OBJS) $(TEST_INTRA_PRED_SPEED_OBJS:.o=.d): CXXFLAGS += $ (GTEST_INCLUDES)
467 OBJS-yes += $(TEST_INTRA_PRED_SPEED_OBJS)
468 BINS-yes += $(TEST_INTRA_PRED_SPEED_BIN)
469
470 $(TEST_INTRA_PRED_SPEED_BIN): $(TEST_LIBS)
471 $(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
472 $(TEST_INTRA_PRED_SPEED_OBJS) \
473 -L. -lvpx -lgtest $(extralibs) -lm))
474 endif # TEST_INTRA_PRED_SPEED
475
476 endif # CONFIG_UNIT_TESTS
460 477
461 # Install test sources only if codec source is included 478 # Install test sources only if codec source is included
462 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\ 479 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
463 $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f)) 480 $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
464 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS) 481 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
482 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
465 483
466 define test_shard_template 484 define test_shard_template
467 test:: test_shard.$(1) 485 test:: test_shard.$(1)
468 test_shard.$(1): $(LIBVPX_TEST_BINS) testdata 486 test_shard.$(1): $(LIBVPX_TEST_BIN) testdata
469 @set -e; \ 487 @set -e; \
470 » for t in $(LIBVPX_TEST_BINS); do \ 488 » export GTEST_SHARD_INDEX=$(1); \
471 » export GTEST_SHARD_INDEX=$(1); \ 489 » export GTEST_TOTAL_SHARDS=$(2); \
472 » export GTEST_TOTAL_SHARDS=$(2); \ 490 » $(LIBVPX_TEST_BIN)
473 » $$$$t; \
474 » done
475 .PHONY: test_shard.$(1) 491 .PHONY: test_shard.$(1)
476 endef 492 endef
477 493
478 NUM_SHARDS := 10 494 NUM_SHARDS := 10
479 SHARDS := 0 1 2 3 4 5 6 7 8 9 495 SHARDS := 0 1 2 3 4 5 6 7 8 9
480 $(foreach s,$(SHARDS),$(eval $(call test_shard_template,$(s),$(NUM_SHARDS)))) 496 $(foreach s,$(SHARDS),$(eval $(call test_shard_template,$(s),$(NUM_SHARDS))))
481 497
482 endif 498 endif
483 499
484 ## 500 ##
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release 559 EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
544 endif 560 endif
545 exampletest: examples testdata 561 exampletest: examples testdata
546 $(qexec)$(SRC_PATH_BARE)/test/examples.sh \ 562 $(qexec)$(SRC_PATH_BARE)/test/examples.sh \
547 --test-data-path $(LIBVPX_TEST_DATA_PATH) \ 563 --test-data-path $(LIBVPX_TEST_DATA_PATH) \
548 --bin-path $(EXAMPLES_BIN_PATH) 564 --bin-path $(EXAMPLES_BIN_PATH)
549 else 565 else
550 exampletest: 566 exampletest:
551 @echo Unit tests must be enabled to make the exampletest target. 567 @echo Unit tests must be enabled to make the exampletest target.
552 endif 568 endif
OLDNEW
« no previous file with comments | « source/libvpx/examples/vpx_temporal_svc_encoder.c ('k') | source/libvpx/md5_utils.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698