ext_app_lib_make_help.rst revision 97f17497
1..  BSD LICENSE
2    Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
3    All rights reserved.
4
5    Redistribution and use in source and binary forms, with or without
6    modification, are permitted provided that the following conditions
7    are met:
8
9    * Redistributions of source code must retain the above copyright
10    notice, this list of conditions and the following disclaimer.
11    * Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in
13    the documentation and/or other materials provided with the
14    distribution.
15    * Neither the name of Intel Corporation nor the names of its
16    contributors may be used to endorse or promote products derived
17    from this software without specific prior written permission.
18
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31.. _External_Application/Library_Makefile_help:
32
33External Application/Library Makefile help
34==========================================
35
36External applications or libraries should include specific Makefiles from RTE_SDK, located in mk directory.
37These Makefiles are:
38
39*   ${RTE_SDK}/mk/rte.extapp.mk: Build an application
40
41*   ${RTE_SDK}/mk/rte.extlib.mk: Build a static library
42
43*   ${RTE_SDK}/mk/rte.extobj.mk: Build objects (.o)
44
45Prerequisites
46-------------
47
48The following variables must be defined:
49
50*   ${RTE_SDK}: Points to the root directory of the DPDK.
51
52*   ${RTE_TARGET}: Reference the target to be used for compilation (for example, x86_64-native-linuxapp-gcc).
53
54Build Targets
55-------------
56
57Build targets support the specification of the name of the output directory, using O=mybuilddir.
58This is optional; the default output directory is build.
59
60*   all, "nothing" (meaning just make)
61
62    Build the application or the library in the specified output directory.
63
64    Example:
65
66    .. code-block:: console
67
68        make O=mybuild
69
70*   clean
71
72    Clean all objects created using make build.
73
74    Example:
75
76    .. code-block:: console
77
78        make clean O=mybuild
79
80Help Targets
81------------
82
83*   help
84
85    Show this help.
86
87Other Useful Command-line Variables
88-----------------------------------
89
90The following variables can be specified at the command line:
91
92*   S=
93
94    Specify the directory in which the sources are located. By default, it is the current directory.
95
96*   M=
97
98    Specify the Makefile to call once the output directory is created. By default, it uses $(S)/Makefile.
99
100*   V=
101
102    Enable verbose build (show full compilation command line and some intermediate commands).
103
104*   D=
105
106    Enable dependency debugging. This provides some useful information about why a target must be rebuilt or not.
107
108*   EXTRA_CFLAGS=, EXTRA_LDFLAGS=, EXTRA_ASFLAGS=, EXTRA_CPPFLAGS=
109
110    Append specific compilation, link or asm flags.
111
112*   CROSS=
113
114    Specify a cross-toolchain header that will prefix all gcc/binutils applications. This only works when using gcc.
115
116Make from Another Directory
117---------------------------
118
119It is possible to run the Makefile from another directory, by specifying the output and the source dir. For example:
120
121.. code-block:: console
122
123    export RTE_SDK=/path/to/DPDK
124    export RTE_TARGET=x86_64-native-linuxapp-icc
125    make -f /path/to/my_app/Makefile S=/path/to/my_app O=/path/to/build_dir
126