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 CODEC_SRCS-yes
+= libs.mk
16 include $(SRC_PATH_BARE
)/vpx
/vpx_codec.mk
17 CODEC_SRCS-yes
+= $(addprefix vpx
/,$(call enabled
,API_SRCS
))
19 include $(SRC_PATH_BARE
)/vpx_mem
/vpx_mem.mk
20 CODEC_SRCS-yes
+= $(addprefix vpx_mem
/,$(call enabled
,MEM_SRCS
))
22 include $(SRC_PATH_BARE
)/vpx_scale
/vpx_scale.mk
23 CODEC_SRCS-yes
+= $(addprefix vpx_scale
/,$(call enabled
,SCALE_SRCS
))
26 ifeq ($(CONFIG_VP8_ENCODER
),yes
)
28 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8cx.mk
29 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_CX_SRCS
))
30 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_CX_EXPORTS
))
31 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8cx.mk vpx
/vp8.h vpx
/vp8cx.h vpx
/vp8e.h
32 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8e.h
include/vpx
/vp8cx.h
33 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
34 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8cx.h
35 CODEC_DOC_SECTIONS
+= vp8 vp8_encoder
38 ifeq ($(CONFIG_VP8_DECODER
),yes
)
40 include $(SRC_PATH_BARE
)/$(VP8_PREFIX
)vp8dx.mk
41 CODEC_SRCS-yes
+= $(addprefix $(VP8_PREFIX
),$(call enabled
,VP8_DX_SRCS
))
42 CODEC_EXPORTS-yes
+= $(addprefix $(VP8_PREFIX
),$(VP8_DX_EXPORTS
))
43 CODEC_SRCS-yes
+= $(VP8_PREFIX
)vp8dx.mk vpx
/vp8.h vpx
/vp8dx.h
44 INSTALL-LIBS-yes
+= include/vpx
/vp8.h
include/vpx
/vp8dx.h
45 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/$(VP8_PREFIX
)/%
46 CODEC_DOC_SRCS
+= vpx
/vp8.h vpx
/vp8dx.h
47 CODEC_DOC_SECTIONS
+= vp8 vp8_decoder
51 ifeq ($(CONFIG_ENCODERS
),yes
)
52 CODEC_DOC_SECTIONS
+= encoder
54 ifeq ($(CONFIG_DECODERS
),yes
)
55 CODEC_DOC_SECTIONS
+= decoder
59 ifeq ($(CONFIG_MSVS
),yes
)
60 CODEC_LIB
=$(if
$(CONFIG_STATIC_MSVCRT
),vpxmt
,vpxmd
)
61 # This variable uses deferred expansion intentionally, since the results of
62 # $(wildcard) may change during the course of the Make.
63 VS_PLATFORMS
= $(foreach d
,$(wildcard */Release
/$(CODEC_LIB
).lib
),$(word 1,$(subst /, ,$(d
))))
66 # The following pairs define a mapping of locations in the distribution
67 # tree to locations in the source/build trees.
68 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx
/%
69 INSTALL_MAPS
+= include/vpx
/% $(SRC_PATH_BARE
)/vpx_ports
/%
70 INSTALL_MAPS
+= $(LIBSUBDIR
)/% %
71 INSTALL_MAPS
+= src
/% $(SRC_PATH_BARE
)/%
72 ifeq ($(CONFIG_MSVS
),yes
)
73 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Release
/%)
74 INSTALL_MAPS
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/% $(p
)/Debug
/%)
77 # If this is a universal (fat) binary, then all the subarchitectures have
78 # already been built and our job is to stitch them together. The
79 # BUILD_LIBVPX variable indicates whether we should be building
80 # (compiling, linking) the library. The LIPO_LIBVPX variable indicates
81 # that we're stitching.
82 $(eval
$(if
$(filter universal
%,$(TOOLCHAIN
)),LIPO_LIBVPX
,BUILD_LIBVPX
):=yes
)
84 CODEC_SRCS-
$(BUILD_LIBVPX
) += build
/make
/version.sh
85 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx
/vpx_integer.h
86 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/vpx_timer.h
87 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/mem.h
88 CODEC_SRCS-
$(BUILD_LIBVPX
) += $(BUILD_PFX
)vpx_config.c
89 INSTALL-SRCS-no
+= $(BUILD_PFX
)vpx_config.c
90 ifeq ($(ARCH_X86
)$(ARCH_X86_64
),yes
)
91 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/emms.asm
92 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86.h
93 CODEC_SRCS-
$(BUILD_LIBVPX
) += vpx_ports
/x86_abi_support.asm
95 CODEC_SRCS-
$(ARCH_ARM
) += $(BUILD_PFX
)vpx_config.asm
96 CODEC_EXPORTS-
$(BUILD_LIBVPX
) += vpx
/exports_com
97 CODEC_EXPORTS-
$(CONFIG_ENCODERS
) += vpx
/exports_enc
98 CODEC_EXPORTS-
$(CONFIG_DECODERS
) += vpx
/exports_dec
100 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec.h
101 INSTALL-LIBS-yes
+= include/vpx
/vpx_image.h
102 INSTALL-LIBS-yes
+= include/vpx
/vpx_integer.h
103 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_top.h
104 INSTALL-LIBS-yes
+= include/vpx
/vpx_codec_impl_bottom.h
105 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder.h
106 INSTALL-LIBS-
$(CONFIG_DECODERS
) += include/vpx
/vpx_decoder_compat.h
107 INSTALL-LIBS-
$(CONFIG_ENCODERS
) += include/vpx
/vpx_encoder.h
108 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
109 ifeq ($(CONFIG_MSVS
),yes
)
110 INSTALL-LIBS-yes
+= $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
).lib
)
111 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/$(CODEC_LIB
)d.lib
)
112 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.dll
)
113 INSTALL-LIBS-
$(CONFIG_SHARED
) += $(foreach p
,$(VS_PLATFORMS
),$(LIBSUBDIR
)/$(p
)/vpx.exp
)
116 INSTALL-LIBS-yes
+= $(LIBSUBDIR
)/libvpx.a
117 INSTALL-LIBS-
$(CONFIG_DEBUG_LIBS
) += $(LIBSUBDIR
)/libvpx_g.a
120 CODEC_SRCS
=$(call enabled
,CODEC_SRCS
)
121 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(CODEC_SRCS
)
122 INSTALL-SRCS-
$(CONFIG_CODEC_SRCS
) += $(call enabled
,CODEC_EXPORTS
)
124 ifeq ($(CONFIG_EXTERNAL_BUILD
),yes
)
125 ifeq ($(CONFIG_MSVS
),yes
)
127 ifeq ($(ARCH_ARM
),yes
)
128 ifeq ($(HAVE_ARMV5TE
),yes
)
131 ifeq ($(HAVE_ARMV6
),yes
)
134 obj_int_extract.vcproj
: $(SRC_PATH_BARE
)/build
/make
/obj_int_extract.c
135 @cp
$(SRC_PATH_BARE
)/build
/arm-wince-vs8
/obj_int_extract.bat .
137 $(SRC_PATH_BARE
)/build
/make
/gen_msvs_proj.sh\
139 --target
=$(TOOLCHAIN
)\
140 $(if
$(CONFIG_STATIC_MSVCRT
),--static-crt
) \
141 --name
=obj_int_extract\
142 --proj-guid
=E1360C65-D375-4335-8057-7ED99CC3F9B2\
144 -I
".";"$(SRC_PATH_BARE)"
146 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.vcproj
147 PROJECTS-
$(BUILD_LIBVPX
) += obj_int_extract.bat
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))" >> $@