vp8: fix compilation with built-in libvpx.
[platform/upstream/gstreamer-vaapi.git] / ext / libvpx / Makefile.am
1 # Makefile.am - Rules for the built-in libvpx sources
2 #
3 # Copyright (C) 2014 Intel Corporation
4 #   Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public
8 # License as published by the Free Software Foundation; either
9 # version 2 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Library General Public License for more details.
15 #
16 # You should have received a copy of the GNU Library General Public
17 # License along with this library; if not, write to the
18 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
20
21 lib_LTLIBRARIES =
22 if USE_LOCAL_CODEC_PARSERS_VP8
23 lib_LTLIBRARIES += libgstcodecparsers_vpx.la
24 endif
25
26 gst_vpx_source_c = gstlibvpx.c
27 gst_vpx_source_h = gstlibvpx.h
28
29 vpx_upstream    = upstream
30 vpx_srcdir      = $(srcdir)/$(vpx_upstream)
31 vpx_builddir    = $(builddir)/$(vpx_upstream)
32 vpx_versions    = libgstcodecparsers_vpx.vers
33
34 vpx_cflags = \
35         -I$(vpx_srcdir) \
36         -I$(vpx_builddir) \
37         $(NULL)
38
39 vpx_libs = \
40         -Wl,-Bsymbolic \
41         -Wl,--whole-archive \
42         -Wl,$(vpx_builddir)/libvpx.a \
43         -Wl,--no-whole-archive \
44         -Wl,--version-script,$(srcdir)/$(vpx_versions) \
45         -Wl,-lpthread \
46         -Wl,-lm \
47         $(NULL)
48
49 libgstcodecparsers_vpx_la_SOURCES               = $(gst_vpx_source_c)
50 libgstcodecparsers_vpx_la_CFLAGS                = $(vpx_cflags)
51 libgstcodecparsers_vpx_la_DEPENDENCIES          = vpx.build
52 libgstcodecparsers_vpx_la_LINK                  = $(LINK) $(vpx_libs)
53 EXTRA_libgstcodecparsers_vpx_la_DEPENDENCIES    = $(srcdir)/$(vpx_versions)
54
55 VPX_DEBUG       = yes
56
57 # Codecs
58 VP8_DECODER     = enable
59 VP8_ENCODER     = disable
60 VP9_DECODER     = disable
61 VP9_ENCODER     = disable
62
63 clean-local: vpx.clean
64 maintainer-clean-local: vpx.maintainer.clean
65
66 vpx.build: vpx.configure.stamp
67         @$(MAKE) -C $(vpx_builddir)
68
69 vpx.clean:
70         @[ -d $(vpx_builddir) ] && \
71         $(MAKE) -C $(vpx_builddir) clean || :
72         rm -f vpx.build.stamp vpx.configure.stamp
73
74 vpx.maintainer.clean: vpx.clean
75         rm -rf $(vpx_builddir)
76
77 vpx.configure.stamp:
78         @[ -d $(vpx_builddir) ] || mkdir $(vpx_builddir);                \
79         cd $(vpx_builddir)                                              ;  \
80         test "$(VPX_DEBUG)" = "yes"                                     && \
81         CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-debug"              ; \
82         $(abs_srcdir)/$(vpx_upstream)/configure $$CONFIGURE_FLAGS       \
83                 --enable-static                                         \
84                 --enable-pic                                            \
85                 --disable-shared                                        \
86                 --$(VP8_DECODER)-vp8-decoder                            \
87                 --$(VP8_ENCODER)-vp8-encoder                            \
88                 --$(VP9_DECODER)-vp9-decoder                            \
89                 --$(VP9_ENCODER)-vp9-encoder                            \
90                 --enable-runtime-cpu-detect                             \
91                 --disable-md5                                           \
92                 --disable-examples                                      \
93                 --disable-docs                                          \
94                 --disable-unit-tests                                    && \
95         cd ..                                                           && \
96         touch $@
97
98 $(gst_vpx_source_c): vpx.build
99
100 CLEANFILES = vpx.build.stamp
101
102 # Files for packaging
103 include $(srcdir)/sources.frag
104
105 vpx_sources = \
106         $(vpx_srcdir)/AUTHORS \
107         $(vpx_srcdir)/CHANGELOG \
108         $(vpx_srcdir)/LICENSE \
109         $(vpx_srcdir)/PATENTS \
110         $(vpx_srcdir)/build/make/Makefile \
111         $(vpx_srcdir)/build/make/ads2gas.pl \
112         $(vpx_srcdir)/build/make/ads2gas_apple.pl \
113         $(vpx_srcdir)/build/make/configure.sh \
114         $(vpx_srcdir)/build/make/gen_asm_deps.sh \
115         $(vpx_srcdir)/build/make/obj_int_extract.c \
116         $(vpx_srcdir)/build/make/rtcd.sh \
117         $(vpx_srcdir)/build/make/version.sh \
118         $(vpx_srcdir)/configure \
119         $(vpx_srcdir)/vp8/common/rtcd_defs.sh \
120         $(vpx_srcdir)/vp9/common/vp9_rtcd_defs.sh \
121         $(vpx_srcdir)/vpx_scale/vpx_scale_rtcd.sh \
122         $(vpx_source_mak:%.mk=$(vpx_srcdir)/%.mk) \
123         $(vpx_source_c:%.c=$(vpx_srcdir)/%.c) \
124         $(vpx_source_h:%.h=$(vpx_srcdir)/%.h) \
125         $(NULL)
126
127 EXTRA_DIST = \
128         sources.frag            \
129         $(gst_vpx_source_h)     \
130         $(vpx_sources)          \
131         $(vpx_versions)         \
132         $(NULL)
133
134 # Avoid implicit rule that tries to compile .asm.o to .asm
135 dist-hook:
136         for f in $(vpx_source_asm); do                                  \
137           mkdir -p $(distdir)/$(vpx_upstream)/$$(dirname $$f);          \
138           cp -fpR $(vpx_srcdir)/$$f $(distdir)/$(vpx_upstream)/$$f;     \
139         done
140
141 # Extra clean files so that maintainer-clean removes *everything*
142 MAINTAINERCLEANFILES = Makefile.in vpx.configure.stamp