2 ## Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
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.
12 ASM
:=$(if
$(filter yes
,$(CONFIG_GCC
)),.asm.s
,.asm
)
14 include $(SRC_PATH_BARE
)/vpx
/vpx_codec.mk
15 CODEC_SRCS-yes
+= $(addprefix vpx
/,$(call enabled
,API_SRCS
))
17 include $(SRC_PATH_BARE
)/vpx_mem
/vpx_mem.mk
18 CODEC_SRCS-yes
+= $(addprefix vpx_mem
/,$(call enabled
,MEM_SRCS
))
20 include $(SRC_PATH_BARE
)/vpx_scale
/vpx_scale.mk
21 CODEC_SRCS-yes
+= $(addprefix vpx_scale
/,$(call enabled
,SCALE_SRCS
))
24 ifeq ($(CONFIG_VP8_ENCODER
),yes
)
26 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8cx.mk
27 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_CX_SRCS
))
28 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_CX_EXPORTS
))
29 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8cx.mk vpx
/vp8.h vpx
/vp8cx.h vpx
/vp8e.h
30 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8e.h
include/vpx
/vp8cx.h
31 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
32 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8cx.h
33 CODEC_DOC_SECTIONS
+= vp8 vp8_encoder
36 ifeq ($(CONFIG_VP8_DECODER
),yes
)
38 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8dx.mk
39 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_DX_SRCS
))
40 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_DX_EXPORTS
))
41 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8dx.mk vpx
/vp8.h vpx
/vp8dx.h
42 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8dx.h
43 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
44 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8dx.h
45 CODEC_DOC_SECTIONS
+= vp8 vp8_decoder
49 ifeq ($(CONFIG_ENCODERS
),yes
)
50 CODEC_DOC_SECTIONS
+= encoder
52 ifeq ($(CONFIG_DECODERS
),yes
)
53 CODEC_DOC_SECTIONS
+= decoder
57 ifeq ($(CONFIG_MSVS
),yes
)
58 CODEC_LIB
=$(if
$(CONFIG_STATIC_MSVCRT
),vpxmt
,vpxmd
)
59 # This variable uses deferred expansion intentionally, since the results of
60 # $(wildcard) may change during the course of the Make.
61 VS_PLATFORMS
= $(foreach d
,$(wildcard */Release
/$(CODEC_LIB
).lib
),$(word 1,$(subst /, ,$(d
))))
62 CODEC_SRCS-yes
+= $(SRC_PATH_BARE
)/libs.mk
# to show up in the msvs workspace
65 # The following pairs define a mapping of locations in the distribution
66 # tree to locations in the source/build trees.
67 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx
/%
68 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx_ports
/%
69 INSTALL_MAPS
+= $(LIBSUBDIR
)/% %
70 INSTALL_MAPS
+= src
/% $(SRC_PATH_BARE
)/%
71 ifeq ($(CONFIG_MSVS
),yes
)
72 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Release
/%)
73 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Debug
/%)
76 # If this is a universal (fat) binary, then all the subarchitectures have
77 # already been built and our job is to stitch them together. The
78 # BUILD_LIBVPX variable indicates whether we should be building
79 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
80 # that we're stitching.
81 $(eval
$(if
$(filter universal
%,$(TOOLCHAIN
)),LIPO_LIBVPX
,BUILD_LIBVPX
):=yes
)
83 CODEC_SRCS-
$(BUILD_LIBVPX
) += build
/make
/version.sh
84 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx
/vpx_integer.h
85 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/vpx_timer.h
86 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/mem.h
87 CODEC_SRCS-
$(BUILD_LIBVPX
) += $(BUILD_PFX
)vpx_config.c
88 INSTALL-SRCS-no
+= $(BUILD_PFX
)vpx_config.c
89 ifeq ($(ARCH_X86
)$(ARCH_X86_64
),yes
)
90 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/emms.asm
91 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86.h
92 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86_abi_support.asm
94 CODEC_SRCS-
$(ARCH_ARM
) += $(BUILD_PFX
)vpx_config.asm
95 CODEC_EXPORTS-
$(BUILD_LIBVPX
) += vpx
/exports_com
96 CODEC_EXPORTS-
$(CONFIG_ENCODERS
) += vpx
/exports_enc
97 CODEC_EXPORTS-
$(CONFIG_DECODERS
) += vpx
/exports_dec
99 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec.h
100 INSTALL-LIBS-yes
+= include/vpx
/vpx_image.h
101 INSTALL-LIBS-yes
+= include/vpx
/vpx_integer.h
102 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_top.h
103 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_bottom.h
104 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder.h
105 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder_compat.h
106 INSTALL-LIBS-
$(CONFIG_ENCODERS
) += include/vpx
/vpx_encoder.h
107 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
108 ifeq ($(CONFIG_MSVS
),yes
)
109 INSTALL-LIBS-yes
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
).lib
)
110 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
)d.lib
)
111 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.dll
)
112 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.exp
)
115 INSTALL-LIBS-yes
+= $(LIBSUBDIR
)/libvpx.a
116 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(LIBSUBDIR
)/libvpx_g.a
119 CODEC_SRCS
=$(call enabled
,CODEC_SRCS
)
120 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(CODEC_SRCS
)
121 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(call enabled
,CODEC_EXPORTS
)
123 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
124 ifeq ($(CONFIG_MSVS
),yes
)
126 ifeq ($(ARCH_ARM
),yes
)
127 ifeq ($(HAVE_ARMV5TE
),yes
)
130 ifeq ($(HAVE_ARMV6
),yes
)
133 obj_int_extract.vcproj
: $(SRC_PATH_BARE
)/build
/make
/obj_int_extract.c
134 @cp
$(SRC_PATH_BARE
)/build
/arm-wince-vs8
/obj_int_extract.bat .
136 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_proj.sh\
138 --target
=$(TOOLCHAIN
)\
139 $(if
$(CONFIG_STATIC_MSVCRT
),--static-crt
) \
140 --name
=obj_int_extract\
141 --proj-guid
=E1360C65-D375-4335-8057-7ED99CC3F9B2\
143 -I
".";"$(SRC_PATH_BARE)"
145 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.vcproj
146 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.bat
147 PROJECTS-
$(BUILD_LIBVPX
) += armasm
$(ARM_ARCH
).rules
150 vpx.def
: $(call enabled
,CODEC_EXPORTS
)
152 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_def.sh\
155 CLEAN-OBJS
+= vpx.def
157 vpx.vcproj
: $(CODEC_SRCS
) vpx.def
159 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_proj.sh\
161 --target
=$(TOOLCHAIN
)\
162 $(if
$(CONFIG_STATIC_MSVCRT
),--static-crt
) \
164 --proj-guid
=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74\
165 --module-def
=vpx.def\
166 --ver
=$(CONFIG_VS_VERSION
)\
167 --out
=$@
$(CFLAGS
) $^\
169 PROJECTS-
$(BUILD_LIBVPX
) += vpx.vcproj
171 vpx.vcproj
: vpx_config.asm
175 LIBVPX_OBJS
=$(call objs
,$(CODEC_SRCS
))
176 OBJS-
$(BUILD_LIBVPX
) += $(LIBVPX_OBJS
)
177 LIBS-
$(BUILD_LIBVPX
) += $(BUILD_PFX
)libvpx.a
$(BUILD_PFX
)libvpx_g.a
178 $(BUILD_PFX
)libvpx_g.a
: $(LIBVPX_OBJS
)
180 BUILD_LIBVPX_SO
:= $(if
$(BUILD_LIBVPX
),$(CONFIG_SHARED
))
181 LIBVPX_SO
:= libvpx.so.
$(VERSION_MAJOR
).
$(VERSION_MINOR
).
$(VERSION_PATCH
)
182 LIBS-
$(BUILD_LIBVPX_SO
) += $(BUILD_PFX
)$(LIBVPX_SO
)
183 $(BUILD_PFX
)$(LIBVPX_SO
): $(LIBVPX_OBJS
) libvpx.ver
184 $(BUILD_PFX
)$(LIBVPX_SO
): extralibs
+= -lm
-pthread
185 $(BUILD_PFX
)$(LIBVPX_SO
): SONAME
= libvpx.so.
$(VERSION_MAJOR
)
186 $(BUILD_PFX
)$(LIBVPX_SO
): SO_VERSION_SCRIPT
= libvpx.ver
187 LIBVPX_SO_SYMLINKS
:= $(addprefix $(LIBSUBDIR
)/, \
188 libvpx.so libvpx.so.
$(VERSION_MAJOR
) \
189 libvpx.so.
$(VERSION_MAJOR
).
$(VERSION_MINOR
))
191 libvpx.ver
: $(call enabled
,CODEC_EXPORTS
)
193 $(qexec
)echo
"{ global:" > $@
194 $(qexec
)for f in
$?
; do awk
'{print $$2";"}' < $$f >>$@
; done
195 $(qexec
)echo
"local: *; };" >> $@
196 CLEAN-OBJS
+= libvpx.ver
198 $(addprefix $(DIST_DIR
)/,$(LIBVPX_SO_SYMLINKS
)):
200 $(qexec
)ln
-sf
$(LIBVPX_SO
) $@
202 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(LIBVPX_SO_SYMLINKS
)
203 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(LIBSUBDIR
)/$(LIBVPX_SO
)
206 LIBS-
$(LIPO_LIBVPX
) += libvpx.a
207 $(eval
$(if
$(LIPO_LIBVPX
),$(call lipo_lib_template
,libvpx.a
)))
210 # Rule to make assembler configuration file from C configuration file
212 ifeq ($(ARCH_X86
)$(ARCH_X86_64
),yes
)
214 $(BUILD_PFX
)vpx_config.asm
: $(BUILD_PFX
)vpx_config.h
216 @egrep
"#define [A-Z0-9_]+ [01]" $< \
217 | awk
'{print $$2 " equ " $$3}' > $@
219 ADS2GAS
=$(if
$(filter yes
,$(CONFIG_GCC
)),|
$(ASM_CONVERSION
))
220 $(BUILD_PFX
)vpx_config.asm
: $(BUILD_PFX
)vpx_config.h
222 @egrep
"#define [A-Z0-9_]+ [01]" $< \
223 | awk
'{print $$2 " EQU " $$3}' $(ADS2GAS
) > $@
224 @echo
" END" $(ADS2GAS
) >> $@
225 CLEAN-OBJS
+= $(BUILD_PFX
)vpx_config.asm
229 # Add assembler dependencies for configuration and offsets
231 #$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm $(BUILD_PFX)vpx_asm_offsets.asm
232 $(filter %.s.o
,$(OBJS-yes
)): $(BUILD_PFX
)vpx_config.asm
233 $(filter %.asm.o
,$(OBJS-yes
)): $(BUILD_PFX
)vpx_config.asm
235 $(shell $(SRC_PATH_BARE
)/build
/make
/version.sh
"$(SRC_PATH_BARE)" $(BUILD_PFX
)vpx_version.h
)
236 CLEAN-OBJS
+= $(BUILD_PFX
)vpx_version.h
238 CODEC_DOC_SRCS
+= vpx
/vpx_codec.h \
243 CLEAN-OBJS
+= libs.doxy
244 DOCS-yes
+= libs.doxy
245 libs.doxy
: $(CODEC_DOC_SRCS
)
248 @echo
"INPUT += $^" >> $@
249 @echo
"PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
250 @echo
"INCLUDE_PATH += ." >> $@
;
251 @echo
"ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@