Check existence of Widevince CDM/Adapter on load failure on Win.
[chromium-blink-merge.git] / native_client_sdk / src / README.Makefiles
blob3d23061f5f87395e3d3fead717546733f0af2a8c
1 Build System for Native Client SDK examples
2 ===========================================
4 The examples and libraries that ship with the Native Client SDK use a
5 build system based on GNU Make.
7 Each example or library is contained in its own directory along with a
8 Makefile. The Makefiles are capable of building Native Client
9 applications and libraries using any of the available toolchains as well
10 as building host applications with the host's toolchain. In order to
11 keep the top-level Makefiles simple, most of actual build rules are
12 specified in as set of shared rules files in the $NACL_SDK_ROOT/tools
13 directory.
15 This document describes some of the variables and macros used by in the
16 build system.  For more details please see the .mk files in the tools
17 folder.
19 Using the build system for new projects
20 --------------------------------------
22 It is perfectly possible to use the included build system for projects
23 outside of the Native Client SDK.  A good starting point for doing this
24 would be to copy the Makefile from the hello_world example.  In most
25 simple cases the only changes needed are to update the SOURCES and
26 TARGET variables.
28 User Variables
29 --------------
31 TARGET
32   This variable holds the name of your project.  Normally this is the
33   basename of the library or executable which is the final target.
35 SOURCES
36   The list of sources to be built.  In most cases this list is passed to
37   the compile and link macros.
39 VALID_TOOLCHAINS
40   This variable can be used to control which toolchains are supported by
41   the project.  Valid entries for this list are: newlib, glibc, pnacl,
42   linux, mac, win.  The default value is: "newlib glibc pnacl".
44 NACL_SDK_ROOT
45   Optionally force the build system to use a certain location for the
46   Native Client SDK. If not set within the Makefile the $NACL_SDK_ROOT
47   environment variable will by used. It is an error if this variable is
48   neither set within the Makefile nor in the environment.
50 Macros / Rules
51 --------------
53 The following macros can be used in the Makefiles to generate the rules
54 for building the various kinds types of target.  These are designed to
55 be used via the 'call' macro.  e.g.  $(call COMPILE_RULE,$(SOURCES))
57 COMPILE_RULE
58   This rule is used to build object files from a list of sources.
60 SO_RULE
61   Used to build shared objects from a list of sources.
63 LIB_RULE
64   Used to build static libraries from a list of sources.
66 NMF_RULE
67   Used to build nmf metadata file from a native client executable (or
68   set of executables). This is needed in order to run the executable in
69   chrome.
71 HTML_RULE
72   Used to build both html and nmf files from a native client executable
73   (or set of executables) which will allow the executable to be run
74   in chrome.
76 For more information on how to use these rules in your Makefile see
77 the shared Makefiles in the tools folders:
79 common.mk
80   Top level shared rules file that include the toolchain specific
81   rules.
83 nacl_gcc.mk
84   Rules for building using the gcc-based NaCl toolchains.
86 nacl_llvm.mk
87   Rules for building using the llvm-based PNaCl toolchains.
89 host_gcc.mk
90   Rules for building using the linux/mac host gcc toolchain.
92 host_vc.mk
93   Rules for building using the windows Visual Studio toolchain.
95 .. vim: ft=rst tw=72