blob: f10bec68c36f94bdb4afd93433ed3f560a992bf1 [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001##
John Koleszarc2140b82010-09-09 08:16:39 -04002## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar0ea50ce2010-05-18 11:58:33 -04003##
John Koleszar94c52e42010-06-18 12:39:21 -04004## Use of this source code is governed by a BSD-style license
John Koleszar09202d82010-06-04 16:19:40 -04005## 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
John Koleszar94c52e42010-06-18 12:39:21 -04007## in the file PATENTS. All contributing project authors may
John Koleszar09202d82010-06-04 16:19:40 -04008## be found in the AUTHORS file in the root of the source tree.
John Koleszar0ea50ce2010-05-18 11:58:33 -04009##
10
John Koleszar7dfec962012-03-01 12:50:40 -080011LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
James Zern3a7d4672014-08-10 16:15:18 -070012 third_party/libyuv/include/libyuv/convert.h \
13 third_party/libyuv/include/libyuv/convert_argb.h \
14 third_party/libyuv/include/libyuv/convert_from.h \
John Koleszar7dfec962012-03-01 12:50:40 -080015 third_party/libyuv/include/libyuv/cpu_id.h \
Deb Mukherjee47031c02014-05-16 18:52:01 -070016 third_party/libyuv/include/libyuv/planar_functions.h \
James Zern3a7d4672014-08-10 16:15:18 -070017 third_party/libyuv/include/libyuv/rotate.h \
Deb Mukherjee47031c02014-05-16 18:52:01 -070018 third_party/libyuv/include/libyuv/row.h \
John Koleszar7dfec962012-03-01 12:50:40 -080019 third_party/libyuv/include/libyuv/scale.h \
Deb Mukherjee47031c02014-05-16 18:52:01 -070020 third_party/libyuv/include/libyuv/scale_row.h \
21 third_party/libyuv/source/cpu_id.cc \
22 third_party/libyuv/source/planar_functions.cc \
23 third_party/libyuv/source/row_any.cc \
24 third_party/libyuv/source/row_common.cc \
James Zernfcb42532015-07-24 16:54:51 -070025 third_party/libyuv/source/row_gcc.cc \
Deb Mukherjee47031c02014-05-16 18:52:01 -070026 third_party/libyuv/source/row_mips.cc \
27 third_party/libyuv/source/row_neon.cc \
James Zern3a7d4672014-08-10 16:15:18 -070028 third_party/libyuv/source/row_neon64.cc \
Deb Mukherjee47031c02014-05-16 18:52:01 -070029 third_party/libyuv/source/row_win.cc \
James Zern3a7d4672014-08-10 16:15:18 -070030 third_party/libyuv/source/scale.cc \
James Zernfcb42532015-07-24 16:54:51 -070031 third_party/libyuv/source/scale_any.cc \
Deb Mukherjee47031c02014-05-16 18:52:01 -070032 third_party/libyuv/source/scale_common.cc \
James Zernfcb42532015-07-24 16:54:51 -070033 third_party/libyuv/source/scale_gcc.cc \
Deb Mukherjee47031c02014-05-16 18:52:01 -070034 third_party/libyuv/source/scale_mips.cc \
35 third_party/libyuv/source/scale_neon.cc \
James Zern2f5e0fa2014-08-22 18:16:44 -070036 third_party/libyuv/source/scale_neon64.cc \
James Zern3a7d4672014-08-10 16:15:18 -070037 third_party/libyuv/source/scale_win.cc \
John Koleszar0ea50ce2010-05-18 11:58:33 -040038
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070039LIBWEBM_COMMON_SRCS += third_party/libwebm/webmids.hpp
40
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -070041LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
42 third_party/libwebm/mkvmuxerutil.cpp \
43 third_party/libwebm/mkvwriter.cpp \
44 third_party/libwebm/mkvmuxer.hpp \
45 third_party/libwebm/mkvmuxertypes.hpp \
46 third_party/libwebm/mkvmuxerutil.hpp \
47 third_party/libwebm/mkvparser.hpp \
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070048 third_party/libwebm/mkvwriter.hpp
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -070049
Vignesh Venkatasubramaniandbd24712014-04-03 00:41:14 -070050LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
51 third_party/libwebm/mkvreader.cpp \
52 third_party/libwebm/mkvparser.hpp \
53 third_party/libwebm/mkvreader.hpp
54
James Zern77bbcab2014-02-05 16:55:01 -080055# List of examples to build. UTILS are tools meant for distribution
56# while EXAMPLES demonstrate specific portions of the API.
John Koleszarea68ee02010-10-21 15:02:10 -040057UTILS-$(CONFIG_DECODERS) += vpxdec.c
58vpxdec.SRCS += md5_utils.c md5_utils.h
Dmitry Kovalev4334c072014-02-26 16:32:09 -080059vpxdec.SRCS += vpx_ports/mem_ops.h
60vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -070061vpxdec.SRCS += vpx_ports/msvc.h
John Koleszarea68ee02010-10-21 15:02:10 -040062vpxdec.SRCS += vpx_ports/vpx_timer.h
63vpxdec.SRCS += vpx/vpx_integer.h
Attila Nagy1a7d25a2011-09-15 15:34:12 +030064vpxdec.SRCS += args.c args.h
Tom Finegan00a35aa2013-11-14 12:37:42 -080065vpxdec.SRCS += ivfdec.c ivfdec.h
John Koleszarc377bf02010-11-02 09:11:57 -040066vpxdec.SRCS += tools_common.c tools_common.h
Dmitry Kovalev5ab63582014-01-17 17:02:37 -080067vpxdec.SRCS += y4menc.c y4menc.h
Deb Mukherjee47031c02014-05-16 18:52:01 -070068ifeq ($(CONFIG_LIBYUV),yes)
69 vpxdec.SRCS += $(LIBYUV_SRCS)
70endif
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070071ifeq ($(CONFIG_WEBM_IO),yes)
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070072 vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
Vignesh Venkatasubramaniandbd24712014-04-03 00:41:14 -070073 vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
74 vpxdec.SRCS += webmdec.cc webmdec.h
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070075endif
John Koleszarea68ee02010-10-21 15:02:10 -040076vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
77vpxdec.DESCRIPTION = Full featured decoder
78UTILS-$(CONFIG_ENCODERS) += vpxenc.c
Tom Finegan49dc9ca2013-11-21 16:46:40 -080079vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h
Tom Finegan00a35aa2013-11-14 12:37:42 -080080vpxenc.SRCS += ivfdec.c ivfdec.h
81vpxenc.SRCS += ivfenc.c ivfenc.h
Dmitry Kovalevf11da2b2014-01-29 12:28:29 -080082vpxenc.SRCS += rate_hist.c rate_hist.h
John Koleszarc377bf02010-11-02 09:11:57 -040083vpxenc.SRCS += tools_common.c tools_common.h
Tom Finegan249366b2013-11-25 12:05:19 -080084vpxenc.SRCS += warnings.c warnings.h
Attila Nagy1a7d25a2011-09-15 15:34:12 +030085vpxenc.SRCS += vpx_ports/mem_ops.h
John Koleszarea68ee02010-10-21 15:02:10 -040086vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -070087vpxenc.SRCS += vpx_ports/msvc.h
Johannc459d372012-04-02 15:08:18 -070088vpxenc.SRCS += vpx_ports/vpx_timer.h
Tom Finegan78cb2e62013-11-07 21:28:45 -080089vpxenc.SRCS += vpxstats.c vpxstats.h
Deb Mukherjee47031c02014-05-16 18:52:01 -070090ifeq ($(CONFIG_LIBYUV),yes)
91 vpxenc.SRCS += $(LIBYUV_SRCS)
92endif
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070093ifeq ($(CONFIG_WEBM_IO),yes)
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070094 vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -070095 vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
96 vpxenc.SRCS += webmenc.cc webmenc.h
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070097endif
John Koleszarea68ee02010-10-21 15:02:10 -040098vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
99vpxenc.DESCRIPTION = Full featured encoder
James Zernf12ebfc2014-05-14 19:45:20 -0700100ifeq ($(CONFIG_SPATIAL_SVC),yes)
101 EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_svc_encoder.c
102 vp9_spatial_svc_encoder.SRCS += args.c args.h
103 vp9_spatial_svc_encoder.SRCS += ivfenc.c ivfenc.h
104 vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
105 vp9_spatial_svc_encoder.SRCS += video_common.h
106 vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700107 vp9_spatial_svc_encoder.SRCS += vpx_ports/msvc.h
James Zernf12ebfc2014-05-14 19:45:20 -0700108 vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
109 vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
110 vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
111endif
John Koleszarea68ee02010-10-21 15:02:10 -0400112
Deb Mukherjee4298be32014-04-03 14:06:20 -0700113ifneq ($(CONFIG_SHARED),yes)
James Zern98e16b12014-03-03 18:03:23 -0800114EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c
Deb Mukherjeecacea002014-01-23 14:53:53 -0800115endif
116
Tom Finegana77d6d02014-05-14 11:21:15 -0700117EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_svc_encoder.c
118vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h
119vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h
120vpx_temporal_svc_encoder.SRCS += video_common.h
121vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700122vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h
Tom Finegana77d6d02014-05-14 11:21:15 -0700123vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
124vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700125EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
James Zern77bbcab2014-02-05 16:55:01 -0800126simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
Dmitry Kovalev7ec27692014-01-27 13:40:29 -0800127simple_decoder.SRCS += ivfdec.h ivfdec.c
128simple_decoder.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800129simple_decoder.SRCS += video_common.h
130simple_decoder.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800131simple_decoder.SRCS += vpx_ports/mem_ops.h
132simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700133simple_decoder.SRCS += vpx_ports/msvc.h
James Zern77bbcab2014-02-05 16:55:01 -0800134simple_decoder.DESCRIPTION = Simplified decoder loop
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700135EXAMPLES-$(CONFIG_DECODERS) += postproc.c
Dmitry Kovalev2e862ce2014-01-28 11:27:30 -0800136postproc.SRCS += ivfdec.h ivfdec.c
137postproc.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800138postproc.SRCS += video_common.h
139postproc.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800140postproc.SRCS += vpx_ports/mem_ops.h
141postproc.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700142postproc.SRCS += vpx_ports/msvc.h
James Zern77bbcab2014-02-05 16:55:01 -0800143postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
144postproc.DESCRIPTION = Decoder postprocessor control
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700145EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
Dmitry Kovalevc2b33682014-01-24 11:20:09 -0800146decode_to_md5.SRCS += md5_utils.h md5_utils.c
147decode_to_md5.SRCS += ivfdec.h ivfdec.c
148decode_to_md5.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800149decode_to_md5.SRCS += video_common.h
150decode_to_md5.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800151decode_to_md5.SRCS += vpx_ports/mem_ops.h
152decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700153decode_to_md5.SRCS += vpx_ports/msvc.h
James Zern77bbcab2014-02-05 16:55:01 -0800154decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
155decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700156EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800157simple_encoder.SRCS += ivfenc.h ivfenc.c
158simple_encoder.SRCS += tools_common.h tools_common.c
159simple_encoder.SRCS += video_common.h
160simple_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700161simple_encoder.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400162simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
163simple_encoder.DESCRIPTION = Simplified encoder loop
Dmitry Kovalevcb1f97e2014-09-09 18:51:41 -0700164EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c
165vp9_lossless_encoder.SRCS += ivfenc.h ivfenc.c
166vp9_lossless_encoder.SRCS += tools_common.h tools_common.c
167vp9_lossless_encoder.SRCS += video_common.h
168vp9_lossless_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700169vp9_lossless_encoder.SRCS += vpx_ports/msvc.h
Dmitry Kovalevcb1f97e2014-09-09 18:51:41 -0700170vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
171vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700172EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
Dmitry Kovalev592936b2014-02-07 11:37:39 -0800173twopass_encoder.SRCS += ivfenc.h ivfenc.c
174twopass_encoder.SRCS += tools_common.h tools_common.c
175twopass_encoder.SRCS += video_common.h
176twopass_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700177twopass_encoder.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400178twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
179twopass_encoder.DESCRIPTION = Two-pass encoder loop
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700180EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
James Zern77bbcab2014-02-05 16:55:01 -0800181decode_with_drops.SRCS += ivfdec.h ivfdec.c
182decode_with_drops.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800183decode_with_drops.SRCS += video_common.h
184decode_with_drops.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800185decode_with_drops.SRCS += vpx_ports/mem_ops.h
186decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700187decode_with_drops.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400188decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
189decode_with_drops.DESCRIPTION = Drops frames while decoding
Alex Converse61ecd7f2014-03-10 16:13:49 -0700190EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
191set_maps.SRCS += ivfenc.h ivfenc.c
192set_maps.SRCS += tools_common.h tools_common.c
193set_maps.SRCS += video_common.h
194set_maps.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700195set_maps.SRCS += vpx_ports/msvc.h
Alex Converse61ecd7f2014-03-10 16:13:49 -0700196set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
197set_maps.DESCRIPTION = Set active and ROI maps
James Zern77bbcab2014-02-05 16:55:01 -0800198EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
Dmitry Kovalevcb4eb792014-03-03 17:41:51 -0800199vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c
200vp8cx_set_ref.SRCS += tools_common.h tools_common.c
201vp8cx_set_ref.SRCS += video_common.h
202vp8cx_set_ref.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700203vp8cx_set_ref.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400204vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
205vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
206
Dmitry Kovalev98254a42014-01-17 16:56:04 -0800207
208ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
Deb Mukherjee47031c02014-05-16 18:52:01 -0700209ifeq ($(CONFIG_LIBYUV),yes)
Marco Paniconi5f732c22014-07-07 13:57:28 -0700210EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_multi_resolution_encoder.c
Dmitry Kovalev0c1b9c72014-08-26 15:54:00 -0700211vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c
Marco Paniconi5f732c22014-07-07 13:57:28 -0700212vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c
Dmitry Kovalev0c1b9c72014-08-26 15:54:00 -0700213vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700214vp8_multi_resolution_encoder.SRCS += vpx_ports/msvc.h
Dmitry Kovalev98254a42014-01-17 16:56:04 -0800215vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
216vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
217vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
218endif
Deb Mukherjee47031c02014-05-16 18:52:01 -0700219endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400220
221# Handle extra library flags depending on codec configuration
John Koleszar0ea50ce2010-05-18 11:58:33 -0400222
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200223# We should not link to math library (libm) on RVCT
224# when building for bare-metal targets
225ifeq ($(CONFIG_OS_SUPPORT), yes)
226CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m
Ronald S. Bultje4b2c2b92012-11-01 11:09:58 -0700227CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200228else
229 ifeq ($(CONFIG_GCC), yes)
230 CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m
Ronald S. Bultje4b2c2b92012-11-01 11:09:58 -0700231 CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200232 endif
233endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400234#
235# End of specified files. The rest of the build rules should happen
236# automagically from here.
237#
238
239
240# Examples need different flags based on whether we're building
241# from an installed tree or a version controlled tree. Determine
242# the proper paths.
243ifeq ($(HAVE_ALT_TREE_LAYOUT),yes)
James Zern3a7d4672014-08-10 16:15:18 -0700244 LIB_PATH-yes := $(SRC_PATH_BARE)/../lib
245 INC_PATH-yes := $(SRC_PATH_BARE)/../include
John Koleszar0ea50ce2010-05-18 11:58:33 -0400246else
247 LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400248 INC_PATH-$(CONFIG_VP8_DECODER) += $(SRC_PATH_BARE)/vp8
249 INC_PATH-$(CONFIG_VP8_ENCODER) += $(SRC_PATH_BARE)/vp8
Ronald S. Bultje4b2c2b92012-11-01 11:09:58 -0700250 INC_PATH-$(CONFIG_VP9_DECODER) += $(SRC_PATH_BARE)/vp9
251 INC_PATH-$(CONFIG_VP9_ENCODER) += $(SRC_PATH_BARE)/vp9
John Koleszar0ea50ce2010-05-18 11:58:33 -0400252endif
James Zern3a7d4672014-08-10 16:15:18 -0700253INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include
254LIB_PATH := $(call enabled,LIB_PATH)
255INC_PATH := $(call enabled,INC_PATH)
Ronald S. Bultjebbf890f2011-05-02 13:56:41 -0400256INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH))
257INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400258
259
260# Expand list of selected examples to build (as specified above)
261UTILS = $(call enabled,UTILS)
James Zern77bbcab2014-02-05 16:55:01 -0800262EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES))
263ALL_EXAMPLES = $(UTILS) $(EXAMPLES)
John Koleszaree8bcb12010-05-24 10:16:44 -0400264UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
James Zern77bbcab2014-02-05 16:55:01 -0800265ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400266CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
267
268
269# Expand all example sources into a variable containing all sources
James Zern77bbcab2014-02-05 16:55:01 -0800270# for that example (not just them main one specified in UTILS/EXAMPLES)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400271# and add this file to the list (for MSVS workspace generation)
James Zern77bbcab2014-02-05 16:55:01 -0800272$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400273
274
John Koleszar0ea50ce2010-05-18 11:58:33 -0400275# Create build/install dependencies for all examples. The common case
276# is handled here. The MSVS case is handled below.
277NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900278DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
279INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
John Koleszaree8bcb12010-05-24 10:16:44 -0400280DIST-SRCS-yes += $(ALL_SRCS)
281INSTALL-SRCS-yes += $(UTIL_SRCS)
Tom Finegan3d7063d2015-05-12 15:33:40 -0700282OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS))
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900283BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400284
285
286# Instantiate linker template for all examples.
287CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
KO Myung-Hun6d52fe22014-08-08 13:13:02 +0900288ifneq ($(filter darwin%,$(TGT_OS)),)
289SHARED_LIB_SUF=.dylib
290else
291ifneq ($(filter os2%,$(TGT_OS)),)
292SHARED_LIB_SUF=_dll.a
293else
294SHARED_LIB_SUF=.so
295endif
296endif
jimbankoski45e551b2012-07-25 19:39:33 -0700297CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400298$(foreach bin,$(BINS-yes),\
Tom Finegan3d7063d2015-05-12 15:33:40 -0700299 $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
300 $(eval $(call linker_template,$(bin),\
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900301 $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
John Koleszar0ea50ce2010-05-18 11:58:33 -0400302 -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
Tom Finegan3d7063d2015-05-12 15:33:40 -0700303 )))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400304
John Koleszar0ea50ce2010-05-18 11:58:33 -0400305# The following pairs define a mapping of locations in the distribution
306# tree to locations in the source/build trees.
307INSTALL_MAPS += src/%.c %.c
308INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
309INSTALL_MAPS += bin/% %
310INSTALL_MAPS += % %
311
312
313# Set up additional MSVS environment
314ifeq ($(CONFIG_MSVS),yes)
Jim Bankoski1b16e742012-07-23 12:32:59 -0700315CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400316# This variable uses deferred expansion intentionally, since the results of
317# $(wildcard) may change during the course of the Make.
318VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
319INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%)
320endif
321
322# Build Visual Studio Projects. We use a template here to instantiate
323# explicit rules rather than using an implicit rule because we want to
324# leverage make's VPATH searching rather than specifying the paths on
325# each file in ALL_EXAMPLES. This has the unfortunate side effect that
326# touching the source files trigger a rebuild of the project files
327# even though there is no real dependency there (the dependency is on
328# the makefiles). We may want to revisit this.
329define vcproj_template
Martin Storsjo9a5cac02013-05-18 19:57:19 +0300330$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
James Zerna2746d72015-08-03 16:24:24 -0700331 $(if $(quiet),@echo " [vcproj] $$@")
332 $(qexec)$$(GEN_VCPROJ)\
John Koleszar0ea50ce2010-05-18 11:58:33 -0400333 --exe\
334 --target=$$(TOOLCHAIN)\
Martin Storsjo0b4637e2013-05-17 00:56:46 +0300335 --name=$$(@:.$(VCPROJ_SFX)=)\
John Koleszar0ea50ce2010-05-18 11:58:33 -0400336 --ver=$$(CONFIG_VS_VERSION)\
Martin Storsjo0b4637e2013-05-17 00:56:46 +0300337 --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\
James Zernf66590c2014-06-02 16:42:14 -0700338 --src-path-bare="$(SRC_PATH_BARE)" \
John Koleszar0ea50ce2010-05-18 11:58:33 -0400339 $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
Ronald S. Bultjebbf890f2011-05-02 13:56:41 -0400340 --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
Martin Storsjoa37e84d2013-05-19 12:21:29 +0300341 $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
John Koleszar0ea50ce2010-05-18 11:58:33 -0400342endef
James Zern77bbcab2014-02-05 16:55:01 -0800343ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
344PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400345INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
James Zern77bbcab2014-02-05 16:55:01 -0800346 $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400347$(foreach proj,$(call enabled,PROJECTS),\
348 $(eval $(call vcproj_template,$(proj))))
James Zern354c5662014-02-14 19:38:20 -0800349
350#
351# Documentation Rules
352#
353%.dox: %.c
354 @echo " [DOXY] $@"
James Zernaaccf652015-02-05 19:31:38 -0800355 @mkdir -p $(dir $@)
James Zern354c5662014-02-14 19:38:20 -0800356 @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@
357 @echo " \includelineno $(<F)" >> $@
358 @echo "*/" >> $@
359
360samples.dox: examples.mk
361 @echo " [DOXY] $@"
362 @echo "/*!\page samples Sample Code" > $@
363 @echo " This SDK includes a number of sample applications."\
364 "Each sample documents a feature of the SDK in both prose"\
365 "and the associated C code."\
366 "The following samples are included: ">>$@
367 @$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\
368 echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
369 @echo >> $@
370 @echo " In addition, the SDK contains a number of utilities."\
371 "Since these utilities are built upon the concepts described"\
372 "in the sample code listed above, they are not documented in"\
373 "pieces like the samples are. Their source is included here"\
374 "for reference. The following utilities are included:" >> $@
375 @$(foreach ex,$(sort $(UTILS:.c=)),\
376 echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
377 @echo "*/" >> $@
378
379CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
380DOCS-yes += examples.doxy samples.dox
381examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
382 @echo "INPUT += $^" > $@