John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | ## |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | ## |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | ## Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 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 |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | ## in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | ## be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | ## |
| 10 | |
| 11 | |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 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) |
| 16 | else |
| 17 | ASM:=.asm |
| 18 | endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 19 | |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 20 | # |
| 21 | # Calculate platform- and compiler-specific offsets for hand coded assembly |
| 22 | # |
| 23 | ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC)) |
| 24 | OFFSET_PATTERN:='^[a-zA-Z0-9_]* EQU' |
| 25 | define asm_offsets_template |
John Koleszar | 1760c39 | 2012-11-27 15:54:54 -0800 | [diff] [blame] | 26 | $$(BUILD_PFX)$(1): $$(BUILD_PFX)$(2).S |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 27 | @echo " [CREATE] $$@" |
| 28 | $$(qexec)LC_ALL=C grep $$(OFFSET_PATTERN) $$< | tr -d '$$$$\#' $$(ADS2GAS) > $$@ |
John Koleszar | 1760c39 | 2012-11-27 15:54:54 -0800 | [diff] [blame] | 29 | $$(BUILD_PFX)$(2).S: $(2) |
| 30 | CLEAN-OBJS += $$(BUILD_PFX)$(1) $(2).S |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 31 | endef |
| 32 | else |
| 33 | ifeq ($(filter rvct,$(TGT_CC)), $(TGT_CC)) |
| 34 | define asm_offsets_template |
| 35 | $$(BUILD_PFX)$(1): obj_int_extract |
John Koleszar | 1760c39 | 2012-11-27 15:54:54 -0800 | [diff] [blame] | 36 | $$(BUILD_PFX)$(1): $$(BUILD_PFX)$(2).o |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 37 | @echo " [CREATE] $$@" |
| 38 | $$(qexec)./obj_int_extract rvds $$< $$(ADS2GAS) > $$@ |
John Koleszar | 1760c39 | 2012-11-27 15:54:54 -0800 | [diff] [blame] | 39 | OBJS-yes += $$(BUILD_PFX)$(2).o |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 40 | CLEAN-OBJS += $$(BUILD_PFX)$(1) |
| 41 | $$(filter %$$(ASM).o,$$(OBJS-yes)): $$(BUILD_PFX)$(1) |
| 42 | endef |
| 43 | endif # rvct |
| 44 | endif # !gcc |
| 45 | |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 46 | # |
| 47 | # Rule to generate runtime cpu detection files |
| 48 | # |
| 49 | define rtcd_h_template |
| 50 | $$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2) |
| 51 | @echo " [CREATE] $$@" |
| 52 | $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$$(TGT_ISA) \ |
| 53 | --sym=$(1) \ |
Johann | 3810bca | 2013-04-17 10:52:50 -0700 | [diff] [blame] | 54 | --config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \ |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 55 | $$(RTCD_OPTIONS) $$^ > $$@ |
| 56 | CLEAN-OBJS += $$(BUILD_PFX)$(1).h |
| 57 | RTCD += $$(BUILD_PFX)$(1).h |
| 58 | endef |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 59 | |
Johann | 5d88a82 | 2012-03-05 16:36:23 -0800 | [diff] [blame] | 60 | CODEC_SRCS-yes += CHANGELOG |
John Koleszar | 4d86ef3 | 2010-06-22 08:44:48 -0400 | [diff] [blame] | 61 | CODEC_SRCS-yes += libs.mk |
| 62 | |
Johann | a5ffcdd | 2012-11-15 16:28:20 -0800 | [diff] [blame] | 63 | # If this is a universal (fat) binary, then all the subarchitectures have |
| 64 | # already been built and our job is to stitch them together. The |
| 65 | # BUILD_LIBVPX variable indicates whether we should be building |
| 66 | # (compiling, linking) the library. The LIPO_LIBVPX variable indicates |
| 67 | # that we're stitching. |
| 68 | $(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes) |
| 69 | |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 70 | include $(SRC_PATH_BARE)/vpx/vpx_codec.mk |
| 71 | CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS)) |
Johann | 999f31f | 2012-11-15 17:19:44 -0800 | [diff] [blame] | 72 | CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 73 | |
| 74 | include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk |
| 75 | CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS)) |
| 76 | |
| 77 | include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk |
| 78 | CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS)) |
| 79 | |
Johann | a5ffcdd | 2012-11-15 16:28:20 -0800 | [diff] [blame] | 80 | include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk |
| 81 | CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS)) |
| 82 | |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 83 | ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),) |
| 84 | VP8_PREFIX=vp8/ |
| 85 | include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk |
| 86 | endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 87 | |
| 88 | ifeq ($(CONFIG_VP8_ENCODER),yes) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 89 | include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk |
| 90 | CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS)) |
| 91 | CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS)) |
John Koleszar | 2bf8fb5 | 2012-05-02 16:37:37 -0700 | [diff] [blame] | 92 | INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 93 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/% |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 94 | CODEC_DOC_SECTIONS += vp8 vp8_encoder |
| 95 | endif |
| 96 | |
| 97 | ifeq ($(CONFIG_VP8_DECODER),yes) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 98 | include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk |
| 99 | CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS)) |
| 100 | CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS)) |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 101 | INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h |
| 102 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/% |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 103 | CODEC_DOC_SECTIONS += vp8 vp8_decoder |
| 104 | endif |
| 105 | |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 106 | ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),) |
| 107 | VP9_PREFIX=vp9/ |
| 108 | include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk |
| 109 | endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 110 | |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 111 | ifeq ($(CONFIG_VP9_ENCODER),yes) |
| 112 | VP9_PREFIX=vp9/ |
| 113 | include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9cx.mk |
| 114 | CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_CX_SRCS)) |
| 115 | CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS)) |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 116 | CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h |
John Koleszar | 7b8dfcb | 2012-11-06 16:59:01 -0800 | [diff] [blame] | 117 | INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 118 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/% |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 119 | CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 120 | CODEC_DOC_SECTIONS += vp9 vp9_encoder |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 121 | endif |
| 122 | |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 123 | ifeq ($(CONFIG_VP9_DECODER),yes) |
| 124 | VP9_PREFIX=vp9/ |
| 125 | include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9dx.mk |
| 126 | CODEC_SRCS-yes += $(addprefix $(VP9_PREFIX),$(call enabled,VP9_DX_SRCS)) |
| 127 | CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_DX_EXPORTS)) |
| 128 | CODEC_SRCS-yes += $(VP9_PREFIX)vp9dx.mk vpx/vp8.h vpx/vp8dx.h |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 129 | INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 130 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/% |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 131 | CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 132 | CODEC_DOC_SECTIONS += vp9 vp9_decoder |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 133 | endif |
| 134 | |
| 135 | |
| 136 | ifeq ($(CONFIG_ENCODERS),yes) |
| 137 | CODEC_DOC_SECTIONS += encoder |
| 138 | endif |
| 139 | ifeq ($(CONFIG_DECODERS),yes) |
| 140 | CODEC_DOC_SECTIONS += decoder |
| 141 | endif |
| 142 | |
| 143 | |
| 144 | ifeq ($(CONFIG_MSVS),yes) |
| 145 | CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd) |
James Berry | 0cc044f | 2012-05-02 18:09:54 -0400 | [diff] [blame] | 146 | GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 147 | # This variable uses deferred expansion intentionally, since the results of |
| 148 | # $(wildcard) may change during the course of the Make. |
| 149 | VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d)))) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 150 | endif |
| 151 | |
| 152 | # The following pairs define a mapping of locations in the distribution |
| 153 | # tree to locations in the source/build trees. |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 154 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx/% |
| 155 | INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/vpx_ports/% |
John Koleszar | 670af3a | 2010-05-26 15:57:42 -0400 | [diff] [blame] | 156 | INSTALL_MAPS += $(LIBSUBDIR)/% % |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 157 | INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% |
| 158 | ifeq ($(CONFIG_MSVS),yes) |
John Koleszar | 670af3a | 2010-05-26 15:57:42 -0400 | [diff] [blame] | 159 | INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%) |
| 160 | INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 161 | endif |
| 162 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 163 | CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh |
John Koleszar | a910049 | 2011-08-19 14:06:00 -0400 | [diff] [blame] | 164 | CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh |
John Koleszar | 5ebe94f | 2012-12-23 07:20:10 -0800 | [diff] [blame] | 165 | CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h |
| 166 | CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 167 | CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c |
| 168 | INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c |
John Koleszar | 2396302 | 2013-01-16 16:44:33 -0800 | [diff] [blame] | 169 | ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) |
Ronald S. Bultje | 42a7f68 | 2012-06-19 15:34:49 -0700 | [diff] [blame] | 170 | CODEC_SRCS-$(BUILD_LIBVPX) += third_party/x86inc/x86inc.asm |
John Koleszar | 2396302 | 2013-01-16 16:44:33 -0800 | [diff] [blame] | 171 | endif |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 172 | CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com |
| 173 | CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc |
| 174 | CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 175 | |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 176 | INSTALL-LIBS-yes += include/vpx/vpx_codec.h |
| 177 | INSTALL-LIBS-yes += include/vpx/vpx_image.h |
| 178 | INSTALL-LIBS-yes += include/vpx/vpx_integer.h |
| 179 | INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_top.h |
| 180 | INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.h |
| 181 | INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h |
John Koleszar | b749234 | 2010-05-24 11:39:59 -0400 | [diff] [blame] | 182 | INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 183 | ifeq ($(CONFIG_EXTERNAL_BUILD),yes) |
| 184 | ifeq ($(CONFIG_MSVS),yes) |
John Koleszar | 670af3a | 2010-05-26 15:57:42 -0400 | [diff] [blame] | 185 | INSTALL-LIBS-yes += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB).lib) |
| 186 | INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/$(CODEC_LIB)d.lib) |
| 187 | INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.dll) |
| 188 | INSTALL-LIBS-$(CONFIG_SHARED) += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/vpx.exp) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 189 | endif |
| 190 | else |
James Zern | 495b241 | 2011-07-25 15:40:36 -0700 | [diff] [blame] | 191 | INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a |
John Koleszar | 670af3a | 2010-05-26 15:57:42 -0400 | [diff] [blame] | 192 | INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 193 | endif |
| 194 | |
John Koleszar | 5ebe94f | 2012-12-23 07:20:10 -0800 | [diff] [blame] | 195 | CODEC_SRCS=$(call enabled,CODEC_SRCS) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 196 | INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS) |
| 197 | INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS) |
| 198 | |
John Koleszar | 5e562c7 | 2011-08-12 14:59:10 -0400 | [diff] [blame] | 199 | |
| 200 | # Generate a list of all enabled sources, in particular for exporting to gyp |
| 201 | # based build systems. |
| 202 | libvpx_srcs.txt: |
| 203 | @echo " [CREATE] $@" |
| 204 | @echo $(CODEC_SRCS) | xargs -n1 echo | sort -u > $@ |
| 205 | |
| 206 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 207 | ifeq ($(CONFIG_EXTERNAL_BUILD),yes) |
| 208 | ifeq ($(CONFIG_MSVS),yes) |
| 209 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 210 | obj_int_extract.$(VCPROJ_SFX): $(SRC_PATH_BARE)/build/make/obj_int_extract.c |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 211 | @cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat . |
| 212 | @echo " [CREATE] $@" |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 213 | $(qexec)$(GEN_VCPROJ) \ |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 214 | --exe \ |
| 215 | --target=$(TOOLCHAIN) \ |
| 216 | --name=obj_int_extract \ |
| 217 | --ver=$(CONFIG_VS_VERSION) \ |
| 218 | --proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2 \ |
| 219 | $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ |
| 220 | --out=$@ $^ \ |
| 221 | -I. \ |
| 222 | -I"$(SRC_PATH_BARE)" \ |
| 223 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 224 | PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.$(VCPROJ_SFX) |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 225 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 226 | vpx.def: $(call enabled,CODEC_EXPORTS) |
| 227 | @echo " [CREATE] $@" |
James Zern | e8d58d3 | 2012-08-15 11:47:13 -0700 | [diff] [blame] | 228 | $(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 229 | --name=vpx\ |
| 230 | --out=$@ $^ |
| 231 | CLEAN-OBJS += vpx.def |
| 232 | |
Martin Storsjo | 9a5cac0 | 2013-05-18 19:57:19 +0300 | [diff] [blame] | 233 | vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def obj_int_extract.$(VCPROJ_SFX) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 234 | @echo " [CREATE] $@" |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 235 | $(qexec)$(GEN_VCPROJ) \ |
Jim Bankoski | 1b16e74 | 2012-07-23 12:32:59 -0700 | [diff] [blame] | 236 | $(if $(CONFIG_SHARED),--dll,--lib) \ |
| 237 | --target=$(TOOLCHAIN) \ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 238 | $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 239 | --name=vpx \ |
| 240 | --proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \ |
| 241 | --module-def=vpx.def \ |
| 242 | --ver=$(CONFIG_VS_VERSION) \ |
| 243 | --out=$@ $(CFLAGS) $^ \ |
| 244 | --src-path-bare="$(SRC_PATH_BARE)" \ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 245 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 246 | PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 247 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 248 | vpx.$(VCPROJ_SFX): vpx_config.asm |
| 249 | vpx.$(VCPROJ_SFX): $(RTCD) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 250 | |
| 251 | endif |
| 252 | else |
| 253 | LIBVPX_OBJS=$(call objs,$(CODEC_SRCS)) |
| 254 | OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS) |
John Koleszar | 06f58c0 | 2011-08-03 09:20:37 -0400 | [diff] [blame] | 255 | LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 256 | $(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS) |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 257 | |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 258 | |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 259 | BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED)) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 260 | |
| 261 | ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS)) |
| 262 | LIBVPX_SO := libvpx.$(VERSION_MAJOR).dylib |
| 263 | EXPORT_FILE := libvpx.syms |
| 264 | LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ |
| 265 | libvpx.dylib ) |
| 266 | else |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 267 | LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 268 | EXPORT_FILE := libvpx.ver |
| 269 | SYM_LINK := libvpx.so |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 270 | LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \ |
| 271 | libvpx.so libvpx.so.$(VERSION_MAJOR) \ |
| 272 | libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR)) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 273 | endif |
| 274 | |
| 275 | LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\ |
| 276 | $(notdir $(LIBVPX_SO_SYMLINKS)) |
| 277 | $(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE) |
| 278 | $(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm |
| 279 | $(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR) |
| 280 | $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE) |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 281 | |
| 282 | libvpx.ver: $(call enabled,CODEC_EXPORTS) |
| 283 | @echo " [CREATE] $@" |
| 284 | $(qexec)echo "{ global:" > $@ |
| 285 | $(qexec)for f in $?; do awk '{print $$2";"}' < $$f >>$@; done |
| 286 | $(qexec)echo "local: *; };" >> $@ |
| 287 | CLEAN-OBJS += libvpx.ver |
| 288 | |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 289 | libvpx.syms: $(call enabled,CODEC_EXPORTS) |
| 290 | @echo " [CREATE] $@" |
| 291 | $(qexec)awk '{print "_"$$2}' $^ >$@ |
| 292 | CLEAN-OBJS += libvpx.syms |
| 293 | |
James Zern | 495b241 | 2011-07-25 15:40:36 -0700 | [diff] [blame] | 294 | define libvpx_symlink_template |
| 295 | $(1): $(2) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 296 | @echo " [LN] $(2) $$@" |
John Koleszar | 5ebe94f | 2012-12-23 07:20:10 -0800 | [diff] [blame] | 297 | $(qexec)mkdir -p $$(dir $$@) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 298 | $(qexec)ln -sf $(2) $$@ |
James Zern | 495b241 | 2011-07-25 15:40:36 -0700 | [diff] [blame] | 299 | endef |
| 300 | |
| 301 | $(eval $(call libvpx_symlink_template,\ |
| 302 | $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\ |
| 303 | $(BUILD_PFX)$(LIBVPX_SO))) |
| 304 | $(eval $(call libvpx_symlink_template,\ |
| 305 | $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\ |
John Koleszar | 5ebe94f | 2012-12-23 07:20:10 -0800 | [diff] [blame] | 306 | $(LIBVPX_SO))) |
John Koleszar | 7aa97a3 | 2010-06-03 10:29:04 -0400 | [diff] [blame] | 307 | |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 308 | |
| 309 | INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS) |
| 310 | INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBSUBDIR)/$(LIBVPX_SO) |
| 311 | |
Ralph Giles | 607f842 | 2011-03-28 12:04:51 -0700 | [diff] [blame] | 312 | |
| 313 | LIBS-$(BUILD_LIBVPX) += vpx.pc |
| 314 | vpx.pc: config.mk libs.mk |
| 315 | @echo " [CREATE] $@" |
| 316 | $(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@ |
| 317 | $(qexec)echo 'prefix=$(PREFIX)' >> $@ |
| 318 | $(qexec)echo 'exec_prefix=$${prefix}' >> $@ |
Takanori MATSUURA | a7eea3e | 2012-04-20 15:11:46 -0700 | [diff] [blame] | 319 | $(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@ |
Ralph Giles | 607f842 | 2011-03-28 12:04:51 -0700 | [diff] [blame] | 320 | $(qexec)echo 'includedir=$${prefix}/include' >> $@ |
| 321 | $(qexec)echo '' >> $@ |
| 322 | $(qexec)echo 'Name: vpx' >> $@ |
| 323 | $(qexec)echo 'Description: WebM Project VPx codec implementation' >> $@ |
| 324 | $(qexec)echo 'Version: $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)' >> $@ |
| 325 | $(qexec)echo 'Requires:' >> $@ |
| 326 | $(qexec)echo 'Conflicts:' >> $@ |
Ronald S. Bultje | a742a73 | 2012-06-25 09:58:09 -0700 | [diff] [blame] | 327 | $(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@ |
Johann | b46d58a | 2013-01-18 11:31:22 -0800 | [diff] [blame] | 328 | ifeq ($(HAVE_PTHREAD_H),yes) |
John Koleszar | bd6ffaa | 2012-08-21 10:54:30 -0700 | [diff] [blame] | 329 | $(qexec)echo 'Libs.private: -lm -lpthread' >> $@ |
Johann | b46d58a | 2013-01-18 11:31:22 -0800 | [diff] [blame] | 330 | else |
| 331 | $(qexec)echo 'Libs.private: -lm' >> $@ |
| 332 | endif |
Ralph Giles | 607f842 | 2011-03-28 12:04:51 -0700 | [diff] [blame] | 333 | $(qexec)echo 'Cflags: -I$${includedir}' >> $@ |
| 334 | INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc |
| 335 | INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc |
| 336 | CLEAN-OBJS += vpx.pc |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 337 | endif |
| 338 | |
| 339 | LIBS-$(LIPO_LIBVPX) += libvpx.a |
| 340 | $(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a))) |
| 341 | |
| 342 | # |
| 343 | # Rule to make assembler configuration file from C configuration file |
| 344 | # |
| 345 | ifeq ($(ARCH_X86)$(ARCH_X86_64),yes) |
| 346 | # YASM |
| 347 | $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h |
| 348 | @echo " [CREATE] $@" |
| 349 | @egrep "#define [A-Z0-9_]+ [01]" $< \ |
| 350 | | awk '{print $$2 " equ " $$3}' > $@ |
| 351 | else |
| 352 | ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION)) |
| 353 | $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h |
| 354 | @echo " [CREATE] $@" |
| 355 | @egrep "#define [A-Z0-9_]+ [01]" $< \ |
| 356 | | awk '{print $$2 " EQU " $$3}' $(ADS2GAS) > $@ |
| 357 | @echo " END" $(ADS2GAS) >> $@ |
| 358 | CLEAN-OBJS += $(BUILD_PFX)vpx_config.asm |
| 359 | endif |
| 360 | |
| 361 | # |
| 362 | # Add assembler dependencies for configuration and offsets |
| 363 | # |
Johann | 128d2c2 | 2011-03-02 09:44:39 -0500 | [diff] [blame] | 364 | $(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm |
| 365 | $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 366 | |
Johann | 40dcae9 | 2011-02-04 17:44:31 -0500 | [diff] [blame] | 367 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 368 | $(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h) |
| 369 | CLEAN-OBJS += $(BUILD_PFX)vpx_version.h |
| 370 | |
John Koleszar | a910049 | 2011-08-19 14:06:00 -0400 | [diff] [blame] | 371 | |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 372 | ## |
| 373 | ## libvpx test directives |
| 374 | ## |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 375 | ifeq ($(CONFIG_UNIT_TESTS),yes) |
John Koleszar | 0074863 | 2012-06-20 14:45:22 -0700 | [diff] [blame] | 376 | LIBVPX_TEST_DATA_PATH ?= . |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 377 | |
| 378 | include $(SRC_PATH_BARE)/test/test.mk |
| 379 | LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS)) |
KO Myung-Hun | a344456 | 2013-02-22 12:35:18 +0900 | [diff] [blame] | 380 | LIBVPX_TEST_BINS=./test_libvpx$(EXE_SFX) |
John Koleszar | 0074863 | 2012-06-20 14:45:22 -0700 | [diff] [blame] | 381 | LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\ |
| 382 | $(call enabled,LIBVPX_TEST_DATA)) |
| 383 | libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1) |
| 384 | |
| 385 | $(LIBVPX_TEST_DATA): |
| 386 | @echo " [DOWNLOAD] $@" |
| 387 | $(qexec)trap 'rm -f $@' INT TERM &&\ |
| 388 | curl -L -o $@ $(call libvpx_test_data_url,$(@F)) |
| 389 | |
| 390 | testdata:: $(LIBVPX_TEST_DATA) |
| 391 | $(qexec)if [ -x "$$(which sha1sum)" ]; then\ |
| 392 | echo "Checking test data:";\ |
John Koleszar | acd147c | 2012-06-29 12:15:00 -0700 | [diff] [blame] | 393 | if [ -n "$(LIBVPX_TEST_DATA)" ]; then\ |
| 394 | for f in $(call enabled,LIBVPX_TEST_DATA); do\ |
| 395 | grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\ |
| 396 | (cd $(LIBVPX_TEST_DATA_PATH); sha1sum -c);\ |
| 397 | done; \ |
| 398 | fi; \ |
John Koleszar | 0074863 | 2012-06-20 14:45:22 -0700 | [diff] [blame] | 399 | else\ |
| 400 | echo "Skipping test data integrity check, sha1sum not found.";\ |
| 401 | fi |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 402 | |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 403 | ifeq ($(CONFIG_EXTERNAL_BUILD),yes) |
| 404 | ifeq ($(CONFIG_MSVS),yes) |
| 405 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 406 | gtest.$(VCPROJ_SFX): $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 407 | @echo " [CREATE] $@" |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 408 | $(qexec)$(GEN_VCPROJ) \ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 409 | --lib \ |
| 410 | --target=$(TOOLCHAIN) \ |
| 411 | $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ |
| 412 | --name=gtest \ |
| 413 | --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \ |
| 414 | --ver=$(CONFIG_VS_VERSION) \ |
| 415 | --src-path-bare="$(SRC_PATH_BARE)" \ |
Yaowu Xu | c202100 | 2012-12-04 12:28:10 -0800 | [diff] [blame] | 416 | -D_VARIADIC_MAX=10 \ |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 417 | --out=gtest.$(VCPROJ_SFX) $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 418 | -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src" |
| 419 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 420 | PROJECTS-$(CONFIG_MSVS) += gtest.$(VCPROJ_SFX) |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 421 | |
Martin Storsjo | 9a5cac0 | 2013-05-18 19:57:19 +0300 | [diff] [blame] | 422 | test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX) |
John Koleszar | 7f63bfa | 2012-06-01 10:43:47 -0700 | [diff] [blame] | 423 | @echo " [CREATE] $@" |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 424 | $(qexec)$(GEN_VCPROJ) \ |
John Koleszar | 7f63bfa | 2012-06-01 10:43:47 -0700 | [diff] [blame] | 425 | --exe \ |
| 426 | --target=$(TOOLCHAIN) \ |
| 427 | --name=test_libvpx \ |
Yaowu Xu | c202100 | 2012-12-04 12:28:10 -0800 | [diff] [blame] | 428 | -D_VARIADIC_MAX=10 \ |
John Koleszar | 7f63bfa | 2012-06-01 10:43:47 -0700 | [diff] [blame] | 429 | --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \ |
| 430 | --ver=$(CONFIG_VS_VERSION) \ |
| 431 | $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ |
| 432 | --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 433 | -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \ |
Martin Storsjo | a37e84d | 2013-05-19 12:21:29 +0300 | [diff] [blame^] | 434 | -L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 435 | |
Martin Storsjo | 0b4637e | 2013-05-17 00:56:46 +0300 | [diff] [blame] | 436 | PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX) |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 437 | |
John Koleszar | 0074863 | 2012-06-20 14:45:22 -0700 | [diff] [blame] | 438 | test:: testdata |
James Zern | 8b4b28a | 2013-04-05 11:56:54 -0700 | [diff] [blame] | 439 | @set -e; for t in $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 440 | endif |
| 441 | else |
| 442 | |
| 443 | include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk |
| 444 | GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS)) |
| 445 | GTEST_OBJS=$(call objs,$(GTEST_SRCS)) |
John Koleszar | 8631c1b | 2012-05-22 10:37:20 -0700 | [diff] [blame] | 446 | $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src |
| 447 | $(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 448 | OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS) |
| 449 | LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a |
| 450 | $(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS) |
| 451 | |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 452 | LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS))) |
| 453 | $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src |
| 454 | $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 455 | OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS) |
James Zern | 97fd7c5 | 2012-08-15 11:45:12 -0700 | [diff] [blame] | 456 | BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS) |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 457 | |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 458 | # Install test sources only if codec source is included |
| 459 | INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\ |
| 460 | $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f)) |
| 461 | INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS) |
| 462 | |
John Koleszar | acd147c | 2012-06-29 12:15:00 -0700 | [diff] [blame] | 463 | CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) |
| 464 | CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a) |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 465 | $(foreach bin,$(LIBVPX_TEST_BINS),\ |
John Koleszar | acd147c | 2012-06-29 12:15:00 -0700 | [diff] [blame] | 466 | $(if $(BUILD_LIBVPX),$(eval $(bin): \ |
| 467 | lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 468 | $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\ |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 469 | $(LIBVPX_TEST_OBJS) \ |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 470 | -L. -lvpx -lgtest -lpthread -lm)\ |
| 471 | )))\ |
| 472 | $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\ |
| 473 | |
John Koleszar | 0074863 | 2012-06-20 14:45:22 -0700 | [diff] [blame] | 474 | test:: $(LIBVPX_TEST_BINS) testdata |
James Berry | 07c71ef | 2011-11-04 11:48:30 -0400 | [diff] [blame] | 475 | @set -e; for t in $(LIBVPX_TEST_BINS); do $$t; done |
| 476 | |
| 477 | endif |
| 478 | endif |
| 479 | |
| 480 | ## |
| 481 | ## documentation directives |
| 482 | ## |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 483 | CLEAN-OBJS += libs.doxy |
| 484 | DOCS-yes += libs.doxy |
| 485 | libs.doxy: $(CODEC_DOC_SRCS) |
| 486 | @echo " [CREATE] $@" |
| 487 | @rm -f $@ |
| 488 | @echo "INPUT += $^" >> $@ |
| 489 | @echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@ |
| 490 | @echo "INCLUDE_PATH += ." >> $@; |
| 491 | @echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@ |
John Koleszar | e82d261 | 2012-05-16 16:25:51 -0700 | [diff] [blame] | 492 | |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 493 | ## Generate rtcd.h for all objects |
| 494 | $(OBJS-yes:.o=.d): $(RTCD) |
John Koleszar | b72373d | 2012-10-31 13:13:19 -0700 | [diff] [blame] | 495 | |
| 496 | ## Update the global src list |
| 497 | SRCS += $(CODEC_SRCS) $(LIBVPX_TEST_SRCS) $(GTEST_SRCS) |