Increase the size of output packet list
[libvpx.git] / libs.mk
blob544e71a2a4af2cd669264d35cbfbd89e8790142e
1 ##
2 ## Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
3 ##
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.
8 ##
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)
24 VP8_PREFIX=vp8/
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
33 endif
35 ifeq ($(CONFIG_VP8_DECODER),yes)
36 VP8_PREFIX=vp8/
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
45 endif
48 ifeq ($(CONFIG_ENCODERS),yes)
49 CODEC_DOC_SECTIONS += encoder
50 endif
51 ifeq ($(CONFIG_DECODERS),yes)
52 CODEC_DOC_SECTIONS += decoder
53 endif
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
62 endif
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/%)
73 endif
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
92 endif
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)
110 endif
111 else
112 INSTALL-LIBS-yes += $(LIBSUBDIR)/libvpx.a
113 INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
114 endif
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)
125 ARM_ARCH=v5
126 endif
127 ifeq ($(HAVE_ARMV6),yes)
128 ARM_ARCH=v6
129 endif
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 .
133 @echo " [CREATE] $@"
134 $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
135 --exe\
136 --target=$(TOOLCHAIN)\
137 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
138 --name=obj_int_extract\
139 --proj-guid=E1360C65-D375-4335-8057-7ED99CC3F9B2\
140 --out=$@ $^\
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
146 endif
148 vpx.def: $(call enabled,CODEC_EXPORTS)
149 @echo " [CREATE] $@"
150 $(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
151 --name=vpx\
152 --out=$@ $^
153 CLEAN-OBJS += vpx.def
155 vpx.vcproj: $(CODEC_SRCS) vpx.def
156 @echo " [CREATE] $@"
157 $(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
158 --lib\
159 --target=$(TOOLCHAIN)\
160 $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
161 --name=vpx\
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
171 endif
172 else
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)
177 endif
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)
186 # YASM
187 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
188 @echo " [CREATE] $@"
189 @egrep "#define [A-Z0-9_]+ [01]" $< \
190 | awk '{print $$2 " equ " $$3}' > $@
191 else
192 ADS2GAS=$(if $(filter yes,$(CONFIG_GCC)),| $(ASM_CONVERSION))
193 $(BUILD_PFX)vpx_config.asm: $(BUILD_PFX)vpx_config.h
194 @echo " [CREATE] $@"
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
199 endif
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 \
212 vpx/vpx_decoder.h \
213 vpx/vpx_encoder.h \
214 vpx/vpx_image.h
216 CLEAN-OBJS += libs.doxy
217 DOCS-yes += libs.doxy
218 libs.doxy: $(CODEC_DOC_SRCS)
219 @echo " [CREATE] $@"
220 @rm -f $@
221 @echo "INPUT += $^" >> $@
222 @echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
223 @echo "INCLUDE_PATH += ." >> $@;
224 @echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@