examples.mk 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. ##
  2. ## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. ##
  4. ## Use of this source code is governed by a BSD-style license
  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
  7. ## in the file PATENTS. All contributing project authors may
  8. ## be found in the AUTHORS file in the root of the source tree.
  9. ##
  10. LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
  11. third_party/libyuv/include/libyuv/convert.h \
  12. third_party/libyuv/include/libyuv/convert_argb.h \
  13. third_party/libyuv/include/libyuv/convert_from.h \
  14. third_party/libyuv/include/libyuv/cpu_id.h \
  15. third_party/libyuv/include/libyuv/planar_functions.h \
  16. third_party/libyuv/include/libyuv/rotate.h \
  17. third_party/libyuv/include/libyuv/row.h \
  18. third_party/libyuv/include/libyuv/scale.h \
  19. third_party/libyuv/include/libyuv/scale_row.h \
  20. third_party/libyuv/source/cpu_id.cc \
  21. third_party/libyuv/source/planar_functions.cc \
  22. third_party/libyuv/source/row_any.cc \
  23. third_party/libyuv/source/row_common.cc \
  24. third_party/libyuv/source/row_gcc.cc \
  25. third_party/libyuv/source/row_mips.cc \
  26. third_party/libyuv/source/row_neon.cc \
  27. third_party/libyuv/source/row_neon64.cc \
  28. third_party/libyuv/source/row_win.cc \
  29. third_party/libyuv/source/scale.cc \
  30. third_party/libyuv/source/scale_any.cc \
  31. third_party/libyuv/source/scale_common.cc \
  32. third_party/libyuv/source/scale_gcc.cc \
  33. third_party/libyuv/source/scale_mips.cc \
  34. third_party/libyuv/source/scale_neon.cc \
  35. third_party/libyuv/source/scale_neon64.cc \
  36. third_party/libyuv/source/scale_win.cc \
  37. LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \
  38. third_party/libwebm/common/hdr_util.h \
  39. third_party/libwebm/common/webmids.h
  40. LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \
  41. third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \
  42. third_party/libwebm/mkvmuxer/mkvwriter.cc \
  43. third_party/libwebm/mkvmuxer/mkvmuxer.h \
  44. third_party/libwebm/mkvmuxer/mkvmuxertypes.h \
  45. third_party/libwebm/mkvmuxer/mkvmuxerutil.h \
  46. third_party/libwebm/mkvparser/mkvparser.h \
  47. third_party/libwebm/mkvmuxer/mkvwriter.h
  48. LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
  49. third_party/libwebm/mkvparser/mkvreader.cc \
  50. third_party/libwebm/mkvparser/mkvparser.h \
  51. third_party/libwebm/mkvparser/mkvreader.h
  52. # Add compile flags and include path for libwebm sources.
  53. ifeq ($(CONFIG_WEBM_IO),yes)
  54. CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
  55. INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
  56. endif
  57. # List of examples to build. UTILS are tools meant for distribution
  58. # while EXAMPLES demonstrate specific portions of the API.
  59. UTILS-$(CONFIG_DECODERS) += vpxdec.c
  60. vpxdec.SRCS += md5_utils.c md5_utils.h
  61. vpxdec.SRCS += vpx_ports/mem_ops.h
  62. vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
  63. vpxdec.SRCS += vpx_ports/msvc.h
  64. vpxdec.SRCS += vpx_ports/vpx_timer.h
  65. vpxdec.SRCS += vpx/vpx_integer.h
  66. vpxdec.SRCS += args.c args.h
  67. vpxdec.SRCS += ivfdec.c ivfdec.h
  68. vpxdec.SRCS += tools_common.c tools_common.h
  69. vpxdec.SRCS += y4menc.c y4menc.h
  70. ifeq ($(CONFIG_LIBYUV),yes)
  71. vpxdec.SRCS += $(LIBYUV_SRCS)
  72. $(BUILD_PFX)third_party/libyuv/%.cc.o: CXXFLAGS += -Wno-unused-parameter
  73. endif
  74. ifeq ($(CONFIG_WEBM_IO),yes)
  75. vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
  76. vpxdec.SRCS += $(LIBWEBM_MUXER_SRCS)
  77. vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
  78. vpxdec.SRCS += webmdec.cc webmdec.h
  79. endif
  80. vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
  81. vpxdec.DESCRIPTION = Full featured decoder
  82. UTILS-$(CONFIG_ENCODERS) += vpxenc.c
  83. vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h
  84. vpxenc.SRCS += ivfdec.c ivfdec.h
  85. vpxenc.SRCS += ivfenc.c ivfenc.h
  86. vpxenc.SRCS += rate_hist.c rate_hist.h
  87. vpxenc.SRCS += tools_common.c tools_common.h
  88. vpxenc.SRCS += warnings.c warnings.h
  89. vpxenc.SRCS += vpx_ports/mem_ops.h
  90. vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
  91. vpxenc.SRCS += vpx_ports/msvc.h
  92. vpxenc.SRCS += vpx_ports/vpx_timer.h
  93. vpxenc.SRCS += vpxstats.c vpxstats.h
  94. ifeq ($(CONFIG_LIBYUV),yes)
  95. vpxenc.SRCS += $(LIBYUV_SRCS)
  96. endif
  97. ifeq ($(CONFIG_WEBM_IO),yes)
  98. vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
  99. vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
  100. vpxenc.SRCS += $(LIBWEBM_PARSER_SRCS)
  101. vpxenc.SRCS += webmenc.cc webmenc.h
  102. endif
  103. vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
  104. vpxenc.DESCRIPTION = Full featured encoder
  105. ifeq ($(CONFIG_SPATIAL_SVC),yes)
  106. EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_svc_encoder.c
  107. vp9_spatial_svc_encoder.SRCS += args.c args.h
  108. vp9_spatial_svc_encoder.SRCS += ivfenc.c ivfenc.h
  109. vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
  110. vp9_spatial_svc_encoder.SRCS += video_common.h
  111. vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
  112. vp9_spatial_svc_encoder.SRCS += vpx_ports/msvc.h
  113. vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
  114. vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
  115. vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
  116. endif
  117. ifneq ($(CONFIG_SHARED),yes)
  118. EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c
  119. endif
  120. EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_svc_encoder.c
  121. vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h
  122. vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h
  123. vpx_temporal_svc_encoder.SRCS += video_common.h
  124. vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c
  125. vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h
  126. vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
  127. vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
  128. EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
  129. simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
  130. simple_decoder.SRCS += ivfdec.h ivfdec.c
  131. simple_decoder.SRCS += tools_common.h tools_common.c
  132. simple_decoder.SRCS += video_common.h
  133. simple_decoder.SRCS += video_reader.h video_reader.c
  134. simple_decoder.SRCS += vpx_ports/mem_ops.h
  135. simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
  136. simple_decoder.SRCS += vpx_ports/msvc.h
  137. simple_decoder.DESCRIPTION = Simplified decoder loop
  138. EXAMPLES-$(CONFIG_DECODERS) += postproc.c
  139. postproc.SRCS += ivfdec.h ivfdec.c
  140. postproc.SRCS += tools_common.h tools_common.c
  141. postproc.SRCS += video_common.h
  142. postproc.SRCS += video_reader.h video_reader.c
  143. postproc.SRCS += vpx_ports/mem_ops.h
  144. postproc.SRCS += vpx_ports/mem_ops_aligned.h
  145. postproc.SRCS += vpx_ports/msvc.h
  146. postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
  147. postproc.DESCRIPTION = Decoder postprocessor control
  148. EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
  149. decode_to_md5.SRCS += md5_utils.h md5_utils.c
  150. decode_to_md5.SRCS += ivfdec.h ivfdec.c
  151. decode_to_md5.SRCS += tools_common.h tools_common.c
  152. decode_to_md5.SRCS += video_common.h
  153. decode_to_md5.SRCS += video_reader.h video_reader.c
  154. decode_to_md5.SRCS += vpx_ports/mem_ops.h
  155. decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
  156. decode_to_md5.SRCS += vpx_ports/msvc.h
  157. decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
  158. decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
  159. EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
  160. simple_encoder.SRCS += ivfenc.h ivfenc.c
  161. simple_encoder.SRCS += tools_common.h tools_common.c
  162. simple_encoder.SRCS += video_common.h
  163. simple_encoder.SRCS += video_writer.h video_writer.c
  164. simple_encoder.SRCS += vpx_ports/msvc.h
  165. simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
  166. simple_encoder.DESCRIPTION = Simplified encoder loop
  167. EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c
  168. vp9_lossless_encoder.SRCS += ivfenc.h ivfenc.c
  169. vp9_lossless_encoder.SRCS += tools_common.h tools_common.c
  170. vp9_lossless_encoder.SRCS += video_common.h
  171. vp9_lossless_encoder.SRCS += video_writer.h video_writer.c
  172. vp9_lossless_encoder.SRCS += vpx_ports/msvc.h
  173. vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
  174. vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
  175. EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
  176. twopass_encoder.SRCS += ivfenc.h ivfenc.c
  177. twopass_encoder.SRCS += tools_common.h tools_common.c
  178. twopass_encoder.SRCS += video_common.h
  179. twopass_encoder.SRCS += video_writer.h video_writer.c
  180. twopass_encoder.SRCS += vpx_ports/msvc.h
  181. twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
  182. twopass_encoder.DESCRIPTION = Two-pass encoder loop
  183. EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
  184. decode_with_drops.SRCS += ivfdec.h ivfdec.c
  185. decode_with_drops.SRCS += tools_common.h tools_common.c
  186. decode_with_drops.SRCS += video_common.h
  187. decode_with_drops.SRCS += video_reader.h video_reader.c
  188. decode_with_drops.SRCS += vpx_ports/mem_ops.h
  189. decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
  190. decode_with_drops.SRCS += vpx_ports/msvc.h
  191. decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
  192. decode_with_drops.DESCRIPTION = Drops frames while decoding
  193. EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
  194. set_maps.SRCS += ivfenc.h ivfenc.c
  195. set_maps.SRCS += tools_common.h tools_common.c
  196. set_maps.SRCS += video_common.h
  197. set_maps.SRCS += video_writer.h video_writer.c
  198. set_maps.SRCS += vpx_ports/msvc.h
  199. set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
  200. set_maps.DESCRIPTION = Set active and ROI maps
  201. EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
  202. vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c
  203. vp8cx_set_ref.SRCS += tools_common.h tools_common.c
  204. vp8cx_set_ref.SRCS += video_common.h
  205. vp8cx_set_ref.SRCS += video_writer.h video_writer.c
  206. vp8cx_set_ref.SRCS += vpx_ports/msvc.h
  207. vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
  208. vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
  209. ifeq ($(CONFIG_VP9_ENCODER),yes)
  210. ifeq ($(CONFIG_DECODERS),yes)
  211. EXAMPLES-yes += vp9cx_set_ref.c
  212. vp9cx_set_ref.SRCS += ivfenc.h ivfenc.c
  213. vp9cx_set_ref.SRCS += tools_common.h tools_common.c
  214. vp9cx_set_ref.SRCS += video_common.h
  215. vp9cx_set_ref.SRCS += video_writer.h video_writer.c
  216. vp9cx_set_ref.GUID = 65D7F14A-2EE6-4293-B958-AB5107A03B55
  217. vp9cx_set_ref.DESCRIPTION = VP9 set encoder reference frame
  218. endif
  219. endif
  220. ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
  221. ifeq ($(CONFIG_LIBYUV),yes)
  222. EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_multi_resolution_encoder.c
  223. vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c
  224. vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c
  225. vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c
  226. vp8_multi_resolution_encoder.SRCS += vpx_ports/msvc.h
  227. vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
  228. vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
  229. vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
  230. endif
  231. endif
  232. # Handle extra library flags depending on codec configuration
  233. # We should not link to math library (libm) on RVCT
  234. # when building for bare-metal targets
  235. ifeq ($(CONFIG_OS_SUPPORT), yes)
  236. CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m
  237. CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m
  238. else
  239. ifeq ($(CONFIG_GCC), yes)
  240. CODEC_EXTRA_LIBS-$(CONFIG_VP8) += m
  241. CODEC_EXTRA_LIBS-$(CONFIG_VP9) += m
  242. endif
  243. endif
  244. #
  245. # End of specified files. The rest of the build rules should happen
  246. # automagically from here.
  247. #
  248. # Examples need different flags based on whether we're building
  249. # from an installed tree or a version controlled tree. Determine
  250. # the proper paths.
  251. ifeq ($(HAVE_ALT_TREE_LAYOUT),yes)
  252. LIB_PATH-yes := $(SRC_PATH_BARE)/../lib
  253. INC_PATH-yes := $(SRC_PATH_BARE)/../include
  254. else
  255. LIB_PATH-yes += $(if $(BUILD_PFX),$(BUILD_PFX),.)
  256. INC_PATH-$(CONFIG_VP8_DECODER) += $(SRC_PATH_BARE)/vp8
  257. INC_PATH-$(CONFIG_VP8_ENCODER) += $(SRC_PATH_BARE)/vp8
  258. INC_PATH-$(CONFIG_VP9_DECODER) += $(SRC_PATH_BARE)/vp9
  259. INC_PATH-$(CONFIG_VP9_ENCODER) += $(SRC_PATH_BARE)/vp9
  260. endif
  261. INC_PATH-$(CONFIG_LIBYUV) += $(SRC_PATH_BARE)/third_party/libyuv/include
  262. LIB_PATH := $(call enabled,LIB_PATH)
  263. INC_PATH := $(call enabled,INC_PATH)
  264. INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH))
  265. INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
  266. # Expand list of selected examples to build (as specified above)
  267. UTILS = $(call enabled,UTILS)
  268. EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES))
  269. ALL_EXAMPLES = $(UTILS) $(EXAMPLES)
  270. UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
  271. ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
  272. CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
  273. # Expand all example sources into a variable containing all sources
  274. # for that example (not just them main one specified in UTILS/EXAMPLES)
  275. # and add this file to the list (for MSVS workspace generation)
  276. $(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
  277. # Create build/install dependencies for all examples. The common case
  278. # is handled here. The MSVS case is handled below.
  279. NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
  280. DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
  281. INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
  282. DIST-SRCS-yes += $(ALL_SRCS)
  283. INSTALL-SRCS-yes += $(UTIL_SRCS)
  284. OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS))
  285. BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
  286. # Instantiate linker template for all examples.
  287. CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
  288. ifneq ($(filter darwin%,$(TGT_OS)),)
  289. SHARED_LIB_SUF=.dylib
  290. else
  291. ifneq ($(filter os2%,$(TGT_OS)),)
  292. SHARED_LIB_SUF=_dll.a
  293. else
  294. SHARED_LIB_SUF=.so
  295. endif
  296. endif
  297. CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
  298. $(foreach bin,$(BINS-yes),\
  299. $(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
  300. $(eval $(call linker_template,$(bin),\
  301. $(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
  302. -l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
  303. )))
  304. # The following pairs define a mapping of locations in the distribution
  305. # tree to locations in the source/build trees.
  306. INSTALL_MAPS += src/%.c %.c
  307. INSTALL_MAPS += src/% $(SRC_PATH_BARE)/%
  308. INSTALL_MAPS += bin/% %
  309. INSTALL_MAPS += % %
  310. # Set up additional MSVS environment
  311. ifeq ($(CONFIG_MSVS),yes)
  312. CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd))
  313. # This variable uses deferred expansion intentionally, since the results of
  314. # $(wildcard) may change during the course of the Make.
  315. VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
  316. INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),bin/$(p)/% $(p)/Release/%)
  317. endif
  318. # Build Visual Studio Projects. We use a template here to instantiate
  319. # explicit rules rather than using an implicit rule because we want to
  320. # leverage make's VPATH searching rather than specifying the paths on
  321. # each file in ALL_EXAMPLES. This has the unfortunate side effect that
  322. # touching the source files trigger a rebuild of the project files
  323. # even though there is no real dependency there (the dependency is on
  324. # the makefiles). We may want to revisit this.
  325. define vcproj_template
  326. $(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
  327. $(if $(quiet),@echo " [vcproj] $$@")
  328. $(qexec)$$(GEN_VCPROJ)\
  329. --exe\
  330. --target=$$(TOOLCHAIN)\
  331. --name=$$(@:.$(VCPROJ_SFX)=)\
  332. --ver=$$(CONFIG_VS_VERSION)\
  333. --proj-guid=$$($$(@:.$(VCPROJ_SFX)=).GUID)\
  334. --src-path-bare="$(SRC_PATH_BARE)" \
  335. $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
  336. --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
  337. $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
  338. endef
  339. ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
  340. PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
  341. INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
  342. $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
  343. $(foreach proj,$(call enabled,PROJECTS),\
  344. $(eval $(call vcproj_template,$(proj))))
  345. #
  346. # Documentation Rules
  347. #
  348. %.dox: %.c
  349. @echo " [DOXY] $@"
  350. @mkdir -p $(dir $@)
  351. @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@
  352. @echo " \includelineno $(<F)" >> $@
  353. @echo "*/" >> $@
  354. samples.dox: examples.mk
  355. @echo " [DOXY] $@"
  356. @echo "/*!\page samples Sample Code" > $@
  357. @echo " This SDK includes a number of sample applications."\
  358. "Each sample documents a feature of the SDK in both prose"\
  359. "and the associated C code."\
  360. "The following samples are included: ">>$@
  361. @$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\
  362. echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
  363. @echo >> $@
  364. @echo " In addition, the SDK contains a number of utilities."\
  365. "Since these utilities are built upon the concepts described"\
  366. "in the sample code listed above, they are not documented in"\
  367. "pieces like the samples are. Their source is included here"\
  368. "for reference. The following utilities are included:" >> $@
  369. @$(foreach ex,$(sort $(UTILS:.c=)),\
  370. echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
  371. @echo "*/" >> $@
  372. CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
  373. DOCS-yes += examples.doxy samples.dox
  374. examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
  375. @echo "INPUT += $^" > $@