blob: 30fade1fefc94f37ff6ab4f9accea827803f22d4 [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
Tom Finegan4317ba52016-03-24 13:12:51 -070039LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \
40 third_party/libwebm/common/hdr_util.h \
41 third_party/libwebm/common/webmids.h
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070042
Tom Finegan4317ba52016-03-24 13:12:51 -070043LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \
44 third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \
45 third_party/libwebm/mkvmuxer/mkvwriter.cc \
46 third_party/libwebm/mkvmuxer/mkvmuxer.h \
47 third_party/libwebm/mkvmuxer/mkvmuxertypes.h \
48 third_party/libwebm/mkvmuxer/mkvmuxerutil.h \
49 third_party/libwebm/mkvparser/mkvparser.h \
50 third_party/libwebm/mkvmuxer/mkvwriter.h
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -070051
Tom Finegan4317ba52016-03-24 13:12:51 -070052LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
53 third_party/libwebm/mkvparser/mkvreader.cc \
54 third_party/libwebm/mkvparser/mkvparser.h \
55 third_party/libwebm/mkvparser/mkvreader.h
56
57# Add compile flags and include path for libwebm sources.
58ifeq ($(CONFIG_WEBM_IO),yes)
59 CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
60 INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
61endif
62
Vignesh Venkatasubramaniandbd24712014-04-03 00:41:14 -070063
James Zern77bbcab2014-02-05 16:55:01 -080064# List of examples to build. UTILS are tools meant for distribution
65# while EXAMPLES demonstrate specific portions of the API.
John Koleszarea68ee02010-10-21 15:02:10 -040066UTILS-$(CONFIG_DECODERS) += vpxdec.c
67vpxdec.SRCS += md5_utils.c md5_utils.h
Dmitry Kovalev4334c072014-02-26 16:32:09 -080068vpxdec.SRCS += vpx_ports/mem_ops.h
69vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -070070vpxdec.SRCS += vpx_ports/msvc.h
John Koleszarea68ee02010-10-21 15:02:10 -040071vpxdec.SRCS += vpx_ports/vpx_timer.h
72vpxdec.SRCS += vpx/vpx_integer.h
Attila Nagy1a7d25a2011-09-15 15:34:12 +030073vpxdec.SRCS += args.c args.h
Tom Finegan00a35aa2013-11-14 12:37:42 -080074vpxdec.SRCS += ivfdec.c ivfdec.h
John Koleszarc377bf02010-11-02 09:11:57 -040075vpxdec.SRCS += tools_common.c tools_common.h
Dmitry Kovalev5ab63582014-01-17 17:02:37 -080076vpxdec.SRCS += y4menc.c y4menc.h
Deb Mukherjee47031c02014-05-16 18:52:01 -070077ifeq ($(CONFIG_LIBYUV),yes)
78 vpxdec.SRCS += $(LIBYUV_SRCS)
79endif
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070080ifeq ($(CONFIG_WEBM_IO),yes)
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -070081 vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
Tom Finegan4317ba52016-03-24 13:12:51 -070082 vpxdec.SRCS += $(LIBWEBM_MUXER_SRCS)
Vignesh Venkatasubramaniandbd24712014-04-03 00:41:14 -070083 vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
84 vpxdec.SRCS += webmdec.cc webmdec.h
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -070085endif
John Koleszarea68ee02010-10-21 15:02:10 -040086vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
87vpxdec.DESCRIPTION = Full featured decoder
88UTILS-$(CONFIG_ENCODERS) += vpxenc.c
Tom Finegan49dc9ca2013-11-21 16:46:40 -080089vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h
Tom Finegan00a35aa2013-11-14 12:37:42 -080090vpxenc.SRCS += ivfdec.c ivfdec.h
91vpxenc.SRCS += ivfenc.c ivfenc.h
Dmitry Kovalevf11da2b2014-01-29 12:28:29 -080092vpxenc.SRCS += rate_hist.c rate_hist.h
John Koleszarc377bf02010-11-02 09:11:57 -040093vpxenc.SRCS += tools_common.c tools_common.h
Tom Finegan249366b2013-11-25 12:05:19 -080094vpxenc.SRCS += warnings.c warnings.h
Attila Nagy1a7d25a2011-09-15 15:34:12 +030095vpxenc.SRCS += vpx_ports/mem_ops.h
John Koleszarea68ee02010-10-21 15:02:10 -040096vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -070097vpxenc.SRCS += vpx_ports/msvc.h
Johannc459d372012-04-02 15:08:18 -070098vpxenc.SRCS += vpx_ports/vpx_timer.h
Tom Finegan78cb2e62013-11-07 21:28:45 -080099vpxenc.SRCS += vpxstats.c vpxstats.h
Deb Mukherjee47031c02014-05-16 18:52:01 -0700100ifeq ($(CONFIG_LIBYUV),yes)
101 vpxenc.SRCS += $(LIBYUV_SRCS)
102endif
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -0700103ifeq ($(CONFIG_WEBM_IO),yes)
Vignesh Venkatasubramaniandd551072015-09-10 11:02:40 -0700104 vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -0700105 vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
Tom Finegan4317ba52016-03-24 13:12:51 -0700106 vpxenc.SRCS += $(LIBWEBM_PARSER_SRCS)
Vignesh Venkatasubramanian2dcbf8c2014-03-19 11:56:02 -0700107 vpxenc.SRCS += webmenc.cc webmenc.h
Vignesh Venkatasubramanian0ffa3832014-03-14 08:10:35 -0700108endif
John Koleszarea68ee02010-10-21 15:02:10 -0400109vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
110vpxenc.DESCRIPTION = Full featured encoder
111
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700112EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
James Zern77bbcab2014-02-05 16:55:01 -0800113simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
Dmitry Kovalev7ec27692014-01-27 13:40:29 -0800114simple_decoder.SRCS += ivfdec.h ivfdec.c
115simple_decoder.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800116simple_decoder.SRCS += video_common.h
117simple_decoder.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800118simple_decoder.SRCS += vpx_ports/mem_ops.h
119simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700120simple_decoder.SRCS += vpx_ports/msvc.h
James Zern77bbcab2014-02-05 16:55:01 -0800121simple_decoder.DESCRIPTION = Simplified decoder loop
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700122EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
Dmitry Kovalevc2b33682014-01-24 11:20:09 -0800123decode_to_md5.SRCS += md5_utils.h md5_utils.c
124decode_to_md5.SRCS += ivfdec.h ivfdec.c
125decode_to_md5.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800126decode_to_md5.SRCS += video_common.h
127decode_to_md5.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800128decode_to_md5.SRCS += vpx_ports/mem_ops.h
129decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700130decode_to_md5.SRCS += vpx_ports/msvc.h
James Zern77bbcab2014-02-05 16:55:01 -0800131decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
132decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700133EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800134simple_encoder.SRCS += ivfenc.h ivfenc.c
135simple_encoder.SRCS += tools_common.h tools_common.c
136simple_encoder.SRCS += video_common.h
137simple_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700138simple_encoder.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400139simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
140simple_encoder.DESCRIPTION = Simplified encoder loop
Yaowu Xu5eee9072016-07-28 11:51:48 -0700141EXAMPLES-$(CONFIG_VP10_ENCODER) += lossless_encoder.c
142lossless_encoder.SRCS += ivfenc.h ivfenc.c
143lossless_encoder.SRCS += tools_common.h tools_common.c
144lossless_encoder.SRCS += video_common.h
145lossless_encoder.SRCS += video_writer.h video_writer.c
146lossless_encoder.SRCS += vpx_ports/msvc.h
147lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
Yaowu Xua3cff082016-08-03 11:33:39 -0700148lossless_encoder.DESCRIPTION = Simplified lossless encoder
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700149EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
Dmitry Kovalev592936b2014-02-07 11:37:39 -0800150twopass_encoder.SRCS += ivfenc.h ivfenc.c
151twopass_encoder.SRCS += tools_common.h tools_common.c
152twopass_encoder.SRCS += video_common.h
153twopass_encoder.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700154twopass_encoder.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400155twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
156twopass_encoder.DESCRIPTION = Two-pass encoder loop
Dmitry Kovalev5ba8c792014-09-11 15:46:37 -0700157EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
James Zern77bbcab2014-02-05 16:55:01 -0800158decode_with_drops.SRCS += ivfdec.h ivfdec.c
159decode_with_drops.SRCS += tools_common.h tools_common.c
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -0800160decode_with_drops.SRCS += video_common.h
161decode_with_drops.SRCS += video_reader.h video_reader.c
Dmitry Kovalev4334c072014-02-26 16:32:09 -0800162decode_with_drops.SRCS += vpx_ports/mem_ops.h
163decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
Johanncad0eca2015-05-07 16:41:33 -0700164decode_with_drops.SRCS += vpx_ports/msvc.h
John Koleszar0ea50ce2010-05-18 11:58:33 -0400165decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
166decode_with_drops.DESCRIPTION = Drops frames while decoding
Alex Converse61ecd7f2014-03-10 16:13:49 -0700167EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
168set_maps.SRCS += ivfenc.h ivfenc.c
169set_maps.SRCS += tools_common.h tools_common.c
170set_maps.SRCS += video_common.h
171set_maps.SRCS += video_writer.h video_writer.c
Johanncad0eca2015-05-07 16:41:33 -0700172set_maps.SRCS += vpx_ports/msvc.h
Alex Converse61ecd7f2014-03-10 16:13:49 -0700173set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
174set_maps.DESCRIPTION = Set active and ROI maps
John Koleszar0ea50ce2010-05-18 11:58:33 -0400175
Yaowu Xu5eee9072016-07-28 11:51:48 -0700176
177ifeq ($(CONFIG_VP10_ENCODER), yes)
Yunqing Wang9aaa3c92016-03-25 11:57:20 -0700178ifeq ($(CONFIG_DECODERS),yes)
Yunqing Wang2a5a3f62016-07-22 17:14:22 -0700179EXAMPLES-yes += vpxcx_set_ref.c
180vpxcx_set_ref.SRCS += ivfenc.h ivfenc.c
181vpxcx_set_ref.SRCS += tools_common.h tools_common.c
182vpxcx_set_ref.SRCS += video_common.h
183vpxcx_set_ref.SRCS += video_writer.h video_writer.c
184vpxcx_set_ref.GUID = 65D7F14A-2EE6-4293-B958-AB5107A03B55
Yaowu Xua3cff082016-08-03 11:33:39 -0700185vpxcx_set_ref.DESCRIPTION = VP10 set encoder reference frame
Yunqing Wang9aaa3c92016-03-25 11:57:20 -0700186endif
187endif
Dmitry Kovalev98254a42014-01-17 16:56:04 -0800188
John Koleszar0ea50ce2010-05-18 11:58:33 -0400189
190# Handle extra library flags depending on codec configuration
John Koleszar0ea50ce2010-05-18 11:58:33 -0400191
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200192# We should not link to math library (libm) on RVCT
193# when building for bare-metal targets
194ifeq ($(CONFIG_OS_SUPPORT), yes)
Yaowu Xu3bd709f2016-07-25 15:39:46 -0700195CODEC_EXTRA_LIBS-$(CONFIG_VP10) += m
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200196else
197 ifeq ($(CONFIG_GCC), yes)
Yaowu Xu3bd709f2016-07-25 15:39:46 -0700198 CODEC_EXTRA_LIBS-$(CONFIG_VP10) += m
Tero Rintaluoma11a222f2011-01-24 11:21:40 +0200199 endif
200endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400201#
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.
210ifeq ($(HAVE_ALT_TREE_LAYOUT),yes)
James Zern3a7d4672014-08-10 16:15:18 -0700211 LIB_PATH-yes := $(SRC_PATH_BARE)/../lib
212 INC_PATH-yes := $(SRC_PATH_BARE)/../include
John Koleszar0ea50ce2010-05-18 11:58:33 -0400213else
214 LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.)
Yaowu Xu3fa28d52016-07-27 15:52:42 -0700215 INC_PATH-$(CONFIG_VP10_DECODER) += $(SRC_PATH_BARE)/vp10
216 INC_PATH-$(CONFIG_VP10_ENCODER) += $(SRC_PATH_BARE)/vp10
John Koleszar0ea50ce2010-05-18 11:58:33 -0400217endif
James Zern3a7d4672014-08-10 16:15:18 -0700218INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include
219LIB_PATH := $(call enabled,LIB_PATH)
220INC_PATH := $(call enabled,INC_PATH)
Ronald S. Bultjebbf890f2011-05-02 13:56:41 -0400221INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH))
222INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400223
224
225# Expand list of selected examples to build (as specified above)
226UTILS = $(call enabled,UTILS)
James Zern77bbcab2014-02-05 16:55:01 -0800227EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES))
228ALL_EXAMPLES = $(UTILS) $(EXAMPLES)
John Koleszaree8bcb12010-05-24 10:16:44 -0400229UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
James Zern77bbcab2014-02-05 16:55:01 -0800230ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400231CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
232
233
234# Expand all example sources into a variable containing all sources
James Zern77bbcab2014-02-05 16:55:01 -0800235# for that example (not just them main one specified in UTILS/EXAMPLES)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400236# and add this file to the list (for MSVS workspace generation)
James Zern77bbcab2014-02-05 16:55:01 -0800237$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400238
239
John Koleszar0ea50ce2010-05-18 11:58:33 -0400240# Create build/install dependencies for all examples. The common case
241# is handled here. The MSVS case is handled below.
242NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900243DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
244INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
John Koleszaree8bcb12010-05-24 10:16:44 -0400245DIST-SRCS-yes += $(ALL_SRCS)
246INSTALL-SRCS-yes += $(UTIL_SRCS)
Tom Finegan3d7063d2015-05-12 15:33:40 -0700247OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS))
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900248BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400249
250
251# Instantiate linker template for all examples.
252CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
KO Myung-Hun6d52fe22014-08-08 13:13:02 +0900253ifneq ($(filter darwin%,$(TGT_OS)),)
254SHARED_LIB_SUF=.dylib
255else
256ifneq ($(filter os2%,$(TGT_OS)),)
257SHARED_LIB_SUF=_dll.a
258else
259SHARED_LIB_SUF=.so
260endif
261endif
jimbankoski45e551b2012-07-25 19:39:33 -0700262CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400263$(foreach bin,$(BINS-yes),\
Tom Finegan3d7063d2015-05-12 15:33:40 -0700264 $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
265 $(eval $(call linker_template,$(bin),\
KO Myung-Hun2dad8d62012-02-03 13:31:11 +0900266 $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
John Koleszar0ea50ce2010-05-18 11:58:33 -0400267 -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
Tom Finegan3d7063d2015-05-12 15:33:40 -0700268 )))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400269
John Koleszar0ea50ce2010-05-18 11:58:33 -0400270# The following pairs define a mapping of locations in the distribution
271# tree to locations in the source/build trees.
272INSTALL_MAPS += src/%.c %.c
273INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
274INSTALL_MAPS += bin/% %
275INSTALL_MAPS += % %
276
277
278# Set up additional MSVS environment
279ifeq ($(CONFIG_MSVS),yes)
Jim Bankoski1b16e742012-07-23 12:32:59 -0700280CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400281# This variable uses deferred expansion intentionally, since the results of
282# $(wildcard) may change during the course of the Make.
283VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
284INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%)
285endif
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.
294define vcproj_template
Martin Storsjo9a5cac02013-05-18 19:57:19 +0300295$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
James Zerna2746d72015-08-03 16:24:24 -0700296 $(if $(quiet),@echo " [vcproj] $$@")
297 $(qexec)$$(GEN_VCPROJ)\
John Koleszar0ea50ce2010-05-18 11:58:33 -0400298 --exe\
299 --target=$$(TOOLCHAIN)\
Martin Storsjo0b4637e2013-05-17 00:56:46 +0300300 --name=$$(@:.$(VCPROJ_SFX)=)\
John Koleszar0ea50ce2010-05-18 11:58:33 -0400301 --ver=$$(CONFIG_VS_VERSION)\
Martin Storsjo0b4637e2013-05-17 00:56:46 +0300302 --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\
James Zernf66590c2014-06-02 16:42:14 -0700303 --src-path-bare="$(SRC_PATH_BARE)" \
John Koleszar0ea50ce2010-05-18 11:58:33 -0400304 $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
Ronald S. Bultjebbf890f2011-05-02 13:56:41 -0400305 --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
Martin Storsjoa37e84d2013-05-19 12:21:29 +0300306 $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
John Koleszar0ea50ce2010-05-18 11:58:33 -0400307endef
James Zern77bbcab2014-02-05 16:55:01 -0800308ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
309PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400310INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
James Zern77bbcab2014-02-05 16:55:01 -0800311 $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400312$(foreach proj,$(call enabled,PROJECTS),\
313 $(eval $(call vcproj_template,$(proj))))
James Zern354c5662014-02-14 19:38:20 -0800314
315#
316# Documentation Rules
317#
318%.dox: %.c
319 @echo " [DOXY] $@"
James Zernaaccf652015-02-05 19:31:38 -0800320 @mkdir -p $(dir $@)
James Zern354c5662014-02-14 19:38:20 -0800321 @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@
322 @echo " \includelineno $(<F)" >> $@
323 @echo "*/" >> $@
324
325samples.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
344CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
345DOCS-yes += examples.doxy samples.dox
346examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
347 @echo "INPUT += $^" > $@