| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 1 | ## |
| John Koleszar | c2140b8 | 2010-09-09 12:16:39 | [diff] [blame] | 2 | ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 3 | ## |
| John Koleszar | 94c52e4 | 2010-06-18 16:39:21 | [diff] [blame] | 4 | ## Use of this source code is governed by a BSD-style license |
| John Koleszar | 09202d8 | 2010-06-04 20:19:40 | [diff] [blame] | 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 |
| John Koleszar | 94c52e4 | 2010-06-18 16:39:21 | [diff] [blame] | 7 | ## in the file PATENTS. All contributing project authors may |
| John Koleszar | 09202d8 | 2010-06-04 20:19:40 | [diff] [blame] | 8 | ## be found in the AUTHORS file in the root of the source tree. |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 9 | ## |
| 10 | |
| John Koleszar | 7dfec96 | 2012-03-01 20:50:40 | [diff] [blame] | 11 | LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \ |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 12 | 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 Koleszar | 7dfec96 | 2012-03-01 20:50:40 | [diff] [blame] | 15 | third_party/libyuv/include/libyuv/cpu_id.h \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 16 | third_party/libyuv/include/libyuv/planar_functions.h \ |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 17 | third_party/libyuv/include/libyuv/rotate.h \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 18 | third_party/libyuv/include/libyuv/row.h \ |
| John Koleszar | 7dfec96 | 2012-03-01 20:50:40 | [diff] [blame] | 19 | third_party/libyuv/include/libyuv/scale.h \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 20 | 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 Zern | fcb4253 | 2015-07-24 23:54:51 | [diff] [blame] | 25 | third_party/libyuv/source/row_gcc.cc \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 26 | third_party/libyuv/source/row_mips.cc \ |
| 27 | third_party/libyuv/source/row_neon.cc \ |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 28 | third_party/libyuv/source/row_neon64.cc \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 29 | third_party/libyuv/source/row_win.cc \ |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 30 | third_party/libyuv/source/scale.cc \ |
| James Zern | fcb4253 | 2015-07-24 23:54:51 | [diff] [blame] | 31 | third_party/libyuv/source/scale_any.cc \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 32 | third_party/libyuv/source/scale_common.cc \ |
| James Zern | fcb4253 | 2015-07-24 23:54:51 | [diff] [blame] | 33 | third_party/libyuv/source/scale_gcc.cc \ |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 34 | third_party/libyuv/source/scale_mips.cc \ |
| 35 | third_party/libyuv/source/scale_neon.cc \ |
| James Zern | 2f5e0fa | 2014-08-23 01:16:44 | [diff] [blame] | 36 | third_party/libyuv/source/scale_neon64.cc \ |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 37 | third_party/libyuv/source/scale_win.cc \ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 38 | |
| Vignesh Venkatasubramanian | dd55107 | 2015-09-10 18:02:40 | [diff] [blame] | 39 | LIBWEBM_COMMON_SRCS += third_party/libwebm/webmids.hpp |
| 40 | |
| Vignesh Venkatasubramanian | 2dcbf8c | 2014-03-19 18:56:02 | [diff] [blame] | 41 | LIBWEBM_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 Venkatasubramanian | dd55107 | 2015-09-10 18:02:40 | [diff] [blame] | 48 | third_party/libwebm/mkvwriter.hpp |
| Vignesh Venkatasubramanian | 2dcbf8c | 2014-03-19 18:56:02 | [diff] [blame] | 49 | |
| Vignesh Venkatasubramanian | dbd2471 | 2014-04-03 07:41:14 | [diff] [blame] | 50 | LIBWEBM_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 Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 55 | # List of examples to build. UTILS are tools meant for distribution |
| 56 | # while EXAMPLES demonstrate specific portions of the API. |
| John Koleszar | ea68ee0 | 2010-10-21 19:02:10 | [diff] [blame] | 57 | UTILS-$(CONFIG_DECODERS) += vpxdec.c |
| 58 | vpxdec.SRCS += md5_utils.c md5_utils.h |
| Dmitry Kovalev | 4334c07 | 2014-02-27 00:32:09 | [diff] [blame] | 59 | vpxdec.SRCS += vpx_ports/mem_ops.h |
| 60 | vpxdec.SRCS += vpx_ports/mem_ops_aligned.h |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 61 | vpxdec.SRCS += vpx_ports/msvc.h |
| John Koleszar | ea68ee0 | 2010-10-21 19:02:10 | [diff] [blame] | 62 | vpxdec.SRCS += vpx_ports/vpx_timer.h |
| 63 | vpxdec.SRCS += vpx/vpx_integer.h |
| Attila Nagy | 1a7d25a | 2011-09-15 12:34:12 | [diff] [blame] | 64 | vpxdec.SRCS += args.c args.h |
| Tom Finegan | 00a35aa | 2013-11-14 20:37:42 | [diff] [blame] | 65 | vpxdec.SRCS += ivfdec.c ivfdec.h |
| John Koleszar | c377bf0 | 2010-11-02 13:11:57 | [diff] [blame] | 66 | vpxdec.SRCS += tools_common.c tools_common.h |
| Dmitry Kovalev | 5ab6358 | 2014-01-18 01:02:37 | [diff] [blame] | 67 | vpxdec.SRCS += y4menc.c y4menc.h |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 68 | ifeq ($(CONFIG_LIBYUV),yes) |
| 69 | vpxdec.SRCS += $(LIBYUV_SRCS) |
| 70 | endif |
| Vignesh Venkatasubramanian | 0ffa383 | 2014-03-14 15:10:35 | [diff] [blame] | 71 | ifeq ($(CONFIG_WEBM_IO),yes) |
| Vignesh Venkatasubramanian | dd55107 | 2015-09-10 18:02:40 | [diff] [blame] | 72 | vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS) |
| Vignesh Venkatasubramanian | dbd2471 | 2014-04-03 07:41:14 | [diff] [blame] | 73 | vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS) |
| 74 | vpxdec.SRCS += webmdec.cc webmdec.h |
| Vignesh Venkatasubramanian | 0ffa383 | 2014-03-14 15:10:35 | [diff] [blame] | 75 | endif |
| John Koleszar | ea68ee0 | 2010-10-21 19:02:10 | [diff] [blame] | 76 | vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950 |
| 77 | vpxdec.DESCRIPTION = Full featured decoder |
| 78 | UTILS-$(CONFIG_ENCODERS) += vpxenc.c |
| Tom Finegan | 49dc9ca | 2013-11-22 00:46:40 | [diff] [blame] | 79 | vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h |
| Tom Finegan | 00a35aa | 2013-11-14 20:37:42 | [diff] [blame] | 80 | vpxenc.SRCS += ivfdec.c ivfdec.h |
| 81 | vpxenc.SRCS += ivfenc.c ivfenc.h |
| Dmitry Kovalev | f11da2b | 2014-01-29 20:28:29 | [diff] [blame] | 82 | vpxenc.SRCS += rate_hist.c rate_hist.h |
| John Koleszar | c377bf0 | 2010-11-02 13:11:57 | [diff] [blame] | 83 | vpxenc.SRCS += tools_common.c tools_common.h |
| Tom Finegan | 249366b | 2013-11-25 20:05:19 | [diff] [blame] | 84 | vpxenc.SRCS += warnings.c warnings.h |
| Attila Nagy | 1a7d25a | 2011-09-15 12:34:12 | [diff] [blame] | 85 | vpxenc.SRCS += vpx_ports/mem_ops.h |
| John Koleszar | ea68ee0 | 2010-10-21 19:02:10 | [diff] [blame] | 86 | vpxenc.SRCS += vpx_ports/mem_ops_aligned.h |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 87 | vpxenc.SRCS += vpx_ports/msvc.h |
| Johann | c459d37 | 2012-04-02 22:08:18 | [diff] [blame] | 88 | vpxenc.SRCS += vpx_ports/vpx_timer.h |
| Tom Finegan | 78cb2e6 | 2013-11-08 05:28:45 | [diff] [blame] | 89 | vpxenc.SRCS += vpxstats.c vpxstats.h |
| Deb Mukherjee | 47031c0 | 2014-05-17 01:52:01 | [diff] [blame] | 90 | ifeq ($(CONFIG_LIBYUV),yes) |
| 91 | vpxenc.SRCS += $(LIBYUV_SRCS) |
| 92 | endif |
| Vignesh Venkatasubramanian | 0ffa383 | 2014-03-14 15:10:35 | [diff] [blame] | 93 | ifeq ($(CONFIG_WEBM_IO),yes) |
| Vignesh Venkatasubramanian | dd55107 | 2015-09-10 18:02:40 | [diff] [blame] | 94 | vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS) |
| Vignesh Venkatasubramanian | 2dcbf8c | 2014-03-19 18:56:02 | [diff] [blame] | 95 | vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS) |
| 96 | vpxenc.SRCS += webmenc.cc webmenc.h |
| Vignesh Venkatasubramanian | 0ffa383 | 2014-03-14 15:10:35 | [diff] [blame] | 97 | endif |
| John Koleszar | ea68ee0 | 2010-10-21 19:02:10 | [diff] [blame] | 98 | vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1 |
| 99 | vpxenc.DESCRIPTION = Full featured encoder |
| Deb Mukherjee | cacea00 | 2014-01-23 22:53:53 | [diff] [blame] | 100 | |
| Tom Finegan | a77d6d0 | 2014-05-14 18:21:15 | [diff] [blame] | 101 | EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_svc_encoder.c |
| 102 | vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h |
| 103 | vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h |
| 104 | vpx_temporal_svc_encoder.SRCS += video_common.h |
| 105 | vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 106 | vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h |
| Tom Finegan | a77d6d0 | 2014-05-14 18:21:15 | [diff] [blame] | 107 | vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947 |
| 108 | vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder |
| Dmitry Kovalev | 5ba8c79 | 2014-09-11 22:46:37 | [diff] [blame] | 109 | EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 110 | simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC |
| Dmitry Kovalev | 7ec2769 | 2014-01-27 21:40:29 | [diff] [blame] | 111 | simple_decoder.SRCS += ivfdec.h ivfdec.c |
| 112 | simple_decoder.SRCS += tools_common.h tools_common.c |
| Dmitry Kovalev | 37e6fd3 | 2014-02-06 02:34:46 | [diff] [blame] | 113 | simple_decoder.SRCS += video_common.h |
| 114 | simple_decoder.SRCS += video_reader.h video_reader.c |
| Dmitry Kovalev | 4334c07 | 2014-02-27 00:32:09 | [diff] [blame] | 115 | simple_decoder.SRCS += vpx_ports/mem_ops.h |
| 116 | simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 117 | simple_decoder.SRCS += vpx_ports/msvc.h |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 118 | simple_decoder.DESCRIPTION = Simplified decoder loop |
| Dmitry Kovalev | 5ba8c79 | 2014-09-11 22:46:37 | [diff] [blame] | 119 | EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c |
| Dmitry Kovalev | c2b3368 | 2014-01-24 19:20:09 | [diff] [blame] | 120 | decode_to_md5.SRCS += md5_utils.h md5_utils.c |
| 121 | decode_to_md5.SRCS += ivfdec.h ivfdec.c |
| 122 | decode_to_md5.SRCS += tools_common.h tools_common.c |
| Dmitry Kovalev | 37e6fd3 | 2014-02-06 02:34:46 | [diff] [blame] | 123 | decode_to_md5.SRCS += video_common.h |
| 124 | decode_to_md5.SRCS += video_reader.h video_reader.c |
| Dmitry Kovalev | 4334c07 | 2014-02-27 00:32:09 | [diff] [blame] | 125 | decode_to_md5.SRCS += vpx_ports/mem_ops.h |
| 126 | decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 127 | decode_to_md5.SRCS += vpx_ports/msvc.h |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 128 | decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42 |
| 129 | decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum |
| Dmitry Kovalev | 5ba8c79 | 2014-09-11 22:46:37 | [diff] [blame] | 130 | EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c |
| Dmitry Kovalev | 37e6fd3 | 2014-02-06 02:34:46 | [diff] [blame] | 131 | simple_encoder.SRCS += ivfenc.h ivfenc.c |
| 132 | simple_encoder.SRCS += tools_common.h tools_common.c |
| 133 | simple_encoder.SRCS += video_common.h |
| 134 | simple_encoder.SRCS += video_writer.h video_writer.c |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 135 | simple_encoder.SRCS += vpx_ports/msvc.h |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 136 | simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD |
| 137 | simple_encoder.DESCRIPTION = Simplified encoder loop |
| Dmitry Kovalev | 5ba8c79 | 2014-09-11 22:46:37 | [diff] [blame] | 138 | EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c |
| Dmitry Kovalev | 592936b | 2014-02-07 19:37:39 | [diff] [blame] | 139 | twopass_encoder.SRCS += ivfenc.h ivfenc.c |
| 140 | twopass_encoder.SRCS += tools_common.h tools_common.c |
| 141 | twopass_encoder.SRCS += video_common.h |
| 142 | twopass_encoder.SRCS += video_writer.h video_writer.c |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 143 | twopass_encoder.SRCS += vpx_ports/msvc.h |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 144 | twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8 |
| 145 | twopass_encoder.DESCRIPTION = Two-pass encoder loop |
| Dmitry Kovalev | 5ba8c79 | 2014-09-11 22:46:37 | [diff] [blame] | 146 | EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 147 | decode_with_drops.SRCS += ivfdec.h ivfdec.c |
| 148 | decode_with_drops.SRCS += tools_common.h tools_common.c |
| Dmitry Kovalev | 37e6fd3 | 2014-02-06 02:34:46 | [diff] [blame] | 149 | decode_with_drops.SRCS += video_common.h |
| 150 | decode_with_drops.SRCS += video_reader.h video_reader.c |
| Dmitry Kovalev | 4334c07 | 2014-02-27 00:32:09 | [diff] [blame] | 151 | decode_with_drops.SRCS += vpx_ports/mem_ops.h |
| 152 | decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 153 | decode_with_drops.SRCS += vpx_ports/msvc.h |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 154 | decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26 |
| 155 | decode_with_drops.DESCRIPTION = Drops frames while decoding |
| Alex Converse | 61ecd7f | 2014-03-10 23:13:49 | [diff] [blame] | 156 | EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c |
| 157 | set_maps.SRCS += ivfenc.h ivfenc.c |
| 158 | set_maps.SRCS += tools_common.h tools_common.c |
| 159 | set_maps.SRCS += video_common.h |
| 160 | set_maps.SRCS += video_writer.h video_writer.c |
| Johann | cad0eca | 2015-05-07 23:41:33 | [diff] [blame] | 161 | set_maps.SRCS += vpx_ports/msvc.h |
| Alex Converse | 61ecd7f | 2014-03-10 23:13:49 | [diff] [blame] | 162 | set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F |
| 163 | set_maps.DESCRIPTION = Set active and ROI maps |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 164 | |
| Dmitry Kovalev | 98254a4 | 2014-01-18 00:56:04 | [diff] [blame] | 165 | |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 166 | # Handle extra library flags depending on codec configuration |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 167 | |
| Tero Rintaluoma | 11a222f | 2011-01-24 09:21:40 | [diff] [blame] | 168 | # We should not link to math library (libm) on RVCT |
| 169 | # when building for bare-metal targets |
| 170 | ifeq ($(CONFIG_OS_SUPPORT), yes) |
| Jim Bankoski | 50cbe24 | 2016-01-21 22:16:46 | [diff] [blame] | 171 | CODEC_EXTRA_LIBS-$(CONFIG_VP10) += m |
| Tero Rintaluoma | 11a222f | 2011-01-24 09:21:40 | [diff] [blame] | 172 | else |
| 173 | ifeq ($(CONFIG_GCC), yes) |
| Jim Bankoski | 50cbe24 | 2016-01-21 22:16:46 | [diff] [blame] | 174 | CODEC_EXTRA_LIBS-$(CONFIG_VP10) += m |
| Tero Rintaluoma | 11a222f | 2011-01-24 09:21:40 | [diff] [blame] | 175 | endif |
| 176 | endif |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 177 | # |
| 178 | # End of specified files. The rest of the build rules should happen |
| 179 | # automagically from here. |
| 180 | # |
| 181 | |
| 182 | |
| 183 | # Examples need different flags based on whether we're building |
| 184 | # from an installed tree or a version controlled tree. Determine |
| 185 | # the proper paths. |
| 186 | ifeq ($(HAVE_ALT_TREE_LAYOUT),yes) |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 187 | LIB_PATH-yes := $(SRC_PATH_BARE)/../lib |
| 188 | INC_PATH-yes := $(SRC_PATH_BARE)/../include |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 189 | else |
| 190 | LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.) |
| Jim Bankoski | 50cbe24 | 2016-01-21 22:16:46 | [diff] [blame] | 191 | INC_PATH-$(CONFIG_VP10_DECODER) += $(SRC_PATH_BARE)/vp10 |
| 192 | INC_PATH-$(CONFIG_VP10_ENCODER) += $(SRC_PATH_BARE)/vp10 |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 193 | endif |
| James Zern | 3a7d467 | 2014-08-10 23:15:18 | [diff] [blame] | 194 | INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include |
| 195 | LIB_PATH := $(call enabled,LIB_PATH) |
| 196 | INC_PATH := $(call enabled,INC_PATH) |
| Ronald S. Bultje | bbf890f | 2011-05-02 17:56:41 | [diff] [blame] | 197 | INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH)) |
| 198 | INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH)) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 199 | |
| 200 | |
| 201 | # Expand list of selected examples to build (as specified above) |
| 202 | UTILS = $(call enabled,UTILS) |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 203 | EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES)) |
| 204 | ALL_EXAMPLES = $(UTILS) $(EXAMPLES) |
| John Koleszar | ee8bcb1 | 2010-05-24 14:16:44 | [diff] [blame] | 205 | UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS)) |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 206 | ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS)) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 207 | CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS)) |
| 208 | |
| 209 | |
| 210 | # Expand all example sources into a variable containing all sources |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 211 | # for that example (not just them main one specified in UTILS/EXAMPLES) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 212 | # and add this file to the list (for MSVS workspace generation) |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 213 | $(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk)) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 214 | |
| 215 | |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 216 | # Create build/install dependencies for all examples. The common case |
| 217 | # is handled here. The MSVS case is handled below. |
| 218 | NOT_MSVS = $(if $(CONFIG_MSVS),,yes) |
| KO Myung-Hun | 2dad8d6 | 2012-02-03 04:31:11 | [diff] [blame] | 219 | DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX))) |
| 220 | INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX))) |
| John Koleszar | ee8bcb1 | 2010-05-24 14:16:44 | [diff] [blame] | 221 | DIST-SRCS-yes += $(ALL_SRCS) |
| 222 | INSTALL-SRCS-yes += $(UTIL_SRCS) |
| Tom Finegan | 3d7063d | 2015-05-12 22:33:40 | [diff] [blame] | 223 | OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS)) |
| KO Myung-Hun | 2dad8d6 | 2012-02-03 04:31:11 | [diff] [blame] | 224 | BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX))) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 225 | |
| 226 | |
| 227 | # Instantiate linker template for all examples. |
| 228 | CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) |
| KO Myung-Hun | 6d52fe2 | 2014-08-08 04:13:02 | [diff] [blame] | 229 | ifneq ($(filter darwin%,$(TGT_OS)),) |
| 230 | SHARED_LIB_SUF=.dylib |
| 231 | else |
| 232 | ifneq ($(filter os2%,$(TGT_OS)),) |
| 233 | SHARED_LIB_SUF=_dll.a |
| 234 | else |
| 235 | SHARED_LIB_SUF=.so |
| 236 | endif |
| 237 | endif |
| jimbankoski | 45e551b | 2012-07-26 02:39:33 | [diff] [blame] | 238 | CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 239 | $(foreach bin,$(BINS-yes),\ |
| Tom Finegan | 3d7063d | 2015-05-12 22:33:40 | [diff] [blame] | 240 | $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\ |
| 241 | $(eval $(call linker_template,$(bin),\ |
| KO Myung-Hun | 2dad8d6 | 2012-02-03 04:31:11 | [diff] [blame] | 242 | $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 243 | -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\ |
| Tom Finegan | 3d7063d | 2015-05-12 22:33:40 | [diff] [blame] | 244 | ))) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 245 | |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 246 | # The following pairs define a mapping of locations in the distribution |
| 247 | # tree to locations in the source/build trees. |
| 248 | INSTALL_MAPS += src/%.c %.c |
| 249 | INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% |
| 250 | INSTALL_MAPS += bin/% % |
| 251 | INSTALL_MAPS += % % |
| 252 | |
| 253 | |
| 254 | # Set up additional MSVS environment |
| 255 | ifeq ($(CONFIG_MSVS),yes) |
| Jim Bankoski | 1b16e74 | 2012-07-23 19:32:59 | [diff] [blame] | 256 | CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 257 | # This variable uses deferred expansion intentionally, since the results of |
| 258 | # $(wildcard) may change during the course of the Make. |
| 259 | VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d)))) |
| 260 | INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%) |
| 261 | endif |
| 262 | |
| 263 | # Build Visual Studio Projects. We use a template here to instantiate |
| 264 | # explicit rules rather than using an implicit rule because we want to |
| 265 | # leverage make's VPATH searching rather than specifying the paths on |
| 266 | # each file in ALL_EXAMPLES. This has the unfortunate side effect that |
| 267 | # touching the source files trigger a rebuild of the project files |
| 268 | # even though there is no real dependency there (the dependency is on |
| 269 | # the makefiles). We may want to revisit this. |
| 270 | define vcproj_template |
| Martin Storsjo | 9a5cac0 | 2013-05-18 16:57:19 | [diff] [blame] | 271 | $(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX) |
| James Zern | a2746d7 | 2015-08-03 23:24:24 | [diff] [blame] | 272 | $(if $(quiet),@echo " [vcproj] $$@") |
| 273 | $(qexec)$$(GEN_VCPROJ)\ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 274 | --exe\ |
| 275 | --target=$$(TOOLCHAIN)\ |
| Martin Storsjo | 0b4637e | 2013-05-16 21:56:46 | [diff] [blame] | 276 | --name=$$(@:.$(VCPROJ_SFX)=)\ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 277 | --ver=$$(CONFIG_VS_VERSION)\ |
| Martin Storsjo | 0b4637e | 2013-05-16 21:56:46 | [diff] [blame] | 278 | --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\ |
| James Zern | f66590c | 2014-06-02 23:42:14 | [diff] [blame] | 279 | --src-path-bare="$(SRC_PATH_BARE)" \ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 280 | $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \ |
| Ronald S. Bultje | bbf890f | 2011-05-02 17:56:41 | [diff] [blame] | 281 | --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \ |
| Martin Storsjo | a37e84d | 2013-05-19 09:21:29 | [diff] [blame] | 282 | $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^ |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 283 | endef |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 284 | ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES)) |
| 285 | PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX)) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 286 | INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\ |
| James Zern | 77bbcab | 2014-02-06 00:55:01 | [diff] [blame] | 287 | $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe))) |
| John Koleszar | 0ea50ce | 2010-05-18 15:58:33 | [diff] [blame] | 288 | $(foreach proj,$(call enabled,PROJECTS),\ |
| 289 | $(eval $(call vcproj_template,$(proj)))) |
| James Zern | 354c566 | 2014-02-15 03:38:20 | [diff] [blame] | 290 | |
| 291 | # |
| 292 | # Documentation Rules |
| 293 | # |
| 294 | %.dox: %.c |
| 295 | @echo " [DOXY] $@" |
| James Zern | aaccf65 | 2015-02-06 03:31:38 | [diff] [blame] | 296 | @mkdir -p $(dir $@) |
| James Zern | 354c566 | 2014-02-15 03:38:20 | [diff] [blame] | 297 | @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@ |
| 298 | @echo " \includelineno $(<F)" >> $@ |
| 299 | @echo "*/" >> $@ |
| 300 | |
| 301 | samples.dox: examples.mk |
| 302 | @echo " [DOXY] $@" |
| 303 | @echo "/*!\page samples Sample Code" > $@ |
| 304 | @echo " This SDK includes a number of sample applications."\ |
| 305 | "Each sample documents a feature of the SDK in both prose"\ |
| 306 | "and the associated C code."\ |
| 307 | "The following samples are included: ">>$@ |
| 308 | @$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\ |
| 309 | echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) |
| 310 | @echo >> $@ |
| 311 | @echo " In addition, the SDK contains a number of utilities."\ |
| 312 | "Since these utilities are built upon the concepts described"\ |
| 313 | "in the sample code listed above, they are not documented in"\ |
| 314 | "pieces like the samples are. Their source is included here"\ |
| 315 | "for reference. The following utilities are included:" >> $@ |
| 316 | @$(foreach ex,$(sort $(UTILS:.c=)),\ |
| 317 | echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) |
| 318 | @echo "*/" >> $@ |
| 319 | |
| 320 | CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox) |
| 321 | DOCS-yes += examples.doxy samples.dox |
| 322 | examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox) |
| 323 | @echo "INPUT += $^" > $@ |