2 ## Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
4 ## Use of this source code is governed by a BSD-style license and patent
5 ## grant that can be found in the LICENSE file in the root of the source
6 ## tree. All contributing project authors may be found in the AUTHORS
7 ## file in the root of the source tree.
11 ASM
:=$(if
$(filter yes
,$(CONFIG_GCC
)),.asm.s
,.asm
)
13 include $(SRC_PATH_BARE
)/vpx
/vpx_codec.mk
14 CODEC_SRCS-yes
+= $(addprefix vpx
/,$(call enabled
,API_SRCS
))
16 include $(SRC_PATH_BARE
)/vpx_mem
/vpx_mem.mk
17 CODEC_SRCS-yes
+= $(addprefix vpx_mem
/,$(call enabled
,MEM_SRCS
))
19 include $(SRC_PATH_BARE
)/vpx_scale
/vpx_scale.mk
20 CODEC_SRCS-yes
+= $(addprefix vpx_scale
/,$(call enabled
,SCALE_SRCS
))
23 ifeq ($(CONFIG_VP8_ENCODER
),yes
)
25 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8cx.mk
26 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_CX_SRCS
))
27 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_CX_EXPORTS
))
28 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8cx.mk vpx
/vp8.h vpx
/vp8cx.h vpx
/vp8e.h
29 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8e.h
include/vpx
/vp8cx.h
30 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
31 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8cx.h
32 CODEC_DOC_SECTIONS
+= vp8 vp8_encoder
35 ifeq ($(CONFIG_VP8_DECODER
),yes
)
37 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8dx.mk
38 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_DX_SRCS
))
39 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_DX_EXPORTS
))
40 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8dx.mk vpx
/vp8.h vpx
/vp8dx.h
41 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8dx.h
42 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
43 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8dx.h
44 CODEC_DOC_SECTIONS
+= vp8 vp8_decoder
48 ifeq ($(CONFIG_ENCODERS
),yes
)
49 CODEC_DOC_SECTIONS
+= encoder
51 ifeq ($(CONFIG_DECODERS
),yes
)
52 CODEC_DOC_SECTIONS
+= decoder
56 ifeq ($(CONFIG_MSVS
),yes
)
57 CODEC_LIB
=$(if
$(CONFIG_STATIC_MSVCRT
),vpxmt
,vpxmd
)
58 # This variable uses deferred expansion intentionally, since the results of
59 # $(wildcard) may change during the course of the Make.
60 VS_PLATFORMS
= $(foreach d
,$(wildcard */Release
/$(CODEC_LIB
).lib
),$(word 1,$(subst /, ,$(d
))))
61 CODEC_SRCS-yes
+= $(SRC_PATH_BARE
)/libs.mk
# to show up in the msvs workspace
64 # The following pairs define a mapping of locations in the distribution
65 # tree to locations in the source/build trees.
66 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx
/%
67 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx_ports
/%
68 INSTALL_MAPS
+= $(LIBSUBDIR
)/% %
69 INSTALL_MAPS
+= src
/% $(SRC_PATH_BARE
)/%
70 ifeq ($(CONFIG_MSVS
),yes
)
71 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Release
/%)
72 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Debug
/%)
75 # If this is a universal (fat) binary, then all the subarchitectures have
76 # already been built and our job is to stitch them together. The
77 # BUILD_LIBVPX variable indicates whether we should be building
78 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
79 # that we're stitching.
80 $(eval
$(if
$(filter universal
%,$(TOOLCHAIN
)),LIPO_LIBVPX
,BUILD_LIBVPX
):=yes
)
82 CODEC_SRCS-
$(BUILD_LIBVPX
) += build
/make
/version.sh
83 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx
/vpx_integer.h
84 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/vpx_timer.h
85 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/mem.h
86 CODEC_SRCS-
$(BUILD_LIBVPX
) += $(BUILD_PFX
)vpx_config.c
87 INSTALL-SRCS-no
+= $(BUILD_PFX
)vpx_config.c
88 ifeq ($(ARCH_X86
)$(ARCH_X86_64
),yes
)
89 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/emms.asm
90 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86.h
91 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86_abi_support.asm
93 CODEC_SRCS-
$(ARCH_ARM
) += $(BUILD_PFX
)vpx_config.asm
94 CODEC_EXPORTS-
$(BUILD_LIBVPX
) += vpx
/exports
96 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec.h
97 INSTALL-LIBS-yes
+= include/vpx
/vpx_image.h
98 INSTALL-LIBS-yes
+= include/vpx
/vpx_integer.h
99 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_top.h
100 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_bottom.h
101 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder.h
102 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder_compat.h
103 INSTALL-LIBS-
$(CONFIG_ENCODERS
) += include/vpx
/vpx_encoder.h
104 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
105 ifeq ($(CONFIG_MSVS
),yes
)
106 INSTALL-LIBS-yes
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
).lib
)
107 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
)d.lib
)
108 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.dll
)
109 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.exp
)
112 INSTALL-LIBS-yes
+= $(LIBSUBDIR
)/libvpx.a
113 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(LIBSUBDIR
)/libvpx_g.a
116 CODEC_SRCS
=$(call enabled
,CODEC_SRCS
)
117 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(CODEC_SRCS
)
118 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(call enabled
,CODEC_EXPORTS
)
120 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
121 ifeq ($(CONFIG_MSVS
),yes
)
123 ifeq ($(ARCH_ARM
),yes
)
124 ifeq ($(HAVE_ARMV5TE
),yes
)
127 ifeq ($(HAVE_ARMV6
),yes
)
130 obj_int_extract.vcproj
: $(SRC_PATH_BARE
)/build
/make
/obj_int_extract.c
131 @cp
$(SRC_PATH_BARE
)/build
/arm-wince-vs8
/obj_int_extract.bat .
132 @cp
$(SRC_PATH_BARE
)/build
/arm-wince-vs8
/armasm
$(ARM_ARCH
).rules .
134 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_proj.sh\
136 --target
=$(TOOLCHAIN
)\
137 $(if
$(CONFIG_STATIC_MSVCRT
),--static-crt
) \
138 --name
=obj_int_extract\
139 --proj-guid
=E1360C65-D375-4335-8057-7ED99CC3F9B2\
141 -I
".";"$(SRC_PATH_BARE)"
143 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.vcproj
144 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.bat
145 PROJECTS-
$(BUILD_LIBVPX
) += armasm
$(ARM_ARCH
).rules
148 vpx.def
: $(call enabled
,CODEC_EXPORTS
)
150 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_def.sh\
153 CLEAN-OBJS
+= vpx.def
155 vpx.vcproj
: $(CODEC_SRCS
) vpx.def
157 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_proj.sh\
159 --target
=$(TOOLCHAIN
)\
160 $(if
$(CONFIG_STATIC_MSVCRT
),--static-crt
) \
162 --proj-guid
=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74\
163 --module-def
=vpx.def\
164 --ver
=$(CONFIG_VS_VERSION
)\
165 --out
=$@
$(CFLAGS
) $^\
167 PROJECTS-
$(BUILD_LIBVPX
) += vpx.vcproj
169 vpx.vcproj
: vpx_config.asm
173 LIBVPX_OBJS
=$(call objs
,$(CODEC_SRCS
))
174 OBJS-
$(BUILD_LIBVPX
) += $(LIBVPX_OBJS
)
175 LIBS-
$(BUILD_LIBVPX
) += $(BUILD_PFX
)libvpx.a
$(BUILD_PFX
)libvpx_g.a
176 $(BUILD_PFX
)libvpx_g.a
: $(LIBVPX_OBJS
)
179 LIBS-
$(LIPO_LIBVPX
) += libvpx.a
180 $(eval
$(if
$(LIPO_LIBVPX
),$(call lipo_lib_template
,libvpx.a
)))
183 # Rule to make assembler configuration file from C configuration file
185 ifeq ($(ARCH_X86
)$(ARCH_X86_64
),yes
)
187 $(BUILD_PFX
)vpx_config.asm
: $(BUILD_PFX
)vpx_config.h
189 @egrep
"#define [A-Z0-9_]+ [01]" $< \
190 | awk
'{print $$2 " equ " $$3}' > $@
192 ADS2GAS
=$(if
$(filter yes
,$(CONFIG_GCC
)),|
$(ASM_CONVERSION
))
193 $(BUILD_PFX
)vpx_config.asm
: $(BUILD_PFX
)vpx_config.h
195 @egrep
"#define [A-Z0-9_]+ [01]" $< \
196 | awk
'{print $$2 " EQU " $$3}' $(ADS2GAS
) > $@
197 @echo
" END" $(ADS2GAS
) >> $@
198 CLEAN-OBJS
+= $(BUILD_PFX
)vpx_config.asm
202 # Add assembler dependencies for configuration and offsets
204 #$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm $(BUILD_PFX)vpx_asm_offsets.asm
205 $(filter %.s.o
,$(OBJS-yes
)): $(BUILD_PFX
)vpx_config.asm
206 $(filter %.asm.o
,$(OBJS-yes
)): $(BUILD_PFX
)vpx_config.asm
208 $(shell $(SRC_PATH_BARE
)/build
/make
/version.sh
"$(SRC_PATH_BARE)" $(BUILD_PFX
)vpx_version.h
)
209 CLEAN-OBJS
+= $(BUILD_PFX
)vpx_version.h
211 CODEC_DOC_SRCS
+= vpx
/vpx_codec.h \
216 CLEAN-OBJS
+= libs.doxy
217 DOCS-yes
+= libs.doxy
218 libs.doxy
: $(CODEC_DOC_SRCS
)
221 @echo
"INPUT += $^" >> $@
222 @echo
"PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
223 @echo
"INCLUDE_PATH += ." >> $@
;
224 @echo
"ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@