New upstream version 18.02
[deb_dpdk.git] / doc / guides / prog_guide / dev_kit_root_make_help.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2010-2014 Intel Corporation.
3
4 .. _Development_Kit_Root_Makefile_Help:
5
6 Development Kit Root Makefile Help
7 ==================================
8
9 The DPDK provides a root level Makefile with targets for configuration, building, cleaning, testing, installation and others.
10 These targets are explained in the following sections.
11
12 Configuration Targets
13 ---------------------
14
15 The configuration target requires the name of the target, which is specified using T=mytarget and it is mandatory.
16 The list of available targets are in $(RTE_SDK)/config (remove the defconfig _ prefix).
17
18 Configuration targets also support the specification of the name of the output directory, using O=mybuilddir.
19 This is an optional parameter, the default output directory is build.
20
21 *   Config
22
23     This will create a build directory, and generates a configuration from a template.
24     A Makefile is also created in the new build directory.
25
26     Example:
27
28     .. code-block:: console
29
30         make config O=mybuild T=x86_64-native-linuxapp-gcc
31
32 Build Targets
33 -------------
34
35 Build targets support the optional specification of the name of the output directory, using O=mybuilddir.
36 The default output directory is build.
37
38 *   all, build or just make
39
40     Build the DPDK in the output directory previously created by a make config.
41
42     Example:
43
44     .. code-block:: console
45
46         make O=mybuild
47
48 *   clean
49
50     Clean all objects created using make build.
51
52     Example:
53
54     .. code-block:: console
55
56         make clean O=mybuild
57
58 *   %_sub
59
60     Build a subdirectory only, without managing dependencies on other directories.
61
62     Example:
63
64     .. code-block:: console
65
66         make lib/librte_eal_sub O=mybuild
67
68 *   %_clean
69
70     Clean a subdirectory only.
71
72     Example:
73
74     .. code-block:: console
75
76         make lib/librte_eal_clean O=mybuild
77
78 Install Targets
79 ---------------
80
81 *   Install
82
83     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
84
85     The GNU standards variables may be used:
86     http://gnu.org/prep/standards/html_node/Directory-Variables.html and
87     http://gnu.org/prep/standards/html_node/DESTDIR.html
88
89     Example:
90
91     .. code-block:: console
92
93         make install DESTDIR=myinstall prefix=/usr
94
95 Test Targets
96 ------------
97
98 *   test
99
100     Launch automatic tests for a build directory specified using O=mybuilddir.
101     It is optional, the default output directory is build.
102
103     Example:
104
105     .. code-block:: console
106
107         make test O=mybuild
108
109 Documentation Targets
110 ---------------------
111
112 *   doc
113
114     Generate the documentation (API and guides).
115
116 *   doc-api-html
117
118     Generate the Doxygen API documentation in html.
119
120 *   doc-guides-html
121
122     Generate the guides documentation in html.
123
124 *   doc-guides-pdf
125
126     Generate the guides documentation in pdf.
127
128 Misc Targets
129 ------------
130
131 *   help
132
133     Show a quick help.
134
135 Other Useful Command-line Variables
136 -----------------------------------
137
138 The following variables can be specified on the command line:
139
140 *   V=
141
142     Enable verbose build (show full compilation command line, and some intermediate commands).
143
144 *   D=
145
146     Enable dependency debugging. This provides some useful information about why a target is built or not.
147
148 *   EXTRA_CFLAGS=, EXTRA_LDFLAGS=, EXTRA_LDLIBS=, EXTRA_ASFLAGS=, EXTRA_CPPFLAGS=
149
150     Append specific compilation, link or asm flags.
151
152 *   CROSS=
153
154     Specify a cross toolchain header that will prefix all gcc/binutils applications. This only works when using gcc.
155
156 Make in a Build Directory
157 -------------------------
158
159 All targets described above are called from the SDK root $(RTE_SDK).
160 It is possible to run the same Makefile targets inside the build directory.
161 For instance, the following command:
162
163 .. code-block:: console
164
165     cd $(RTE_SDK)
166     make config O=mybuild T=x86_64-native-linuxapp-gcc
167     make O=mybuild
168
169 is equivalent to:
170
171 .. code-block:: console
172
173     cd $(RTE_SDK)
174     make config O=mybuild T=x86_64-native-linuxapp-gcc
175     cd mybuild
176
177     # no need to specify O= now
178     make
179
180 Compiling for Debug
181 -------------------
182
183 To compile the DPDK and sample applications with debugging information included and the optimization level set to 0,
184 the EXTRA_CFLAGS environment variable should be set before compiling as follows:
185
186 .. code-block:: console
187
188     export EXTRA_CFLAGS='-O0 -g'