2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
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
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.
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.
31 .. _Development_Kit_Root_Makefile_Help:
33 Development Kit Root Makefile Help
34 ==================================
36 The DPDK provides a root level Makefile with targets for configuration, building, cleaning, testing, installation and others.
37 These targets are explained in the following sections.
42 The configuration target requires the name of the target, which is specified using T=mytarget and it is mandatory.
43 The list of available targets are in $(RTE_SDK)/config (remove the defconfig _ prefix).
45 Configuration targets also support the specification of the name of the output directory, using O=mybuilddir.
46 This is an optional parameter, the default output directory is build.
50 This will create a build directory, and generates a configuration from a template.
51 A Makefile is also created in the new build directory.
55 .. code-block:: console
57 make config O=mybuild T=x86_64-native-linuxapp-gcc
62 Build targets support the optional specification of the name of the output directory, using O=mybuilddir.
63 The default output directory is build.
65 * all, build or just make
67 Build the DPDK in the output directory previously created by a make config.
71 .. code-block:: console
77 Clean all objects created using make build.
81 .. code-block:: console
87 Build a subdirectory only, without managing dependencies on other directories.
91 .. code-block:: console
93 make lib/librte_eal_sub O=mybuild
97 Clean a subdirectory only.
101 .. code-block:: console
103 make lib/librte_eal_clean O=mybuild
110 Build the DPDK binary.
111 Actually, this builds each supported target in a separate directory.
112 The name of each directory is the name of the target.
113 The name of the targets to install can be optionally specified using T=mytarget.
114 The target name can contain wildcard \* characters.
115 The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
119 .. code-block:: console
121 make install T=x86_64-*
125 Remove installed target directories.
132 Launch automatic tests for a build directory specified using O=mybuilddir.
133 It is optional, the default output directory is build.
137 .. code-block:: console
143 Launch automatic tests for all installed target directories (after a make install).
144 The name of the targets to test can be optionally specified using T=mytarget.
145 The target name can contain wildcard (\*) characters.
146 The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
150 .. code-block:: console
152 make testall, make testall T=x86_64-*
154 Documentation Targets
155 ---------------------
159 Generate the Doxygen documentation (API, html and pdf).
163 Generate the Doxygen API documentation in html.
167 Generate the guides documentation in html.
171 Generate the guides documentation in pdf.
179 This target is implicitly called by make config.
180 Typically, there is no need for a user to call it,
181 except if DEPDIRS-y variables have been updated in Makefiles.
182 It will generate the file $(RTE_OUTPUT)/.depdirs.
186 .. code-block:: console
188 make depdirs O=mybuild
192 This command generates a dot graph of dependencies.
193 It can be displayed to debug circular dependency issues, or just to understand the dependencies.
197 .. code-block:: console
199 make depgraph O=mybuild > /tmp/graph.dot && dotty /tmp/ graph.dot
208 Other Useful Command-line Variables
209 -----------------------------------
211 The following variables can be specified on the command line:
215 Enable verbose build (show full compilation command line, and some intermediate commands).
219 Enable dependency debugging. This provides some useful information about why a target is built or not.
221 * EXTRA_CFLAGS=, EXTRA_LDFLAGS=, EXTRA_LDLIBS=, EXTRA_ASFLAGS=, EXTRA_CPPFLAGS=
223 Append specific compilation, link or asm flags.
227 Specify a cross toolchain header that will prefix all gcc/binutils applications. This only works when using gcc.
229 Make in a Build Directory
230 -------------------------
232 All targets described above are called from the SDK root $(RTE_SDK).
233 It is possible to run the same Makefile targets inside the build directory.
234 For instance, the following command:
236 .. code-block:: console
239 make config O=mybuild T=x86_64-native-linuxapp-gcc
244 .. code-block:: console
247 make config O=mybuild T=x86_64-native-linuxapp-gcc
250 # no need to specify O= now
256 To compile the DPDK and sample applications with debugging information included and the optimization level set to 0,
257 the EXTRA_CFLAGS environment variable should be set before compiling as follows:
259 .. code-block:: console
261 export EXTRA_CFLAGS='-O0 -g'
263 The DPDK and any user or sample applications can then be compiled in the usual way.
266 .. code-block:: console
268 make install T=x86_64-native-linuxapp-gcc make -C examples/<theapp>