John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | ## |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | ## |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | ## Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [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 12:39:21 -0400 | [diff] [blame] | 7 | ## in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | ## be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | ## |
| 10 | |
John Koleszar | 34882b9 | 2012-03-01 12:50:40 -0800 | [diff] [blame] | 11 | LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \ |
| 12 | third_party/libyuv/include/libyuv/cpu_id.h \ |
| 13 | third_party/libyuv/include/libyuv/scale.h \ |
| 14 | third_party/libyuv/source/row.h \ |
| 15 | third_party/libyuv/source/scale.c \ |
| 16 | third_party/libyuv/source/cpu_id.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 17 | |
| 18 | # List of examples to build. UTILS are files that are taken from the source |
| 19 | # tree directly, and GEN_EXAMPLES are files that are created from the |
| 20 | # examples folder. |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 21 | UTILS-$(CONFIG_DECODERS) += vpxdec.c |
| 22 | vpxdec.SRCS += md5_utils.c md5_utils.h |
| 23 | vpxdec.SRCS += vpx_ports/vpx_timer.h |
| 24 | vpxdec.SRCS += vpx/vpx_integer.h |
Attila Nagy | 1a7d25a | 2011-09-15 15:34:12 +0300 | [diff] [blame] | 25 | vpxdec.SRCS += args.c args.h |
John Koleszar | c377bf0 | 2010-11-02 09:11:57 -0400 | [diff] [blame] | 26 | vpxdec.SRCS += tools_common.c tools_common.h |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 27 | vpxdec.SRCS += nestegg/halloc/halloc.h |
| 28 | vpxdec.SRCS += nestegg/halloc/src/align.h |
| 29 | vpxdec.SRCS += nestegg/halloc/src/halloc.c |
| 30 | vpxdec.SRCS += nestegg/halloc/src/hlist.h |
| 31 | vpxdec.SRCS += nestegg/halloc/src/macros.h |
| 32 | vpxdec.SRCS += nestegg/include/nestegg/nestegg.h |
| 33 | vpxdec.SRCS += nestegg/src/nestegg.c |
John Koleszar | 0d2517c | 2013-02-25 16:58:47 -0800 | [diff] [blame] | 34 | vpxdec.SRCS += $(LIBYUV_SRCS) |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 35 | vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950 |
| 36 | vpxdec.DESCRIPTION = Full featured decoder |
| 37 | UTILS-$(CONFIG_ENCODERS) += vpxenc.c |
| 38 | vpxenc.SRCS += args.c args.h y4minput.c y4minput.h |
John Koleszar | c377bf0 | 2010-11-02 09:11:57 -0400 | [diff] [blame] | 39 | vpxenc.SRCS += tools_common.c tools_common.h |
Attila Nagy | 1a7d25a | 2011-09-15 15:34:12 +0300 | [diff] [blame] | 40 | vpxenc.SRCS += vpx_ports/mem_ops.h |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 41 | vpxenc.SRCS += vpx_ports/mem_ops_aligned.h |
Johann | c459d37 | 2012-04-02 15:08:18 -0700 | [diff] [blame] | 42 | vpxenc.SRCS += vpx_ports/vpx_timer.h |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 43 | vpxenc.SRCS += libmkv/EbmlIDs.h |
| 44 | vpxenc.SRCS += libmkv/EbmlWriter.c |
| 45 | vpxenc.SRCS += libmkv/EbmlWriter.h |
John Koleszar | 34882b9 | 2012-03-01 12:50:40 -0800 | [diff] [blame] | 46 | vpxenc.SRCS += $(LIBYUV_SRCS) |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 47 | vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1 |
| 48 | vpxenc.DESCRIPTION = Full featured encoder |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 49 | UTILS-$(CONFIG_VP8_ENCODER) += vp8_scalable_patterns.c |
Adrian Grange | 217591f | 2011-10-06 15:49:11 -0700 | [diff] [blame] | 50 | vp8_scalable_patterns.GUID = 0D6A210B-F482-4D6F-8570-4A9C01ACC88C |
| 51 | vp8_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 52 | |
| 53 | # Clean up old ivfenc, ivfdec binaries. |
| 54 | ifeq ($(CONFIG_MSVS),yes) |
| 55 | CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfenc.exe) |
| 56 | CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfdec.exe) |
| 57 | else |
John Koleszar | 3427e1d | 2010-10-27 10:06:45 -0400 | [diff] [blame] | 58 | CLEAN-OBJS += ivfenc{.c.o,.c.d,.dox,.exe,} |
| 59 | CLEAN-OBJS += ivfdec{.c.o,.c.d,.dox,.exe,} |
John Koleszar | ea68ee0 | 2010-10-21 15:02:10 -0400 | [diff] [blame] | 60 | endif |
John Koleszar | ee8bcb1 | 2010-05-24 10:16:44 -0400 | [diff] [blame] | 61 | |
| 62 | # XMA example disabled for now, not used in VP8 |
| 63 | #UTILS-$(CONFIG_DECODERS) += example_xma.c |
| 64 | #example_xma.GUID = A955FC4A-73F1-44F7-135E-30D84D32F022 |
| 65 | #example_xma.DESCRIPTION = External Memory Allocation mode usage |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 66 | |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 67 | GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += simple_decoder.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 68 | simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC |
| 69 | simple_decoder.DESCRIPTION = Simplified decoder loop |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 70 | GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += postproc.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 71 | postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7 |
| 72 | postproc.DESCRIPTION = Decoder postprocessor control |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 73 | GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += decode_to_md5.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 74 | decode_to_md5.SRCS += md5_utils.h md5_utils.c |
| 75 | decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42 |
| 76 | decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum |
| 77 | |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 78 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += simple_encoder.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 79 | simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD |
| 80 | simple_encoder.DESCRIPTION = Simplified encoder loop |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 81 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += twopass_encoder.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 82 | twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8 |
| 83 | twopass_encoder.DESCRIPTION = Two-pass encoder loop |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 84 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += force_keyframe.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 85 | force_keyframe.GUID = 3C67CADF-029F-4C86-81F5-D6D4F51177F0 |
| 86 | force_keyframe.DESCRIPTION = Force generation of keyframes |
| 87 | ifeq ($(CONFIG_DECODERS),yes) |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 88 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += decode_with_drops.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 89 | endif |
| 90 | decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26 |
| 91 | decode_with_drops.DESCRIPTION = Drops frames while decoding |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 92 | ifeq ($(CONFIG_VP8_DECODER),yes) |
Stefan Holmer | d04f852 | 2011-05-02 15:30:51 +0200 | [diff] [blame] | 93 | GEN_EXAMPLES-$(CONFIG_ERROR_CONCEALMENT) += decode_with_partial_drops.c |
| 94 | endif |
| 95 | decode_with_partial_drops.GUID = 61C2D026-5754-46AC-916F-1343ECC5537E |
| 96 | decode_with_partial_drops.DESCRIPTION = Drops parts of frames while decoding |
John Koleszar | a9c7597 | 2012-11-08 17:09:30 -0800 | [diff] [blame] | 97 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += error_resilient.c |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 98 | error_resilient.GUID = DF5837B9-4145-4F92-A031-44E4F832E00C |
| 99 | error_resilient.DESCRIPTION = Error Resiliency Feature |
| 100 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 101 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_set_maps.c |
| 102 | vp8_set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F |
| 103 | vp8_set_maps.DESCRIPTION = VP8 set active and ROI maps |
| 104 | GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c |
| 105 | vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A |
| 106 | vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame |
| 107 | |
Yunqing Wang | aa7335e | 2011-10-25 15:14:16 -0400 | [diff] [blame] | 108 | # C file is provided, not generated automatically. |
Attila Nagy | ef8ba4f | 2012-05-03 13:06:19 +0300 | [diff] [blame] | 109 | UTILS-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c |
John Koleszar | 34882b9 | 2012-03-01 12:50:40 -0800 | [diff] [blame] | 110 | vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS) |
Yunqing Wang | aa7335e | 2011-10-25 15:14:16 -0400 | [diff] [blame] | 111 | vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de |
| 112 | vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 113 | |
| 114 | # Handle extra library flags depending on codec configuration |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 115 | |
Tero Rintaluoma | 11a222f | 2011-01-24 11:21:40 +0200 | [diff] [blame] | 116 | # We should not link to math library (libm) on RVCT |
| 117 | # when building for bare-metal targets |
| 118 | ifeq ($(CONFIG_OS_SUPPORT), yes) |
| 119 | CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 120 | CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m |
Tero Rintaluoma | 11a222f | 2011-01-24 11:21:40 +0200 | [diff] [blame] | 121 | else |
| 122 | ifeq ($(CONFIG_GCC), yes) |
| 123 | CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 124 | CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m |
Tero Rintaluoma | 11a222f | 2011-01-24 11:21:40 +0200 | [diff] [blame] | 125 | endif |
| 126 | endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 127 | # |
| 128 | # End of specified files. The rest of the build rules should happen |
| 129 | # automagically from here. |
| 130 | # |
| 131 | |
| 132 | |
| 133 | # Examples need different flags based on whether we're building |
| 134 | # from an installed tree or a version controlled tree. Determine |
| 135 | # the proper paths. |
| 136 | ifeq ($(HAVE_ALT_TREE_LAYOUT),yes) |
| 137 | LIB_PATH := $(SRC_PATH_BARE)/../lib |
| 138 | INC_PATH := $(SRC_PATH_BARE)/../include |
| 139 | else |
| 140 | LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 141 | INC_PATH-$(CONFIG_VP8_DECODER) += $(SRC_PATH_BARE)/vp8 |
| 142 | INC_PATH-$(CONFIG_VP8_ENCODER) += $(SRC_PATH_BARE)/vp8 |
Ronald S. Bultje | 4b2c2b9 | 2012-11-01 11:09:58 -0700 | [diff] [blame] | 143 | INC_PATH-$(CONFIG_VP9_DECODER) += $(SRC_PATH_BARE)/vp9 |
| 144 | INC_PATH-$(CONFIG_VP9_ENCODER) += $(SRC_PATH_BARE)/vp9 |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 145 | LIB_PATH := $(call enabled,LIB_PATH) |
| 146 | INC_PATH := $(call enabled,INC_PATH) |
| 147 | endif |
Ronald S. Bultje | bbf890f | 2011-05-02 13:56:41 -0400 | [diff] [blame] | 148 | INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH)) |
| 149 | INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 150 | |
| 151 | |
| 152 | # Expand list of selected examples to build (as specified above) |
| 153 | UTILS = $(call enabled,UTILS) |
| 154 | GEN_EXAMPLES = $(call enabled,GEN_EXAMPLES) |
| 155 | ALL_EXAMPLES = $(UTILS) $(GEN_EXAMPLES) |
John Koleszar | ee8bcb1 | 2010-05-24 10:16:44 -0400 | [diff] [blame] | 156 | UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 157 | ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(ex:.c=).SRCS)) |
| 158 | CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS)) |
| 159 | |
| 160 | |
| 161 | # Expand all example sources into a variable containing all sources |
| 162 | # for that example (not just them main one specified in UTILS/GEN_EXAMPLES) |
| 163 | # and add this file to the list (for MSVS workspace generation) |
| 164 | $(foreach ex,$(ALL_EXAMPLES),$(eval $(ex:.c=).SRCS += $(ex) examples.mk)) |
| 165 | |
| 166 | |
| 167 | # If this is a universal (fat) binary, then all the subarchitectures have |
| 168 | # already been built and our job is to stitch them together. The |
| 169 | # BUILD_OBJS variable indicates whether we should be building |
| 170 | # (compiling, linking) the library. The LIPO_OBJS variable indicates |
| 171 | # that we're stitching. |
| 172 | $(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_OBJS,BUILD_OBJS):=yes) |
| 173 | |
| 174 | |
| 175 | # Create build/install dependencies for all examples. The common case |
| 176 | # is handled here. The MSVS case is handled below. |
| 177 | NOT_MSVS = $(if $(CONFIG_MSVS),,yes) |
KO Myung-Hun | 2dad8d6 | 2012-02-03 13:31:11 +0900 | [diff] [blame] | 178 | DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX))) |
| 179 | INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX))) |
John Koleszar | ee8bcb1 | 2010-05-24 10:16:44 -0400 | [diff] [blame] | 180 | DIST-SRCS-yes += $(ALL_SRCS) |
| 181 | INSTALL-SRCS-yes += $(UTIL_SRCS) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 182 | OBJS-$(NOT_MSVS) += $(if $(BUILD_OBJS),$(call objs,$(ALL_SRCS))) |
KO Myung-Hun | 2dad8d6 | 2012-02-03 13:31:11 +0900 | [diff] [blame] | 183 | BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX))) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 184 | |
| 185 | |
| 186 | # Instantiate linker template for all examples. |
| 187 | CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx) |
jimbankoski | 45e551b | 2012-07-25 19:39:33 -0700 | [diff] [blame] | 188 | SHARED_LIB_SUF=$(if $(filter darwin%,$(TGT_OS)),.dylib,.so) |
| 189 | CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 190 | $(foreach bin,$(BINS-yes),\ |
James Zern | 495b241 | 2011-07-25 15:40:36 -0700 | [diff] [blame] | 191 | $(if $(BUILD_OBJS),$(eval $(bin):\ |
| 192 | $(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 193 | $(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\ |
KO Myung-Hun | 2dad8d6 | 2012-02-03 13:31:11 +0900 | [diff] [blame] | 194 | $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 195 | -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\ |
| 196 | )))\ |
| 197 | $(if $(LIPO_OBJS),$(eval $(call lipo_bin_template,$(bin))))\ |
| 198 | ) |
| 199 | |
| 200 | |
| 201 | # Rules to generate the GEN_EXAMPLES sources |
| 202 | .PRECIOUS: %.c |
| 203 | CLEAN-OBJS += $(GEN_EXAMPLES) |
| 204 | %.c: examples/%.txt |
| 205 | @echo " [EXAMPLE] $@" |
| 206 | @$(SRC_PATH_BARE)/examples/gen_example_code.sh $< > $@ |
| 207 | |
| 208 | |
| 209 | # The following pairs define a mapping of locations in the distribution |
| 210 | # tree to locations in the source/build trees. |
| 211 | INSTALL_MAPS += src/%.c %.c |
| 212 | INSTALL_MAPS += src/% $(SRC_PATH_BARE)/% |
| 213 | INSTALL_MAPS += bin/% % |
| 214 | INSTALL_MAPS += % % |
| 215 | |
| 216 | |
| 217 | # Set up additional MSVS environment |
| 218 | ifeq ($(CONFIG_MSVS),yes) |
Jim Bankoski | 1b16e74 | 2012-07-23 12:32:59 -0700 | [diff] [blame] | 219 | CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 220 | # This variable uses deferred expansion intentionally, since the results of |
| 221 | # $(wildcard) may change during the course of the Make. |
| 222 | VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d)))) |
| 223 | INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%) |
| 224 | endif |
| 225 | |
| 226 | # Build Visual Studio Projects. We use a template here to instantiate |
| 227 | # explicit rules rather than using an implicit rule because we want to |
| 228 | # leverage make's VPATH searching rather than specifying the paths on |
| 229 | # each file in ALL_EXAMPLES. This has the unfortunate side effect that |
| 230 | # touching the source files trigger a rebuild of the project files |
| 231 | # even though there is no real dependency there (the dependency is on |
| 232 | # the makefiles). We may want to revisit this. |
| 233 | define vcproj_template |
| 234 | $(1): $($(1:.vcproj=).SRCS) |
| 235 | @echo " [vcproj] $$@" |
| 236 | $$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\ |
| 237 | --exe\ |
| 238 | --target=$$(TOOLCHAIN)\ |
| 239 | --name=$$(@:.vcproj=)\ |
| 240 | --ver=$$(CONFIG_VS_VERSION)\ |
| 241 | --proj-guid=$$($$(@:.vcproj=).GUID)\ |
| 242 | $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \ |
Ronald S. Bultje | bbf890f | 2011-05-02 13:56:41 -0400 | [diff] [blame] | 243 | --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \ |
| 244 | $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) -lwinmm $$^ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 245 | endef |
| 246 | PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES:.c=.vcproj) |
| 247 | INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\ |
| 248 | $(addprefix bin/$(p)/,$(ALL_EXAMPLES:.c=.exe))) |
| 249 | $(foreach proj,$(call enabled,PROJECTS),\ |
| 250 | $(eval $(call vcproj_template,$(proj)))) |
| 251 | |
| 252 | |
| 253 | |
| 254 | # |
| 255 | # Documentation Rules |
| 256 | # |
| 257 | %.dox: examples/%.txt |
| 258 | @echo " [DOXY] $@" |
| 259 | @$(SRC_PATH_BARE)/examples/gen_example_text.sh $< | \ |
| 260 | $(SRC_PATH_BARE)/examples/gen_example_doxy.php \ |
| 261 | example_$(@:.dox=) $(@:.dox=.c) > $@ |
| 262 | |
| 263 | %.dox: %.c |
| 264 | @echo " [DOXY] $@" |
| 265 | @echo "/*!\page example_$(@:.dox=) $(@:.dox=)" > $@ |
| 266 | @echo " \includelineno $(notdir $<)" >> $@ |
| 267 | @echo "*/" >> $@ |
| 268 | |
| 269 | samples.dox: examples.mk |
| 270 | @echo " [DOXY] $@" |
| 271 | @echo "/*!\page samples Sample Code" > $@ |
| 272 | @echo " This SDK includes a number of sample applications."\ |
| 273 | "each sample documents a feature of the SDK in both prose"\ |
| 274 | "and the associated C code. In general, later samples"\ |
| 275 | "build upon prior samples, so it is best to work through the"\ |
| 276 | "list in order. The following samples are included: ">>$@ |
| 277 | @$(foreach ex,$(GEN_EXAMPLES:.c=),\ |
| 278 | echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) |
| 279 | @echo >> $@ |
| 280 | @echo " In addition, the SDK contains a number of utilities."\ |
| 281 | "Since these utilities are built upon the concepts described"\ |
| 282 | "in the sample code listed above, they are not documented in"\ |
| 283 | "pieces like the samples are. Thir sourcre is included here"\ |
| 284 | "for reference. The following utilities are included:" >> $@ |
| 285 | @$(foreach ex,$(UTILS:.c=),\ |
| 286 | echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;) |
| 287 | @echo "*/" >> $@ |
| 288 | |
| 289 | CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox) |
| 290 | DOCS-yes += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox) |
| 291 | examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox) |
| 292 | @echo "INPUT += $^" > $@ |