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