xref: /aosp_15_r20/external/libvpx/libs.mk (revision fb1b10ab9aebc7c7068eedab379b749d7e3900be)
1##
2##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3##
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.
9##
10
11
12# ARM assembly files are written in RVCT-style. We use some make magic to
13# filter those files to allow GCC compilation
14ifeq ($(VPX_ARCH_ARM),yes)
15  ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.S,.asm)
16else
17  ASM:=.asm
18endif
19
20#
21# Rule to generate runtime cpu detection files
22#
23define rtcd_h_template
24$$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
25	@echo "    [CREATE] $$@"
26	$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
27          --sym=$(1) \
28          --config=$$(CONFIG_DIR)$$(target)-$$(TOOLCHAIN).mk \
29          $$(RTCD_OPTIONS) $$^ > $$@
30CLEAN-OBJS += $$(BUILD_PFX)$(1).h
31RTCD += $$(BUILD_PFX)$(1).h
32endef
33
34CODEC_SRCS-yes += CHANGELOG
35CODEC_SRCS-yes += libs.mk
36
37include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
38CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
39CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
40
41include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
42CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
43
44include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
45CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
46
47include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
48CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
49
50include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk
51CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
52
53include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
54CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
55
56ifeq ($(CONFIG_VP8),yes)
57  VP8_PREFIX=vp8/
58  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
59endif
60
61ifeq ($(CONFIG_VP8_ENCODER),yes)
62  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
63  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
64  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
65  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
66  INSTALL-LIBS-yes += include/vpx/vpx_ext_ratectrl.h
67  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
68  CODEC_DOC_SECTIONS += vp8 vp8_encoder
69endif
70
71ifeq ($(CONFIG_VP8_DECODER),yes)
72  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk
73  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS))
74  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS))
75  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
76  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
77  CODEC_DOC_SECTIONS += vp8 vp8_decoder
78endif
79
80ifeq ($(CONFIG_VP9),yes)
81  VP9_PREFIX=vp9/
82  include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk
83endif
84
85ifeq ($(CONFIG_VP9_ENCODER),yes)
86  VP9_PREFIX=vp9/
87  include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9cx.mk
88  CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS))
89  CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS))
90  CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
91  CODEC_SRCS-yes += vpx/vpx_ext_ratectrl.h
92  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
93  INSTALL-LIBS-yes += include/vpx/vpx_ext_ratectrl.h
94  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
95  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h vpx/vpx_ext_ratectrl.h
96  CODEC_DOC_SECTIONS += vp9 vp9_encoder
97endif
98
99RC_RTC_SRCS := vpx/vp8.h vpx/vp8cx.h
100RC_RTC_SRCS += vpx/vpx_ext_ratectrl.h
101RC_RTC_SRCS += vpx/internal/vpx_ratectrl_rtc.h
102ifeq ($(CONFIG_VP9_ENCODER),yes)
103  VP9_PREFIX=vp9/
104  RC_RTC_SRCS += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS))
105  RC_RTC_SRCS += $(VP9_PREFIX)vp9cx.mk
106  RC_RTC_SRCS += $(VP9_PREFIX)ratectrl_rtc.cc
107  RC_RTC_SRCS += $(VP9_PREFIX)ratectrl_rtc.h
108  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)ratectrl_rtc.cc
109  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)ratectrl_rtc.h
110endif
111ifeq ($(CONFIG_VP8_ENCODER),yes)
112  VP8_PREFIX=vp8/
113  RC_RTC_SRCS += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
114  RC_RTC_SRCS += $(VP8_PREFIX)vp8_ratectrl_rtc.cc
115  RC_RTC_SRCS += $(VP8_PREFIX)vp8_ratectrl_rtc.h
116  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP8_PREFIX)vp8_ratectrl_rtc.cc
117  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP8_PREFIX)vp8_ratectrl_rtc.h
118endif
119
120ifeq ($(CONFIG_VP9_DECODER),yes)
121  VP9_PREFIX=vp9/
122  include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9dx.mk
123  CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_DX_SRCS))
124  CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_DX_EXPORTS))
125  CODEC_SRCS-yes += $(VP9_PREFIX)vp9dx.mk vpx/vp8.h vpx/vp8dx.h
126  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
127  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
128  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
129  CODEC_DOC_SECTIONS += vp9 vp9_decoder
130endif
131
132ifeq ($(CONFIG_ENCODERS),yes)
133  CODEC_DOC_SECTIONS += encoder
134endif
135ifeq ($(CONFIG_DECODERS),yes)
136  CODEC_DOC_SECTIONS += decoder
137endif
138
139ifeq ($(CONFIG_MSVS),yes)
140CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
141GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd)
142RC_RTC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxrcmt,vpxrcmd)
143# This variable uses deferred expansion intentionally, since the results of
144# $(wildcard) may change during the course of the Make.
145VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
146endif
147
148# The following pairs define a mapping of locations in the distribution
149# tree to locations in the source/build trees.
150INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/%
151INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/%
152INSTALL_MAPS += $(LIBSUBDIR)/%     %
153INSTALL_MAPS += src/%     $(SRC_PATH_BARE)/%
154ifeq ($(CONFIG_MSVS),yes)
155INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Release/%)
156INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Debug/%)
157endif
158
159CODEC_SRCS-yes += build/make/version.sh
160CODEC_SRCS-yes += build/make/rtcd.pl
161CODEC_SRCS-yes += vpx_ports/emmintrin_compat.h
162CODEC_SRCS-yes += vpx_ports/mem_ops.h
163CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h
164CODEC_SRCS-yes += vpx_ports/vpx_once.h
165CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c
166INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
167ifeq ($(VPX_ARCH_X86)$(VPX_ARCH_X86_64),yes)
168INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
169INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += vpx_dsp/x86/bitdepth_conversion_sse2.asm
170endif
171CODEC_EXPORTS-yes += vpx/exports_com
172CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
173CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
174
175INSTALL-LIBS-yes += include/vpx/vpx_codec.h
176INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h
177INSTALL-LIBS-yes += include/vpx/vpx_image.h
178INSTALL-LIBS-yes += include/vpx/vpx_integer.h
179INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
180INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
181INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_tpl.h
182ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
183ifeq ($(CONFIG_MSVS),yes)
184INSTALL-LIBS-yes                  += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib)
185INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib)
186INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll)
187INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp)
188endif
189else
190INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a
191INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
192endif
193
194ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_RATE_CTRL),yesyes)
195  SIMPLE_ENCODE_SRCS := $(call enabled,CODEC_SRCS)
196  SIMPLE_ENCODE_SRCS += $(VP9_PREFIX)simple_encode.cc
197  SIMPLE_ENCODE_SRCS += $(VP9_PREFIX)simple_encode.h
198  SIMPLE_ENCODE_SRCS += ivfenc.h
199  SIMPLE_ENCODE_SRCS += ivfenc.c
200  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)simple_encode.cc
201  INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)simple_encode.h
202endif
203
204CODEC_SRCS=$(call enabled,CODEC_SRCS)
205
206INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)
207INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
208
209
210# Generate a list of all enabled sources, in particular for exporting to gyp
211# based build systems.
212libvpx_srcs.txt:
213	@echo "    [CREATE] $@"
214	@echo $(CODEC_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
215CLEAN-OBJS += libvpx_srcs.txt
216
217libvpxrc_srcs.txt:
218	@echo "    [CREATE] $@"
219	@echo $(RC_RTC_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
220CLEAN-OBJS += libvpxrc_srcs.txt
221
222# Assembly files that are included, but don't define symbols themselves.
223# Filtered out to avoid Windows build warnings.
224ASM_INCLUDES := \
225    third_party/x86inc/x86inc.asm \
226    vpx_config.asm \
227    vpx_ports/x86_abi_support.asm \
228    vpx_dsp/x86/bitdepth_conversion_sse2.asm \
229
230ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
231ifeq ($(CONFIG_MSVS),yes)
232
233vpx.def: $(call enabled,CODEC_EXPORTS)
234	@echo "    [CREATE] $@"
235	$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
236            --name=vpx\
237            --out=$@ $^
238CLEAN-OBJS += vpx.def
239
240vpx.$(VCPROJ_SFX): VCPROJ_SRCS=$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^)
241
242vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
243	@echo "    [CREATE] $@"
244	$(qexec)$(GEN_VCPROJ) \
245            $(if $(CONFIG_SHARED),--dll,--lib) \
246            --target=$(TOOLCHAIN) \
247            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
248            --name=vpx \
249            --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
250            --module-def=vpx.def \
251            --ver=$(CONFIG_VS_VERSION) \
252            --src-path-bare="$(SRC_PATH_BARE)" \
253            --out=$@ $(CFLAGS) \
254            --as=$(AS) \
255            $(filter $(SRC_PATH_BARE)/vp8/%.c, $(VCPROJ_SRCS)) \
256            $(filter $(SRC_PATH_BARE)/vp8/%.h, $(VCPROJ_SRCS)) \
257            $(filter $(SRC_PATH_BARE)/vp9/%.c, $(VCPROJ_SRCS)) \
258            $(filter $(SRC_PATH_BARE)/vp9/%.h, $(VCPROJ_SRCS)) \
259            $(filter $(SRC_PATH_BARE)/vpx/%, $(VCPROJ_SRCS)) \
260            $(filter $(SRC_PATH_BARE)/vpx_dsp/%, $(VCPROJ_SRCS)) \
261            $(filter-out $(addprefix $(SRC_PATH_BARE)/, \
262                           vp8/%.c vp8/%.h vp9/%.c vp9/%.h vpx/% vpx_dsp/%), \
263              $(VCPROJ_SRCS)) \
264            --src-path-bare="$(SRC_PATH_BARE)" \
265
266PROJECTS-yes += vpx.$(VCPROJ_SFX)
267
268vpx.$(VCPROJ_SFX): vpx_config.asm
269vpx.$(VCPROJ_SFX): $(RTCD)
270
271vpxrc.$(VCPROJ_SFX): \
272    VCPROJ_SRCS=$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^)
273
274vpxrc.$(VCPROJ_SFX): $(RC_RTC_SRCS)
275	@echo "    [CREATE] $@"
276	$(qexec)$(GEN_VCPROJ) \
277            $(if $(CONFIG_SHARED),--dll,--lib) \
278            --target=$(TOOLCHAIN) \
279            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
280            --name=vpxrc \
281            --proj-guid=C26FF952-9494-4838-9A3F-7F3D4F613385 \
282            --ver=$(CONFIG_VS_VERSION) \
283            --src-path-bare="$(SRC_PATH_BARE)" \
284            --out=$@ $(CFLAGS) \
285            --as=$(AS) \
286            $(filter $(SRC_PATH_BARE)/vp9/%.c, $(VCPROJ_SRCS)) \
287            $(filter $(SRC_PATH_BARE)/vp9/%.cc, $(VCPROJ_SRCS)) \
288            $(filter $(SRC_PATH_BARE)/vp9/%.h, $(VCPROJ_SRCS)) \
289            $(filter $(SRC_PATH_BARE)/vpx/%, $(VCPROJ_SRCS)) \
290            $(filter $(SRC_PATH_BARE)/vpx_dsp/%, $(VCPROJ_SRCS)) \
291            $(filter-out $(addprefix $(SRC_PATH_BARE)/, \
292                           vp8/%.c vp8/%.h vp9/%.c vp9/%.cc vp9/%.h vpx/% \
293                           vpx_dsp/%), \
294              $(VCPROJ_SRCS)) \
295            --src-path-bare="$(SRC_PATH_BARE)" \
296
297PROJECTS-yes += vpxrc.$(VCPROJ_SFX)
298
299vpxrc.$(VCPROJ_SFX): vpx_config.asm
300vpxrc.$(VCPROJ_SFX): $(RTCD)
301
302endif # ifeq ($(CONFIG_MSVS),yes)
303else # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
304LIBVPX_OBJS=$(call objs, $(filter-out $(ASM_INCLUDES), $(CODEC_SRCS)))
305OBJS-yes += $(LIBVPX_OBJS)
306LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
307$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
308
309# Updating version info.
310# https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
311# For libtool: c=<current>, a=<age>, r=<revision>
312# libtool generates .so file as .so.[c-a].a.r, while -version-info c:r:a is
313# passed to libtool.
314#
315# libvpx library file is generated as libvpx.so.<MAJOR>.<MINOR>.<PATCH>
316# MAJOR = c-a, MINOR = a, PATCH = r
317#
318# To determine SO_VERSION_{MAJOR,MINOR,PATCH}, calculate c,a,r with current
319# SO_VERSION_* then follow the rules in the link to detemine the new version
320# (c1, a1, r1) and set MAJOR to [c1-a1], MINOR to a1 and PATCH to r1
321SO_VERSION_MAJOR := 9
322SO_VERSION_MINOR := 1
323SO_VERSION_PATCH := 0
324ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
325LIBVPX_SO               := libvpx.$(SO_VERSION_MAJOR).dylib
326SHARED_LIB_SUF          := .dylib
327EXPORT_FILE             := libvpx.syms
328LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
329                             libvpx.dylib  )
330else
331ifeq ($(filter iphonesimulator%,$(TGT_OS)),$(TGT_OS))
332LIBVPX_SO               := libvpx.$(SO_VERSION_MAJOR).dylib
333SHARED_LIB_SUF          := .dylib
334EXPORT_FILE             := libvpx.syms
335LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, libvpx.dylib)
336else
337ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS))
338LIBVPX_SO               := libvpx$(SO_VERSION_MAJOR).dll
339SHARED_LIB_SUF          := _dll.a
340EXPORT_FILE             := libvpx.def
341LIBVPX_SO_SYMLINKS      :=
342LIBVPX_SO_IMPLIB        := libvpx_dll.a
343else
344LIBVPX_SO               := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
345SHARED_LIB_SUF          := .so
346EXPORT_FILE             := libvpx.ver
347LIBVPX_SO_SYMLINKS      := $(addprefix $(LIBSUBDIR)/, \
348                             libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
349                             libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
350endif
351endif
352endif
353
354LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
355                           $(notdir $(LIBVPX_SO_SYMLINKS)) \
356                           $(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
357$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
358$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
359$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
360$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
361
362libvpx.def: $(call enabled,CODEC_EXPORTS)
363	@echo "    [CREATE] $@"
364	$(qexec)echo LIBRARY $(LIBVPX_SO:.dll=) INITINSTANCE TERMINSTANCE > $@
365	$(qexec)echo "DATA MULTIPLE NONSHARED" >> $@
366	$(qexec)echo "EXPORTS" >> $@
367	$(qexec)awk '!/vpx_svc_*/ {print "_"$$2}' $^ >>$@
368CLEAN-OBJS += libvpx.def
369
370libvpx_dll.a: $(LIBVPX_SO)
371	@echo "    [IMPLIB] $@"
372	$(qexec)emximp -o $@ $<
373CLEAN-OBJS += libvpx_dll.a
374
375define libvpx_symlink_template
376$(1): $(2)
377	@echo "    [LN]     $(2) $$@"
378	$(qexec)mkdir -p $$(dir $$@)
379	$(qexec)ln -sf $(2) $$@
380endef
381
382$(eval $(call libvpx_symlink_template,\
383    $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
384    $(BUILD_PFX)$(LIBVPX_SO)))
385$(eval $(call libvpx_symlink_template,\
386    $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
387    $(LIBVPX_SO)))
388
389
390INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
391INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
392INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))
393
394
395LIBS-yes += vpx.pc
396vpx.pc: config.mk libs.mk
397	@echo "    [CREATE] $@"
398	$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
399	$(qexec)echo 'prefix=$(PREFIX)' >> $@
400	$(qexec)echo 'exec_prefix=$${prefix}' >> $@
401	$(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
402	$(qexec)echo 'includedir=$${prefix}/include' >> $@
403	$(qexec)echo '' >> $@
404	$(qexec)echo 'Name: vpx' >> $@
405	$(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@
406	$(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@
407	$(qexec)echo 'Requires:' >> $@
408	$(qexec)echo 'Conflicts:' >> $@
409	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
410ifeq ($(HAVE_PTHREAD_H),yes)
411	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
412else
413	$(qexec)echo 'Libs.private: -lm' >> $@
414endif
415	$(qexec)echo 'Cflags: -I$${includedir}' >> $@
416INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
417INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
418CLEAN-OBJS += vpx.pc
419
420ifeq ($(CONFIG_ENCODERS),yes)
421  RC_RTC_OBJS=$(call objs,$(RC_RTC_SRCS))
422  OBJS-yes += $(RC_RTC_OBJS)
423  LIBS-yes += $(BUILD_PFX)libvpxrc.a $(BUILD_PFX)libvpxrc_g.a
424  $(BUILD_PFX)libvpxrc_g.a: $(RC_RTC_OBJS)
425endif
426
427ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_RATE_CTRL),yesyes)
428  SIMPLE_ENCODE_OBJS=$(call objs,$(SIMPLE_ENCODE_SRCS))
429  OBJS-yes += $(SIMPLE_ENCODE_OBJS)
430  LIBS-yes += $(BUILD_PFX)libsimple_encode.a $(BUILD_PFX)libsimple_encode_g.a
431  $(BUILD_PFX)libsimple_encode_g.a: $(SIMPLE_ENCODE_OBJS)
432endif
433
434endif # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
435
436libvpx.ver: $(call enabled,CODEC_EXPORTS)
437	@echo "    [CREATE] $@"
438	$(qexec)echo "{ global:" > $@
439	$(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done
440	$(qexec)echo "local: *; };" >> $@
441CLEAN-OBJS += libvpx.ver
442
443libvpx.syms: $(call enabled,CODEC_EXPORTS)
444	@echo "    [CREATE] $@"
445	$(qexec)awk '{print "_"$$2}' $^ >$@
446CLEAN-OBJS += libvpx.syms
447
448#
449# Rule to make assembler configuration file from C configuration file
450#
451ifeq ($(VPX_ARCH_X86)$(VPX_ARCH_X86_64),yes)
452# YASM
453$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
454	@echo "    [CREATE] $@"
455	@LC_ALL=C grep -E "#define [A-Z0-9_]+ [01]" $< \
456	    | awk '{print $$2 " equ " $$3}' > $@
457else
458ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION))
459$(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
460	@echo "    [CREATE] $@"
461	@LC_ALL=C grep -E "#define [A-Z0-9_]+ [01]" $< \
462	    | awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@
463	@echo "        END" $(ADS2GAS) >> $@
464CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm
465endif
466
467#
468# Add assembler dependencies for configuration.
469#
470$(filter %.S.o,$(OBJS-yes)):     $(BUILD_PFX)vpx_config.asm
471$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
472
473
474$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
475CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
476
477#
478# Add include path for libwebm sources.
479#
480ifeq ($(CONFIG_WEBM_IO),yes)
481  CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/libwebm
482endif
483
484##
485## libvpx test directives
486##
487ifeq ($(CONFIG_UNIT_TESTS),yes)
488LIBVPX_TEST_DATA_PATH ?= .
489
490include $(SRC_PATH_BARE)/test/test.mk
491
492# addprefix_clean behaves like addprefix if the target doesn't start with "../"
493# However, if the target starts with "../", instead of adding prefix,
494# it will remove "../".
495# Using addprefix_clean, we can avoid two different targets building the
496# same file, i.e.
497# test/../ivfenc.c.d: ivfenc.o
498# ivfenc.c.d: ivfenc.o
499# Note that the other way to solve this problem is using "realpath".
500# The "realpath" is supported by make 3.81 or later.
501addprefix_clean=$(patsubst $(1)../%,%,$(addprefix $(1), $(2)))
502LIBVPX_TEST_SRCS=$(call addprefix_clean,test/,$(call enabled,LIBVPX_TEST_SRCS))
503
504LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)
505LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
506                     $(call enabled,LIBVPX_TEST_DATA))
507libvpx_test_data_url=https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx/$(1)
508
509TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
510TEST_INTRA_PRED_SPEED_SRCS=$(call addprefix_clean,test/,\
511                           $(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
512TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
513
514ifeq ($(CONFIG_ENCODERS),yes)
515RC_INTERFACE_TEST_BIN=./test_rc_interface$(EXE_SFX)
516RC_INTERFACE_TEST_SRCS=$(call addprefix_clean,test/,\
517                       $(call enabled,RC_INTERFACE_TEST_SRCS))
518RC_INTERFACE_TEST_OBJS := $(sort $(call objs,$(RC_INTERFACE_TEST_SRCS)))
519endif
520
521SIMPLE_ENCODE_TEST_BIN=./test_simple_encode$(EXE_SFX)
522SIMPLE_ENCODE_TEST_SRCS=$(call addprefix_clean,test/,\
523                        $(call enabled,SIMPLE_ENCODE_TEST_SRCS))
524SIMPLE_ENCODE_TEST_OBJS := $(sort $(call objs,$(SIMPLE_ENCODE_TEST_SRCS)))
525
526libvpx_test_srcs.txt:
527	@echo "    [CREATE] $@"
528	@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
529CLEAN-OBJS += libvpx_test_srcs.txt
530
531# Attempt to download the file using curl, retrying once if it fails for a
532# partial file (18).
533$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
534	@echo "    [DOWNLOAD] $@"
535	$(qexec)( \
536	  trap 'rm -f $@' INT TERM; \
537	  curl="curl -S -s --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))"; \
538	  $$curl; ret=$$?; \
539	  case "$$ret" in \
540	    18) $$curl -C - ;; \
541	    *) exit $$ret ;; \
542	  esac \
543	)
544
545testdata: $(LIBVPX_TEST_DATA)
546	$(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\
547          [ -x "$$(which shasum)" ] && sha1sum=shasum;\
548          [ -x "$$(which sha1)" ] && sha1sum=sha1;\
549          if [ -n "$${sha1sum}" ]; then\
550            set -e;\
551            echo "Checking test data:";\
552            for f in $(call enabled,LIBVPX_TEST_DATA); do\
553                grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
554                    (cd "$(LIBVPX_TEST_DATA_PATH)"; $${sha1sum} -c);\
555            done; \
556        else\
557            echo "Skipping test data integrity check, sha1sum not found.";\
558        fi
559
560ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
561ifeq ($(CONFIG_MSVS),yes)
562
563gtest.$(VCPROJ_SFX): $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
564	@echo "    [CREATE] $@"
565	$(qexec)$(GEN_VCPROJ) \
566            --lib \
567            --target=$(TOOLCHAIN) \
568            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
569            --name=gtest \
570            --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \
571            --ver=$(CONFIG_VS_VERSION) \
572            --src-path-bare="$(SRC_PATH_BARE)" \
573            --as=$(AS) \
574            -D_VARIADIC_MAX=10 \
575            --out=gtest.$(VCPROJ_SFX) $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \
576            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src"
577
578PROJECTS-$(CONFIG_MSVS) += gtest.$(VCPROJ_SFX)
579
580test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
581	@echo "    [CREATE] $@"
582	$(qexec)$(GEN_VCPROJ) \
583            --exe \
584            --target=$(TOOLCHAIN) \
585            --name=test_libvpx \
586            -D_VARIADIC_MAX=10 \
587            --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
588            --ver=$(CONFIG_VS_VERSION) \
589            --src-path-bare="$(SRC_PATH_BARE)" \
590            --as=$(AS) \
591            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
592            --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
593            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
594            $(if $(CONFIG_WEBM_IO),-I"$(SRC_PATH_BARE)/third_party/libwebm") \
595            -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
596
597PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
598
599LIBVPX_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BIN)))
600
601ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
602PROJECTS-$(CONFIG_MSVS) += test_intra_pred_speed.$(VCPROJ_SFX)
603test_intra_pred_speed.$(VCPROJ_SFX): $(TEST_INTRA_PRED_SPEED_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
604	@echo "    [CREATE] $@"
605	$(qexec)$(GEN_VCPROJ) \
606            --exe \
607            --target=$(TOOLCHAIN) \
608            --name=test_intra_pred_speed \
609            -D_VARIADIC_MAX=10 \
610            --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
611            --ver=$(CONFIG_VS_VERSION) \
612            --src-path-bare="$(SRC_PATH_BARE)" \
613            --as=$(AS) \
614            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
615            --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
616            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
617            -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
618endif  # TEST_INTRA_PRED_SPEED
619
620ifeq ($(CONFIG_ENCODERS),yes)
621ifneq ($(strip $(RC_INTERFACE_TEST_OBJS)),)
622PROJECTS-$(CONFIG_MSVS) += test_rc_interface.$(VCPROJ_SFX)
623test_rc_interface.$(VCPROJ_SFX): $(RC_INTERFACE_TEST_SRCS) vpx.$(VCPROJ_SFX) \
624	vpxrc.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
625	@echo "    [CREATE] $@"
626	$(qexec)$(GEN_VCPROJ) \
627            --exe \
628            --target=$(TOOLCHAIN) \
629            --name=test_rc_interface \
630            -D_VARIADIC_MAX=10 \
631            --proj-guid=30458F88-1BC6-4689-B41C-50F3737AAB27 \
632            --ver=$(CONFIG_VS_VERSION) \
633            --as=$(AS) \
634            --src-path-bare="$(SRC_PATH_BARE)" \
635            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
636            --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
637            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
638            -L. -l$(CODEC_LIB) -l$(RC_RTC_LIB) -l$(GTEST_LIB) $^
639endif  # RC_INTERFACE_TEST
640endif  # CONFIG_ENCODERS
641endif  # CONFIG_MSVS
642else
643
644include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
645GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS))
646GTEST_OBJS=$(call objs,$(GTEST_SRCS))
647ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS))
648# Disabling pthreads globally will cause issues on darwin and possibly elsewhere
649$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0
650endif
651GTEST_INCLUDES := -I$(SRC_PATH_BARE)/third_party/googletest/src
652GTEST_INCLUDES += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
653$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
654OBJS-yes += $(GTEST_OBJS)
655LIBS-yes += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
656$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
657
658LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
659$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
660OBJS-yes += $(LIBVPX_TEST_OBJS)
661BINS-yes += $(LIBVPX_TEST_BIN)
662
663CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
664CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
665TEST_LIBS := lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a
666$(LIBVPX_TEST_BIN): $(TEST_LIBS)
667$(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
668              $(LIBVPX_TEST_OBJS) \
669              -L. -lvpx -lgtest $(extralibs) -lm))
670
671ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
672$(TEST_INTRA_PRED_SPEED_OBJS) $(TEST_INTRA_PRED_SPEED_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
673OBJS-yes += $(TEST_INTRA_PRED_SPEED_OBJS)
674BINS-yes += $(TEST_INTRA_PRED_SPEED_BIN)
675
676$(TEST_INTRA_PRED_SPEED_BIN): $(TEST_LIBS)
677$(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
678              $(TEST_INTRA_PRED_SPEED_OBJS) \
679              -L. -lvpx -lgtest $(extralibs) -lm))
680endif  # TEST_INTRA_PRED_SPEED
681
682ifeq ($(CONFIG_ENCODERS),yes)
683ifneq ($(strip $(RC_INTERFACE_TEST_OBJS)),)
684$(RC_INTERFACE_TEST_OBJS) $(RC_INTERFACE_TEST_OBJS:.o=.d): \
685  CXXFLAGS += $(GTEST_INCLUDES)
686OBJS-yes += $(RC_INTERFACE_TEST_OBJS)
687BINS-yes += $(RC_INTERFACE_TEST_BIN)
688
689$(RC_INTERFACE_TEST_BIN): $(TEST_LIBS) libvpxrc.a
690$(eval $(call linkerxx_template,$(RC_INTERFACE_TEST_BIN), \
691              $(RC_INTERFACE_TEST_OBJS) \
692              -L. -lvpx -lgtest -lvpxrc $(extralibs) -lm))
693endif  # RC_INTERFACE_TEST
694endif  # CONFIG_ENCODERS
695
696ifneq ($(strip $(SIMPLE_ENCODE_TEST_OBJS)),)
697$(SIMPLE_ENCODE_TEST_OBJS) $(SIMPLE_ENCODE_TEST_OBJS:.o=.d): \
698  CXXFLAGS += $(GTEST_INCLUDES)
699OBJS-yes += $(SIMPLE_ENCODE_TEST_OBJS)
700BINS-yes += $(SIMPLE_ENCODE_TEST_BIN)
701
702$(SIMPLE_ENCODE_TEST_BIN): $(TEST_LIBS) libsimple_encode.a
703$(eval $(call linkerxx_template,$(SIMPLE_ENCODE_TEST_BIN), \
704              $(SIMPLE_ENCODE_TEST_OBJS) \
705              -L. -lsimple_encode -lvpx -lgtest $(extralibs) -lm))
706endif  # SIMPLE_ENCODE_TEST
707
708endif  # CONFIG_EXTERNAL_BUILD
709
710# Install test sources only if codec source is included
711INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
712    $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
713INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
714INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
715INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(RC_INTERFACE_TEST_SRCS)
716
717define test_shard_template
718test: test_shard.$(1)
719test-no-data-check: test_shard_ndc.$(1)
720test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN)
721	@set -e; \
722	 export GTEST_SHARD_INDEX=$(1); \
723	 export GTEST_TOTAL_SHARDS=$(2); \
724	 $(LIBVPX_TEST_BIN)
725test_shard.$(1): testdata
726.PHONY: test_shard.$(1) test_shard_ndc.$(1)
727endef
728
729NUM_SHARDS := 10
730SHARDS := 0 1 2 3 4 5 6 7 8 9
731$(foreach s,$(SHARDS),$(eval $(call test_shard_template,$(s),$(NUM_SHARDS))))
732
733endif  # CONFIG_UNIT_TESTS
734
735##
736## documentation directives
737##
738CLEAN-OBJS += libs.doxy
739DOCS-yes += libs.doxy
740libs.doxy: $(CODEC_DOC_SRCS)
741	@echo "    [CREATE] $@"
742	@rm -f $@
743	@echo "INPUT += $^" >> $@
744	@echo "INCLUDE_PATH += ." >> $@;
745	@echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@
746
747## Generate rtcd.h for all objects
748ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes)
749$(OBJS-yes:.o=.d): $(RTCD)
750else
751$(OBJS-yes): $(RTCD)
752endif
753
754## Update the global src list
755SRCS += $(CODEC_SRCS) $(LIBVPX_TEST_SRCS) $(GTEST_SRCS)
756SRCS += $(RC_INTERFACE_TEST_SRCS)
757
758##
759## vpxdec/vpxenc tests.
760##
761ifeq ($(CONFIG_UNIT_TESTS),yes)
762TEST_BIN_PATH = .
763ifeq ($(CONFIG_MSVS),yes)
764# MSVC will build both Debug and Release configurations of tools in a
765# sub directory named for the current target. Assume the user wants to
766# run the Release tools, and assign TEST_BIN_PATH accordingly.
767# TODO(tomfinegan): Is this adequate for ARM?
768# TODO(tomfinegan): Support running the debug versions of tools?
769TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH))
770endif
771utiltest utiltest-no-data-check:
772	$(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \
773		--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
774		--bin-path $(TEST_BIN_PATH)
775	$(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \
776		--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
777		--bin-path $(TEST_BIN_PATH)
778utiltest: testdata
779else
780utiltest utiltest-no-data-check:
781	@echo Unit tests must be enabled to make the utiltest target.
782endif
783
784##
785## Example tests.
786##
787ifeq ($(CONFIG_UNIT_TESTS),yes)
788# All non-MSVC targets output example targets in a sub dir named examples.
789EXAMPLES_BIN_PATH = examples
790ifeq ($(CONFIG_MSVS),yes)
791# MSVC will build both Debug and Release configurations of the examples in a
792# sub directory named for the current target. Assume the user wants to
793# run the Release tools, and assign EXAMPLES_BIN_PATH accordingly.
794# TODO(tomfinegan): Is this adequate for ARM?
795# TODO(tomfinegan): Support running the debug versions of tools?
796EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
797endif
798exampletest exampletest-no-data-check: examples
799	$(qexec)$(SRC_PATH_BARE)/test/examples.sh \
800		--test-data-path "$(LIBVPX_TEST_DATA_PATH)" \
801		--bin-path $(EXAMPLES_BIN_PATH)
802exampletest: testdata
803else
804exampletest exampletest-no-data-check:
805	@echo Unit tests must be enabled to make the exampletest target.
806endif
807