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