summaryrefslogtreecommitdiff
path: root/ext/libvpx/Makefile.am
blob: 793026ec3d08f6e0222d64a04a263ab58b8dc497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Makefile.am - Rules for the built-in libvpx sources
#
# Copyright (C) 2014 Intel Corporation
#   Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.

lib_LTLIBRARIES =
if USE_BUILTIN_LIBVPX
lib_LTLIBRARIES += libgstcodecparsers_vpx.la
endif

gst_vpx_source_c = gstlibvpx.c
gst_vpx_source_h = gstlibvpx.h

vpx_upstream	= upstream
vpx_srcdir	= $(srcdir)/$(vpx_upstream)
vpx_builddir	= $(builddir)/$(vpx_upstream)
vpx_versions	= libgstcodecparsers_vpx.vers

vpx_cflags = \
	-I$(vpx_srcdir) \
	-I$(vpx_builddir) \
	$(NULL)

vpx_libs = \
	-Wl,-Bsymbolic \
	-Wl,--whole-archive \
	-Wl,$(vpx_builddir)/libvpx.a \
	-Wl,--no-whole-archive \
	-Wl,--version-script,$(srcdir)/$(vpx_versions) \
	-Wl,-lpthread \
	-Wl,-lm \
	$(NULL)

libgstcodecparsers_vpx_la_SOURCES		= $(gst_vpx_source_c)
libgstcodecparsers_vpx_la_CFLAGS		= $(vpx_cflags)
libgstcodecparsers_vpx_la_DEPENDENCIES		= vpx.build
libgstcodecparsers_vpx_la_LINK			= $(LINK) $(vpx_libs)
EXTRA_libgstcodecparsers_vpx_la_DEPENDENCIES	= $(srcdir)/$(vpx_versions)

VPX_DEBUG	= yes

# Codecs
VP8_DECODER	= enable
VP8_ENCODER	= disable
VP9_DECODER	= disable
VP9_ENCODER	= disable

clean-local: vpx.clean
maintainer-clean-local: vpx.maintainer.clean

vpx.build: vpx.configure.stamp
	@$(MAKE) -C $(vpx_builddir)

vpx.clean:
	@[ -d $(vpx_builddir) ] && \
	$(MAKE) -C $(vpx_builddir) clean || :
	rm -f vpx.configure.stamp

vpx.maintainer.clean: vpx.clean
	rm -rf $(vpx_builddir)

DISTCLEANFILES = \
	$(vpx_builddir)/config.mk			\
	$(vpx_builddir)/config.log			\
	$(vpx_builddir)/libs-x86_64-linux-gcc.mk	\
	$(vpx_builddir)/Makefile			\
	$(vpx_builddir)/vpx_config.c			\
	$(vpx_builddir)/vpx_config.h			\
	$(vpx_builddir)/vpx_config.asm			\
	$(NULL)

vpx.configure.stamp:
	@[ -d $(vpx_builddir) ] || mkdir $(vpx_builddir);		 \
	cd $(vpx_builddir)						;  \
	test "$(VPX_DEBUG)" = "yes"					&& \
	CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-debug"		; \
	$(abs_srcdir)/$(vpx_upstream)/configure $$CONFIGURE_FLAGS	\
		--enable-static						\
		--enable-pic						\
		--disable-shared					\
		--$(VP8_DECODER)-vp8-decoder				\
		--$(VP8_ENCODER)-vp8-encoder				\
		--$(VP9_DECODER)-vp9-decoder				\
		--$(VP9_ENCODER)-vp9-encoder				\
		--enable-runtime-cpu-detect				\
		--disable-md5						\
		--disable-examples					\
		--disable-docs						\
		--disable-unit-tests					&& \
	cd ..								&& \
	touch $@

$(gst_vpx_source_c): vpx.build

CLEANFILES = vpx.configure.stamp

# Files for packaging
include $(srcdir)/sources.frag

vpx_sources = \
	$(vpx_srcdir)/AUTHORS \
	$(vpx_srcdir)/CHANGELOG \
	$(vpx_srcdir)/LICENSE \
	$(vpx_srcdir)/PATENTS \
	$(vpx_srcdir)/build/make/Makefile \
	$(vpx_srcdir)/build/make/ads2gas.pl \
	$(vpx_srcdir)/build/make/ads2gas_apple.pl \
	$(vpx_srcdir)/build/make/configure.sh \
	$(vpx_srcdir)/build/make/gen_asm_deps.sh \
	$(vpx_srcdir)/build/make/obj_int_extract.c \
	$(vpx_srcdir)/build/make/rtcd.sh \
	$(vpx_srcdir)/build/make/version.sh \
	$(vpx_srcdir)/configure \
	$(vpx_srcdir)/vp8/common/rtcd_defs.sh \
	$(vpx_srcdir)/vp9/common/vp9_rtcd_defs.sh \
	$(vpx_srcdir)/vpx_scale/vpx_scale_rtcd.sh \
	$(vpx_source_mak:%.mk=$(vpx_srcdir)/%.mk) \
	$(vpx_source_c:%.c=$(vpx_srcdir)/%.c) \
	$(vpx_source_h:%.h=$(vpx_srcdir)/%.h) \
	$(NULL)

EXTRA_DIST = \
	sources.frag		\
	$(gst_vpx_source_h)	\
	$(vpx_sources)		\
	$(vpx_versions)		\
	$(NULL)

# Avoid implicit rule that tries to compile .asm.o to .asm
dist-hook:
	for f in $(vpx_source_asm); do					\
	  mkdir -p $(distdir)/$(vpx_upstream)/$$(dirname $$f);		\
	  cp -fpR $(vpx_srcdir)/$$f $(distdir)/$(vpx_upstream)/$$f;	\
	done

# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in vpx.configure.stamp