summaryrefslogtreecommitdiffstats
path: root/documentation/sdk-manual
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/sdk-manual')
-rw-r--r--documentation/sdk-manual/appendix-customizing-standard.rst34
-rw-r--r--documentation/sdk-manual/appendix-customizing.rst358
-rw-r--r--documentation/sdk-manual/appendix-obtain.rst306
-rw-r--r--documentation/sdk-manual/extensible.rst362
-rw-r--r--documentation/sdk-manual/figures/sdk-autotools-flow.pngbin50443 -> 0 bytes
-rw-r--r--documentation/sdk-manual/figures/sdk-environment.pngbin42098 -> 0 bytes
-rw-r--r--documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.pngbin66753 -> 0 bytes
-rw-r--r--documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.pngbin39099 -> 0 bytes
-rw-r--r--documentation/sdk-manual/figures/sdk-makefile-flow.pngbin47197 -> 0 bytes
-rw-r--r--documentation/sdk-manual/figures/sdk-title.pngbin31039 -> 0 bytes
-rw-r--r--documentation/sdk-manual/index.rst21
-rw-r--r--documentation/sdk-manual/intro.rst208
-rw-r--r--documentation/sdk-manual/using.rst147
-rw-r--r--documentation/sdk-manual/working-projects.rst404
14 files changed, 0 insertions, 1840 deletions
diff --git a/documentation/sdk-manual/appendix-customizing-standard.rst b/documentation/sdk-manual/appendix-customizing-standard.rst
deleted file mode 100644
index c619c15e46..0000000000
--- a/documentation/sdk-manual/appendix-customizing-standard.rst
+++ /dev/null
@@ -1,34 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3****************************
4Customizing the Standard SDK
5****************************
6
7This appendix presents customizations you can apply to the standard SDK.
8
9Adding Individual Packages to the Standard SDK
10==============================================
11
12When you build a standard SDK using the ``bitbake -c populate_sdk``, a
13default set of packages is included in the resulting SDK. The
14:term:`TOOLCHAIN_HOST_TASK`
15and
16:term:`TOOLCHAIN_TARGET_TASK`
17variables control the set of packages adding to the SDK.
18
19If you want to add individual packages to the toolchain that runs on the
20host, simply add those packages to the :term:`TOOLCHAIN_HOST_TASK` variable.
21Similarly, if you want to add packages to the default set that is part
22of the toolchain that runs on the target, add the packages to the
23:term:`TOOLCHAIN_TARGET_TASK` variable.
24
25Adding API Documentation to the Standard SDK
26============================================
27
28You can include API documentation as well as any other documentation
29provided by recipes with the standard SDK by adding "api-documentation"
30to the
31:term:`DISTRO_FEATURES`
32variable: DISTRO_FEATURES:append = " api-documentation" Setting this
33variable as shown here causes the OpenEmbedded build system to build the
34documentation and then include it in the standard SDK.
diff --git a/documentation/sdk-manual/appendix-customizing.rst b/documentation/sdk-manual/appendix-customizing.rst
deleted file mode 100644
index e08630dce0..0000000000
--- a/documentation/sdk-manual/appendix-customizing.rst
+++ /dev/null
@@ -1,358 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3***************************************************
4Customizing the Extensible SDK standalone installer
5***************************************************
6
7This appendix describes customizations you can apply to the extensible
8SDK when using in the standalone installer version.
9
10.. note::
11
12 It is also possible to use the Extensible SDK functionality directly in a
13 Yocto build, avoiding separate installer artefacts. Please refer to
14 ":ref:`sdk-manual/extensible:Installing the Extensible SDK`"
15
16Configuring the Extensible SDK
17==============================
18
19The extensible SDK primarily consists of a pre-configured copy of the
20OpenEmbedded build system from which it was produced. Thus, the SDK's
21configuration is derived using that build system and the filters shown
22in the following list. When these filters are present, the OpenEmbedded
23build system applies them against ``local.conf`` and ``auto.conf``:
24
25- Variables whose values start with "/" are excluded since the
26 assumption is that those values are paths that are likely to be
27 specific to the :term:`Build Host`.
28
29- Variables listed in
30 :term:`ESDK_LOCALCONF_REMOVE`
31 are excluded. These variables are not allowed through from the
32 OpenEmbedded build system configuration into the extensible SDK
33 configuration. Typically, these variables are specific to the machine
34 on which the build system is running and could be problematic as part
35 of the extensible SDK configuration.
36
37 For a list of the variables excluded by default, see the
38 :term:`ESDK_LOCALCONF_REMOVE`
39 in the glossary of the Yocto Project Reference Manual.
40
41- Variables listed in
42 :term:`ESDK_LOCALCONF_ALLOW`
43 are included. Including a variable in the value of
44 :term:`ESDK_LOCALCONF_ALLOW` overrides either of the previous two
45 filters. The default value is blank.
46
47- Classes inherited globally with :term:`INHERIT` that are listed in
48 :term:`ESDK_CLASS_INHERIT_DISABLE` are disabled. Using
49 :term:`ESDK_CLASS_INHERIT_DISABLE` to disable these classes is the typical
50 method to disable classes that are problematic or unnecessary in the SDK
51 context. The default value disables the :ref:`ref-classes-buildhistory`
52 class.
53
54Additionally, the contents of ``conf/sdk-extra.conf``, when present, are
55appended to the end of ``conf/local.conf`` within the produced SDK,
56without any filtering. The ``sdk-extra.conf`` file is particularly
57useful if you want to set a variable value just for the SDK and not the
58OpenEmbedded build system used to create the SDK.
59
60Adjusting the Extensible SDK to Suit Your Build Host's Setup
61============================================================
62
63In most cases, the extensible SDK defaults should work with your :term:`Build
64Host`'s setup. However, there are cases when you might consider making
65adjustments:
66
67- If your SDK configuration inherits additional classes using the
68 :term:`INHERIT` variable and you
69 do not need or want those classes enabled in the SDK, you can
70 disable them by adding them to the :term:`ESDK_CLASS_INHERIT_DISABLE`
71 variable as described in the previous section.
72
73 .. note::
74
75 The default value of :term:`ESDK_CLASS_INHERIT_DISABLE`
76 is set using the "?=" operator. Consequently, you will need to
77 either define the entire list by using the "=" operator, or you
78 will need to append a value using either ":append" or the "+="
79 operator. You can learn more about these operators in the
80 ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:basic syntax`"
81 section of the BitBake User Manual.
82
83- If you have classes or recipes that add additional tasks to the
84 standard build flow (i.e. the tasks execute as the recipe builds as
85 opposed to being called explicitly), then you need to do one of the
86 following:
87
88 - After ensuring the tasks are :ref:`shared
89 state <overview-manual/concepts:shared state cache>` tasks (i.e. the
90 output of the task is saved to and can be restored from the shared
91 state cache) or ensuring the tasks are able to be produced quickly
92 from a task that is a shared state task, add the task name to the
93 value of
94 :term:`SDK_RECRDEP_TASKS`.
95
96 - Disable the tasks if they are added by a class and you do not need
97 the functionality the class provides in the extensible SDK. To
98 disable the tasks, add the class to the :term:`ESDK_CLASS_INHERIT_DISABLE`
99 variable as described in the previous section.
100
101- Generally, you want to have a shared state mirror set up so users of
102 the SDK can add additional items to the SDK after installation
103 without needing to build the items from source. See the
104 ":ref:`sdk-manual/appendix-customizing:providing additional installable extensible sdk content`"
105 section for information.
106
107- If you want users of the SDK to be able to easily update the SDK, you
108 need to set the
109 :term:`SDK_UPDATE_URL`
110 variable. For more information, see the
111 ":ref:`sdk-manual/appendix-customizing:providing updates to the extensible sdk after installation`"
112 section.
113
114- If you have adjusted the list of files and directories that appear in
115 :term:`COREBASE` (other than
116 layers that are enabled through ``bblayers.conf``), then you must
117 list these files in
118 :term:`COREBASE_FILES` so
119 that the files are copied into the SDK.
120
121- If your OpenEmbedded build system setup uses a different environment
122 setup script other than
123 :ref:`structure-core-script`, then you must
124 set
125 :term:`OE_INIT_ENV_SCRIPT`
126 to point to the environment setup script you use.
127
128 .. note::
129
130 You must also reflect this change in the value used for the
131 :term:`COREBASE_FILES` variable as previously described.
132
133Changing the Extensible SDK Installer Title
134===========================================
135
136You can change the displayed title for the SDK installer by setting the
137:term:`SDK_TITLE` variable and then
138rebuilding the SDK installer. For information on how to build an SDK
139installer, see the ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
140section.
141
142By default, this title is derived from
143:term:`DISTRO_NAME` when it is
144set. If the :term:`DISTRO_NAME` variable is not set, the title is derived
145from the :term:`DISTRO` variable.
146
147The
148:ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
149class defines the default value of the :term:`SDK_TITLE` variable as
150follows::
151
152 SDK_TITLE ??= "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} SDK"
153
154While there are several ways of changing this variable, an efficient method is
155to set the variable in your distribution's configuration file. Doing so
156creates an SDK installer title that applies across your distribution. As
157an example, assume you have your own layer for your distribution named
158"meta-mydistro" and you are using the same type of file hierarchy as
159does the default "poky" distribution. If so, you could update the
160:term:`SDK_TITLE` variable in the
161``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following
162form::
163
164 SDK_TITLE = "your_title"
165
166Providing Updates to the Extensible SDK After Installation
167==========================================================
168
169When you make changes to your configuration or to the metadata and if
170you want those changes to be reflected in installed SDKs, you need to
171perform additional steps. These steps make it possible for anyone using
172the installed SDKs to update the installed SDKs by using the
173``devtool sdk-update`` command:
174
175#. Create a directory that can be shared over HTTP or HTTPS. You can do
176 this by setting up a web server such as an :wikipedia:`Apache HTTP Server
177 <Apache_HTTP_Server>` or :wikipedia:`Nginx <Nginx>` server in the cloud
178 to host the directory. This directory must contain the published SDK.
179
180#. Set the
181 :term:`SDK_UPDATE_URL`
182 variable to point to the corresponding HTTP or HTTPS URL. Setting
183 this variable causes any SDK built to default to that URL and thus,
184 the user does not have to pass the URL to the ``devtool sdk-update``
185 command as described in the
186 ":ref:`sdk-manual/extensible:applying updates to an installed extensible sdk`"
187 section.
188
189#. Build the extensible SDK normally (i.e., use the
190 ``bitbake -c populate_sdk_ext`` imagename command).
191
192#. Publish the SDK using the following command::
193
194 $ oe-publish-sdk some_path/sdk-installer.sh path_to_shared_http_directory
195
196 You must
197 repeat this step each time you rebuild the SDK with changes that you
198 want to make available through the update mechanism.
199
200Completing the above steps allows users of the existing installed SDKs
201to simply run ``devtool sdk-update`` to retrieve and apply the latest
202updates. See the
203":ref:`sdk-manual/extensible:applying updates to an installed extensible sdk`"
204section for further information.
205
206Changing the Default SDK Installation Directory
207===============================================
208
209When you build the installer for the Extensible SDK, the default
210installation directory for the SDK is based on the
211:term:`DISTRO` and
212:term:`SDKEXTPATH` variables from
213within the
214:ref:`populate_sdk_base <ref-classes-populate-sdk-*>`
215class as follows::
216
217 SDKEXTPATH ??= "~/${@d.getVar('DISTRO')}_sdk"
218
219You can
220change this default installation directory by specifically setting the
221:term:`SDKEXTPATH` variable.
222
223While there are several ways of setting this variable,
224the method that makes the most sense is to set the variable in your
225distribution's configuration file. Doing so creates an SDK installer
226default directory that applies across your distribution. As an example,
227assume you have your own layer for your distribution named
228"meta-mydistro" and you are using the same type of file hierarchy as
229does the default "poky" distribution. If so, you could update the
230:term:`SDKEXTPATH` variable in the
231``~/meta-mydistro/conf/distro/mydistro.conf`` file using the following
232form::
233
234 SDKEXTPATH = "some_path_for_your_installed_sdk"
235
236After building your installer, running it prompts the user for
237acceptance of the some_path_for_your_installed_sdk directory as the
238default location to install the Extensible SDK.
239
240Providing Additional Installable Extensible SDK Content
241=======================================================
242
243If you want the users of an extensible SDK you build to be able to add
244items to the SDK without requiring the users to build the items from
245source, you need to do a number of things:
246
247#. Ensure the additional items you want the user to be able to install
248 are already built:
249
250 - Build the items explicitly. You could use one or more "meta"
251 recipes that depend on lists of other recipes.
252
253 - Build the "world" target and set
254 ``EXCLUDE_FROM_WORLD:pn-``\ recipename for the recipes you do not
255 want built. See the
256 :term:`EXCLUDE_FROM_WORLD`
257 variable for additional information.
258
259#. Expose the ``sstate-cache`` directory produced by the build.
260 Typically, you expose this directory by making it available through
261 an :wikipedia:`Apache HTTP Server <Apache_HTTP_Server>` or
262 :wikipedia:`Nginx <Nginx>` server.
263
264#. Set the appropriate configuration so that the produced SDK knows how
265 to find the configuration. The variable you need to set is
266 :term:`SSTATE_MIRRORS`::
267
268 SSTATE_MIRRORS = "file://.* https://example.com/some_path/sstate-cache/PATH"
269
270 You can set the :term:`SSTATE_MIRRORS` variable in two different places:
271
272 - If the mirror value you are setting is appropriate to be set for
273 both the OpenEmbedded build system that is actually building the
274 SDK and the SDK itself (i.e. the mirror is accessible in both
275 places or it will fail quickly on the OpenEmbedded build system
276 side, and its contents will not interfere with the build), then
277 you can set the variable in your ``local.conf`` or custom distro
278 configuration file. You can then pass the variable to the SDK by
279 adding the following::
280
281 ESDK_LOCALCONF_ALLOW = "SSTATE_MIRRORS"
282
283 - Alternatively, if you just want to set the :term:`SSTATE_MIRRORS`
284 variable's value for the SDK alone, create a ``conf/sdk-extra.conf``
285 file either in your :term:`Build Directory` or within any
286 layer and put your :term:`SSTATE_MIRRORS` setting within that file.
287
288 .. note::
289
290 This second option is the safest option should you have any
291 doubts as to which method to use when setting
292 :term:`SSTATE_MIRRORS`
293
294Minimizing the Size of the Extensible SDK Installer Download
295============================================================
296
297By default, the extensible SDK bundles the shared state artifacts for
298everything needed to reconstruct the image for which the SDK was built.
299This bundling can lead to an SDK installer file that is a Gigabyte or
300more in size. If the size of this file causes a problem, you can build
301an SDK that has just enough in it to install and provide access to the
302``devtool command`` by setting the following in your configuration::
303
304 SDK_EXT_TYPE = "minimal"
305
306Setting
307:term:`SDK_EXT_TYPE` to
308"minimal" produces an SDK installer that is around 35 Mbytes in size,
309which downloads and installs quickly. You need to realize, though, that
310the minimal installer does not install any libraries or tools out of the
311box. These libraries and tools must be installed either "on the fly" or
312through actions you perform using ``devtool`` or explicitly with the
313``devtool sdk-install`` command.
314
315In most cases, when building a minimal SDK you need to also enable
316bringing in the information on a wider range of packages produced by the
317system. Requiring this wider range of information is particularly true
318so that ``devtool add`` is able to effectively map dependencies it
319discovers in a source tree to the appropriate recipes. Additionally, the
320information enables the ``devtool search`` command to return useful
321results.
322
323To facilitate this wider range of information, you would need to set the
324following::
325
326 SDK_INCLUDE_PKGDATA = "1"
327
328See the :term:`SDK_INCLUDE_PKGDATA` variable for additional information.
329
330Setting the :term:`SDK_INCLUDE_PKGDATA` variable as shown causes the "world"
331target to be built so that information for all of the recipes included
332within it are available. Having these recipes available increases build
333time significantly and increases the size of the SDK installer by 30-80
334Mbytes depending on how many recipes are included in your configuration.
335
336You can use ``EXCLUDE_FROM_WORLD:pn-``\ recipename for recipes you want
337to exclude. However, it is assumed that you would need to be building
338the "world" target if you want to provide additional items to the SDK.
339Consequently, building for "world" should not represent undue overhead
340in most cases.
341
342.. note::
343
344 If you set
345 SDK_EXT_TYPE
346 to "minimal", then providing a shared state mirror is mandatory so
347 that items can be installed as needed. See the
348 :ref:`sdk-manual/appendix-customizing:providing additional installable extensible sdk content`
349 section for more information.
350
351You can explicitly control whether or not to include the toolchain when
352you build an SDK by setting the
353:term:`SDK_INCLUDE_TOOLCHAIN`
354variable to "1". In particular, it is useful to include the toolchain
355when you have set :term:`SDK_EXT_TYPE` to "minimal", which by default,
356excludes the toolchain. Also, it is helpful if you are building a small
357SDK for use with an IDE or some other tool where you do not want to take
358extra steps to install a toolchain.
diff --git a/documentation/sdk-manual/appendix-obtain.rst b/documentation/sdk-manual/appendix-obtain.rst
deleted file mode 100644
index a42cbc31bb..0000000000
--- a/documentation/sdk-manual/appendix-obtain.rst
+++ /dev/null
@@ -1,306 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3*****************
4Obtaining the SDK
5*****************
6
7Working with the SDK components directly in a Yocto build
8=========================================================
9
10Please refer to section
11":ref:`sdk-manual/extensible:Setting up the Extensible SDK environment directly in a Yocto build`"
12
13Note that to use this feature effectively either a powerful build
14machine, or a well-functioning sstate cache infrastructure is required:
15otherwise significant time could be spent waiting for components to be built
16by BitBake from source code.
17
18Working with standalone SDK Installers
19======================================
20
21Locating Pre-Built SDK Installers
22---------------------------------
23
24You can use existing, pre-built toolchains by locating and running an
25SDK installer script that ships with the Yocto Project. Using this
26method, you select and download an architecture-specific SDK installer
27and then run the script to hand-install the toolchain.
28
29Follow these steps to locate and hand-install the toolchain:
30
31#. *Go to the Installers Directory:* Go to
32 :yocto_dl:`/releases/yocto/&DISTRO_REL_LATEST_TAG;/toolchain/`
33
34#. *Open the Folder for Your Build Host:* Open the folder that matches
35 your :term:`Build Host` (i.e.
36 ``i686`` for 32-bit machines or ``x86_64`` for 64-bit machines).
37
38#. *Locate and Download the SDK Installer:* You need to find and
39 download the installer appropriate for your build host, target
40 hardware, and image type.
41
42 The installer files (``*.sh``) follow this naming convention:
43 ``poky-glibc-host_system-core-image-type-arch-toolchain[-ext]-release.sh``:
44
45 - ``host_system``: string representing your development system: ``i686`` or ``x86_64``
46
47 - ``type``: string representing the image: ``sato`` or ``minimal``
48
49 - ``arch``: string representing the target architecture such as ``cortexa57-qemuarm64``
50
51 - ``release``: version of the Yocto Project.
52
53 .. note::
54 The standard SDK installer does not have the ``-ext`` string as
55 part of the filename.
56
57 The toolchains provided by the Yocto
58 Project are based off of the ``core-image-sato`` and
59 ``core-image-minimal`` images and contain libraries appropriate for
60 developing against those images.
61
62 For example, if your build host is a 64-bit x86 system and you need
63 an extended SDK for a 64-bit core2 QEMU target, go into the ``x86_64``
64 folder and download the following installer::
65
66 poky-glibc-x86_64-core-image-sato-core2-64-qemux86-64-toolchain-&DISTRO;.sh
67
68#. *Run the Installer:* Be sure you have execution privileges and run
69 the installer. Here is an example from the ``Downloads``
70 directory::
71
72 $ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-qemux86-64-toolchain-&DISTRO;.sh
73
74 During execution of the script, you choose the root location for the
75 toolchain. See the
76 ":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
77 section and the
78 ":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`"
79 section for more information.
80
81Building an SDK Installer
82-------------------------
83
84As an alternative to locating and downloading an SDK installer, you can
85build the SDK installer. Follow these steps:
86
87#. *Set Up the Build Environment:* Be sure you are set up to use BitBake
88 in a shell. See the ":ref:`dev-manual/start:preparing the build host`" section
89 in the Yocto Project Development Tasks Manual for information on how
90 to get a build host ready that is either a native Linux machine or a
91 machine that uses CROPS.
92
93#. *Clone the ``poky`` Repository:* You need to have a local copy of the
94 Yocto Project :term:`Source Directory`
95 (i.e. a local
96 ``poky`` repository). See the ":ref:`dev-manual/start:cloning the \`\`poky\`\` repository`" and
97 possibly the ":ref:`dev-manual/start:checking out by branch in poky`" and
98 ":ref:`dev-manual/start:checking out by tag in poky`" sections
99 all in the Yocto Project Development Tasks Manual for information on
100 how to clone the ``poky`` repository and check out the appropriate
101 branch for your work.
102
103#. *Initialize the Build Environment:* While in the root directory of
104 the Source Directory (i.e. ``poky``), run the
105 :ref:`structure-core-script` environment
106 setup script to define the OpenEmbedded build environment on your
107 build host::
108
109 $ source oe-init-build-env
110
111 Among other things, the script creates the :term:`Build Directory`, which
112 is ``build`` in this case and is located in the Source Directory. After
113 the script runs, your current working directory is set to the ``build``
114 directory.
115
116#. *Make Sure You Are Building an Installer for the Correct Machine:*
117 Check to be sure that your :term:`MACHINE` variable in the ``local.conf``
118 file in your :term:`Build Directory` matches the architecture
119 for which you are building.
120
121#. *Make Sure Your SDK Machine is Correctly Set:* If you are building a
122 toolchain designed to run on an architecture that differs from your
123 current development host machine (i.e. the build host), be sure that
124 the :term:`SDKMACHINE` variable in the ``local.conf`` file in your
125 :term:`Build Directory` is correctly set.
126
127 .. note::
128
129 If you are building an SDK installer for the Extensible SDK, the
130 :term:`SDKMACHINE` value must be set for the architecture of the
131 machine you are using to build the installer. If :term:`SDKMACHINE`
132 is not set appropriately, the build fails and provides an error
133 message similar to the following::
134
135 The extensible SDK can currently only be built for the same
136 architecture as the machine being built on - SDK_ARCH
137 is set to i686 (likely via setting SDKMACHINE) which is
138 different from the architecture of the build machine (x86_64).
139 Unable to continue.
140
141
142#. *Build the SDK Installer:* To build the SDK installer for a standard
143 SDK and populate the SDK image, use the following command form. Be
144 sure to replace ``image`` with an image (e.g. "core-image-sato")::
145
146 $ bitbake image -c populate_sdk
147
148 You can do the same for the extensible SDK using this command form::
149
150 $ bitbake image -c populate_sdk_ext
151
152 These commands produce an SDK installer that contains the sysroot
153 that matches your target root filesystem.
154
155 When the ``bitbake`` command completes, the SDK installer will be in
156 ``tmp/deploy/sdk`` in the :term:`Build Directory`.
157
158 .. note::
159
160 - By default, the previous BitBake command does not build static
161 binaries. If you want to use the toolchain to build these types
162 of libraries, you need to be sure your SDK has the appropriate
163 static development libraries. Use the
164 :term:`TOOLCHAIN_TARGET_TASK`
165 variable inside your ``local.conf`` file before building the
166 SDK installer. Doing so ensures that the eventual SDK
167 installation process installs the appropriate library packages
168 as part of the SDK. Here is an example using ``libc``
169 static development libraries: TOOLCHAIN_TARGET_TASK:append = "
170 libc-staticdev"
171
172#. *Run the Installer:* You can now run the SDK installer from
173 ``tmp/deploy/sdk`` in the :term:`Build Directory`. Here is an example::
174
175 $ cd poky/build/tmp/deploy/sdk
176 $ ./poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
177
178 During execution of the script, you choose the root location for the
179 toolchain. See the
180 ":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
181 section and the
182 ":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`"
183 section for more information.
184
185Extracting the Root Filesystem
186==============================
187
188After installing the toolchain, for some use cases you might need to
189separately extract a root filesystem:
190
191- You want to boot the image using NFS.
192
193- You want to use the root filesystem as the target sysroot.
194
195- You want to develop your target application using the root filesystem
196 as the target sysroot.
197
198Follow these steps to extract the root filesystem:
199
200#. *Locate and Download the Tarball for the Pre-Built Root Filesystem
201 Image File:* You need to find and download the root filesystem image
202 file that is appropriate for your target system. These files are kept
203 in machine-specific folders in the
204 :yocto_dl:`Index of Releases </releases/yocto/&DISTRO_REL_LATEST_TAG;/machines/>`
205 in the "machines" directory.
206
207 The machine-specific folders of the "machines" directory contain
208 tarballs (``*.tar.bz2``) for supported machines. These directories
209 also contain flattened root filesystem image files (``*.ext4``),
210 which you can use with QEMU directly.
211
212 The pre-built root filesystem image files follow the
213 ``core-image-profile-machine.tar.bz2`` naming convention:
214
215 - ``profile``: filesystem image's profile, such as ``minimal``,
216 ``minimal-dev`` or ``sato``. For information on these types of image
217 profiles, see the "Images" chapter in the Yocto Project Reference Manual.
218
219 - ``machine``: same string as the name of the parent download directory.
220
221 The root filesystems
222 provided by the Yocto Project are based off of the
223 ``core-image-sato`` and ``core-image-minimal`` images.
224
225 For example, if you plan on using a BeagleBone device as your target
226 hardware and your image is a ``core-image-sato-sdk`` image, you can
227 download the following file::
228
229 core-image-sato-sdk-beaglebone-yocto.tar.bz2
230
231#. *Initialize the Cross-Development Environment:* You must ``source``
232 the cross-development environment setup script to establish necessary
233 environment variables.
234
235 This script is located in the top-level directory in which you
236 installed the toolchain (e.g. ``poky_sdk``).
237
238 Here is an example based on the toolchain installed in the
239 ":ref:`sdk-manual/appendix-obtain:locating pre-built sdk installers`" section::
240
241 $ source poky_sdk/environment-setup-core2-64-poky-linux
242
243#. *Extract the Root Filesystem:* Use the ``runqemu-extract-sdk``
244 command and provide the root filesystem image.
245
246 Here is an example command that extracts the root filesystem
247 from a previously built root filesystem image that was downloaded
248 from the :yocto_dl:`Index of Releases </releases/yocto/&DISTRO_REL_LATEST_TAG;/machines/>`.
249 This command extracts the root filesystem into the ``core2-64-sato``
250 directory::
251
252 $ runqemu-extract-sdk ~/Downloads/core-image-sato-sdk-beaglebone-yocto.tar.bz2 ~/beaglebone-sato
253
254 You could now point to the target sysroot at ``beaglebone-sato``.
255
256Installed Standard SDK Directory Structure
257==========================================
258
259The following figure shows the resulting directory structure after you
260install the Standard SDK by running the ``*.sh`` SDK installation
261script:
262
263.. image:: figures/sdk-installed-standard-sdk-directory.png
264 :scale: 100%
265
266The installed SDK consists of an environment setup script for the SDK, a
267configuration file for the target, a version file for the target, and
268the root filesystem (``sysroots``) needed to develop objects for the
269target system.
270
271Within the figure, italicized text is used to indicate replaceable
272portions of the file or directory name. For example, install_dir/version
273is the directory where the SDK is installed. By default, this directory
274is ``/opt/poky/``. And, version represents the specific snapshot of the
275SDK (e.g. &DISTRO;). Furthermore, target represents the target architecture
276(e.g. ``i586``) and host represents the development system's
277architecture (e.g. ``x86_64``). Thus, the complete names of the two
278directories within the ``sysroots`` could be ``i586-poky-linux`` and
279``x86_64-pokysdk-linux`` for the target and host, respectively.
280
281Installed Extensible SDK Directory Structure
282============================================
283
284The following figure shows the resulting directory structure after you
285install the Extensible SDK by running the ``*.sh`` SDK installation
286script:
287
288.. image:: figures/sdk-installed-extensible-sdk-directory.png
289 :scale: 80%
290 :align: center
291
292The installed directory structure for the extensible SDK is quite
293different than the installed structure for the standard SDK. The
294extensible SDK does not separate host and target parts in the same
295manner as does the standard SDK. The extensible SDK uses an embedded
296copy of the OpenEmbedded build system, which has its own sysroots.
297
298Of note in the directory structure are an environment setup script for
299the SDK, a configuration file for the target, a version file for the
300target, and log files for the OpenEmbedded build system preparation
301script run by the installer and BitBake.
302
303Within the figure, italicized text is used to indicate replaceable
304portions of the file or directory name. For example, install_dir is the
305directory where the SDK is installed, which is ``poky_sdk`` by default,
306and target represents the target architecture (e.g. ``i586``).
diff --git a/documentation/sdk-manual/extensible.rst b/documentation/sdk-manual/extensible.rst
deleted file mode 100644
index e5e9e4a03b..0000000000
--- a/documentation/sdk-manual/extensible.rst
+++ /dev/null
@@ -1,362 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3************************
4Using the Extensible SDK
5************************
6
7This chapter describes the extensible SDK and how to install it.
8Information covers the pieces of the SDK, how to install it, and
9presents a look at using the ``devtool`` functionality. The extensible
10SDK makes it easy to add new applications and libraries to an image,
11modify the source for an existing component, test changes on the target
12hardware, and ease integration into the rest of the
13:term:`OpenEmbedded Build System`.
14
15.. note::
16
17 For a side-by-side comparison of main features supported for an
18 extensible SDK as compared to a standard SDK, see the
19 :ref:`sdk-manual/intro:introduction` section.
20
21In addition to the functionality available through ``devtool``, you can
22alternatively make use of the toolchain directly, for example from
23Makefile and Autotools. See the
24":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter
25for more information.
26
27Why use the Extensible SDK and What is in It?
28=============================================
29
30The extensible SDK provides a cross-development toolchain and libraries
31tailored to the contents of a specific image. You would use the
32Extensible SDK if you want a toolchain experience supplemented with the
33powerful set of ``devtool`` commands tailored for the Yocto Project
34environment.
35
36The installed extensible SDK consists of several files and directories.
37Basically, it contains an SDK environment setup script, some
38configuration files, an internal build system, and the ``devtool``
39functionality.
40
41Installing the Extensible SDK
42=============================
43
44Two ways to install the Extensible SDK
45--------------------------------------
46
47Extensible SDK can be installed in two different ways, and both have
48their own pros and cons:
49
50#. *Setting up the Extensible SDK environment directly in a Yocto build*. This
51 avoids having to produce, test, distribute and maintain separate SDK
52 installer archives, which can get very large. There is only one environment
53 for the regular Yocto build and the SDK and less code paths where things can
54 go not according to plan. It's easier to update the SDK: it simply means
55 updating the Yocto layers with git fetch or layer management tooling. The
56 SDK extensibility is better than in the second option: just run ``bitbake``
57 again to add more things to the sysroot, or add layers if even more things
58 are required.
59
60#. *Setting up the Extensible SDK from a standalone installer*. This has the
61 benefit of having a single, self-contained archive that includes all the
62 needed binary artifacts. So nothing needs to be rebuilt, and there is no
63 need to provide a well-functioning binary artefact cache over the network
64 for developers with underpowered laptops.
65
66.. _setting_up_ext_sdk_in_build:
67
68Setting up the Extensible SDK environment directly in a Yocto build
69-------------------------------------------------------------------
70
71#. Set up all the needed layers and a Yocto :term:`Build Directory`, e.g. a regular Yocto
72 build where ``bitbake`` can be executed.
73
74#. Run::
75
76 $ bitbake meta-ide-support
77 $ bitbake -c populate_sysroot gtk+3
78 # or any other target or native item that the application developer would need
79 $ bitbake build-sysroots -c build_native_sysroot && bitbake build-sysroots -c build_target_sysroot
80
81Setting up the Extensible SDK from a standalone installer
82---------------------------------------------------------
83
84The first thing you need to do is install the SDK on your :term:`Build
85Host` by running the ``*.sh`` installation script.
86
87You can download a tarball installer, which includes the pre-built
88toolchain, the ``runqemu`` script, the internal build system,
89``devtool``, and support files from the appropriate
90:yocto_dl:`toolchain </releases/yocto/&DISTRO_REL_LATEST_TAG;/toolchain/>` directory within the Index of
91Releases. Toolchains are available for several 32-bit and 64-bit
92architectures with the ``x86_64`` directories, respectively. The
93toolchains the Yocto Project provides are based off the
94``core-image-sato`` and ``core-image-minimal`` images and contain
95libraries appropriate for developing against that image.
96
97The names of the tarball installer scripts are such that a string
98representing the host system appears first in the filename and then is
99immediately followed by a string representing the target architecture.
100An extensible SDK has the string "-ext" as part of the name. Following
101is the general form::
102
103 poky-glibc-host_system-image_type-arch-toolchain-ext-release_version.sh
104
105 Where:
106 host_system is a string representing your development system:
107
108 i686 or x86_64.
109
110 image_type is the image for which the SDK was built:
111
112 core-image-sato or core-image-minimal
113
114 arch is a string representing the tuned target architecture:
115
116 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon
117
118 release_version is a string representing the release number of the Yocto Project:
119
120 &DISTRO;, &DISTRO;+snapshot
121
122For example, the following SDK installer is for a 64-bit
123development host system and a i586-tuned target architecture based off
124the SDK for ``core-image-sato`` and using the current &DISTRO; snapshot::
125
126 poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-&DISTRO;.sh
127
128.. note::
129
130 As an alternative to downloading an SDK, you can build the SDK
131 installer. For information on building the installer, see the
132 :ref:`sdk-manual/appendix-obtain:building an sdk installer`
133 section.
134
135The SDK and toolchains are self-contained and by default are installed
136into the ``poky_sdk`` folder in your home directory. You can choose to
137install the extensible SDK in any location when you run the installer.
138However, because files need to be written under that directory during
139the normal course of operation, the location you choose for installation
140must be writable for whichever users need to use the SDK.
141
142The following command shows how to run the installer given a toolchain
143tarball for a 64-bit x86 development host system and a 64-bit x86 target
144architecture. The example assumes the SDK installer is located in
145``~/Downloads/`` and has execution rights::
146
147 $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh
148 Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5
149 ==========================================================================
150 Enter target directory for SDK (default: poky_sdk):
151 You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y
152 Extracting SDK..............done
153 Setting it up...
154 Extracting buildtools...
155 Preparing build system...
156 Parsing recipes: 100% |##################################################################| Time: 0:00:52
157 Initialising tasks: 100% |###############################################################| Time: 0:00:00
158 Checking sstate mirror object availability: 100% |#######################################| Time: 0:00:00
159 Loading cache: 100% |####################################################################| Time: 0:00:00
160 Initialising tasks: 100% |###############################################################| Time: 0:00:00
161 done
162 SDK has been successfully set up and is ready to be used.
163 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
164 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux
165
166.. note::
167
168 If you do not have write permissions for the directory into which you
169 are installing the SDK, the installer notifies you and exits. For
170 that case, set up the proper permissions in the directory and run the
171 installer again.
172
173.. _running_the_ext_sdk_env:
174
175Running the Extensible SDK Environment Setup Script
176===================================================
177
178Once you have the SDK installed, you must run the SDK environment setup
179script before you can actually use the SDK.
180
181When using an SDK directly in a Yocto build, you will find the script in
182``tmp/deploy/images/qemux86-64/`` in your :term:`Build Directory`.
183
184When using a standalone SDK installer, this setup script resides in
185the directory you chose when you installed the SDK, which is either the
186default ``poky_sdk`` directory or the directory you chose during
187installation.
188
189Before running the script, be sure it is the one that matches the
190architecture for which you are developing. Environment setup scripts
191begin with the string "``environment-setup``" and include as part of
192their name the tuned target architecture. As an example, the following
193commands set the working directory to where the SDK was installed and
194then source the environment setup script. In this example, the setup
195script is for an IA-based target machine using i586 tuning::
196
197 $ cd /home/scottrif/poky_sdk
198 $ source environment-setup-core2-64-poky-linux
199 SDK environment now set up; additionally you may now run devtool to perform development tasks.
200 Run devtool --help for further details.
201
202When using the environment script directly in a Yocto build, it can
203be run similarly::
204
205 $ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
206
207Running the setup script defines many environment variables needed in order to
208use the SDK (e.g. ``PATH``, :term:`CC`, :term:`LD`, and so forth). If you want
209to see all the environment variables the script exports, examine the
210installation file itself.
211
212.. _using_devtool:
213
214Using ``devtool`` in Your SDK Workflow
215======================================
216
217The cornerstone of the extensible SDK is a command-line tool called
218``devtool``. This tool provides a number of features that help you
219build, test and package software within the extensible SDK, and
220optionally integrate it into an image built by the OpenEmbedded build
221system.
222
223.. note::
224
225 The use of ``devtool`` is not limited to the extensible SDK. You can use
226 ``devtool`` to help you easily develop any project whose build output must be
227 part of an image built using the build system.
228
229The ``devtool`` command line is organized similarly to
230:ref:`overview-manual/development-environment:git` in that it has a number of
231sub-commands for each function. You can run ``devtool --help`` to see
232all the commands.
233
234.. note::
235
236 See the ":doc:`/ref-manual/devtool-reference`"
237 section in the Yocto Project Reference Manual.
238
239``devtool`` subcommands provide entry-points into development:
240
241- *devtool add*: Assists in adding new software to be built.
242
243- *devtool modify*: Sets up an environment to enable you to modify
244 the source of an existing component.
245
246- *devtool ide-sdk*: Generates a configuration for an IDE.
247
248- *devtool upgrade*: Updates an existing recipe so that you can
249 build it for an updated set of source files.
250
251As with the build system, "recipes" represent software packages within
252``devtool``. When you use ``devtool add``, a recipe is automatically
253created. When you use ``devtool modify``, the specified existing recipe
254is used in order to determine where to get the source code and how to
255patch it. In both cases, an environment is set up so that when you build
256the recipe a source tree that is under your control is used in order to
257allow you to make changes to the source as desired. By default, new
258recipes and the source go into a "workspace" directory under the SDK.
259
260To learn how to use ``devtool`` to add, modify, upgrade recipes and more, see
261the :ref:`dev-manual/devtool:Using the \`\`devtool\`\` command-line tool`
262section of the Yocto Project Development Tasks Manual.
263
264Installing Additional Items Into the Extensible SDK
265===================================================
266
267Out of the box the extensible SDK typically only comes with a small
268number of tools and libraries. A minimal SDK starts mostly empty and is
269populated on-demand. Sometimes you must explicitly install extra items
270into the SDK. If you need these extra items, you can first search for
271the items using the ``devtool search`` command. For example, suppose you
272need to link to libGL but you are not sure which recipe provides libGL.
273You can use the following command to find out::
274
275 $ devtool search libGL mesa
276 A free implementation of the OpenGL API
277
278Once you know the recipe
279(i.e. ``mesa`` in this example), you can install it.
280
281When using the extensible SDK directly in a Yocto build
282-------------------------------------------------------
283
284In this scenario, the Yocto build tooling, e.g. ``bitbake``
285is directly accessible to build additional items, and it
286can simply be executed directly::
287
288 $ bitbake curl-native
289 # Add newly built native items to native sysroot
290 $ bitbake build-sysroots -c build_native_sysroot
291 $ bitbake mesa
292 # Add newly built target items to target sysroot
293 $ bitbake build-sysroots -c build_target_sysroot
294
295When using a standalone installer for the Extensible SDK
296--------------------------------------------------------
297
298::
299
300 $ devtool sdk-install mesa
301
302By default, the ``devtool sdk-install`` command assumes
303the item is available in pre-built form from your SDK provider. If the
304item is not available and it is acceptable to build the item from
305source, you can add the "-s" option as follows::
306
307 $ devtool sdk-install -s mesa
308
309It is important to remember that building the item from source
310takes significantly longer than installing the pre-built artifact. Also,
311if there is no recipe for the item you want to add to the SDK, you must
312instead add the item using the ``devtool add`` command.
313
314Applying Updates to an Installed Extensible SDK
315===============================================
316
317If you are working with an installed extensible SDK that gets
318occasionally updated (e.g. a third-party SDK), then you will need to
319manually "pull down" the updates into the installed SDK.
320
321To update your installed SDK, use ``devtool`` as follows::
322
323 $ devtool sdk-update
324
325The previous command assumes your SDK provider has set the default update URL
326for you through the :term:`SDK_UPDATE_URL` variable as described in the
327":ref:`sdk-manual/appendix-customizing:Providing Updates to the Extensible SDK After Installation`"
328section. If the SDK provider has not set that default URL, you need to
329specify it yourself in the command as follows::
330
331 $ devtool sdk-update path_to_update_directory
332
333.. note::
334
335 The URL needs to point specifically to a published SDK and not to an
336 SDK installer that you would download and install.
337
338Creating a Derivative SDK With Additional Components
339====================================================
340
341You might need to produce an SDK that contains your own custom
342libraries. A good example would be if you were a vendor with customers
343that use your SDK to build their own platform-specific software and
344those customers need an SDK that has custom libraries. In such a case,
345you can produce a derivative SDK based on the currently installed SDK
346fairly easily by following these steps:
347
348#. If necessary, install an extensible SDK that you want to use as a
349 base for your derivative SDK.
350
351#. Source the environment script for the SDK.
352
353#. Add the extra libraries or other components you want by using the
354 ``devtool add`` command.
355
356#. Run the ``devtool build-sdk`` command.
357
358The previous steps take the recipes added to the workspace and construct
359a new SDK installer that contains those recipes and the resulting binary
360artifacts. The recipes go into their own separate layer in the
361constructed derivative SDK, which leaves the workspace clean and ready
362for users to add their own recipes.
diff --git a/documentation/sdk-manual/figures/sdk-autotools-flow.png b/documentation/sdk-manual/figures/sdk-autotools-flow.png
deleted file mode 100644
index ec6685f8b6..0000000000
--- a/documentation/sdk-manual/figures/sdk-autotools-flow.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/figures/sdk-environment.png b/documentation/sdk-manual/figures/sdk-environment.png
deleted file mode 100644
index 78b8cad39e..0000000000
--- a/documentation/sdk-manual/figures/sdk-environment.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png b/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
deleted file mode 100644
index b71c8ad73c..0000000000
--- a/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png b/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
deleted file mode 100644
index 45c0154b19..0000000000
--- a/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/figures/sdk-makefile-flow.png b/documentation/sdk-manual/figures/sdk-makefile-flow.png
deleted file mode 100644
index 0ccb4180a3..0000000000
--- a/documentation/sdk-manual/figures/sdk-makefile-flow.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/figures/sdk-title.png b/documentation/sdk-manual/figures/sdk-title.png
deleted file mode 100644
index e69e03935a..0000000000
--- a/documentation/sdk-manual/figures/sdk-title.png
+++ /dev/null
Binary files differ
diff --git a/documentation/sdk-manual/index.rst b/documentation/sdk-manual/index.rst
deleted file mode 100644
index dc7186b911..0000000000
--- a/documentation/sdk-manual/index.rst
+++ /dev/null
@@ -1,21 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3========================================================================================
4Yocto Project Application Development and the Extensible Software Development Kit (eSDK)
5========================================================================================
6
7|
8
9.. toctree::
10 :caption: Table of Contents
11 :numbered:
12
13 intro
14 extensible
15 using
16 working-projects
17 appendix-obtain
18 appendix-customizing
19 appendix-customizing-standard
20
21.. include:: /boilerplate.rst
diff --git a/documentation/sdk-manual/intro.rst b/documentation/sdk-manual/intro.rst
deleted file mode 100644
index fbfc8c2ac7..0000000000
--- a/documentation/sdk-manual/intro.rst
+++ /dev/null
@@ -1,208 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3************
4Introduction
5************
6
7eSDK Introduction
8=================
9
10Welcome to the Yocto Project Application Development and the Extensible
11Software Development Kit (eSDK) manual. This manual
12explains how to use both the Yocto Project extensible and standard
13SDKs to develop applications and images.
14
15All SDKs consist of the following:
16
17- *Cross-Development Toolchain*: This toolchain contains a compiler,
18 debugger, and various associated tools.
19
20- *Libraries, Headers, and Symbols*: The libraries, headers, and
21 symbols are specific to the image (i.e. they match the image
22 against which the SDK was built).
23
24- *Environment Setup Script*: This ``*.sh`` file, once sourced, sets up the
25 cross-development environment by defining variables and preparing for
26 SDK use.
27
28Additionally, an extensible SDK has tools that allow you to easily add
29new applications and libraries to an image, modify the source of an
30existing component, test changes on the target hardware, and easily
31integrate an application into the :term:`OpenEmbedded Build System`.
32
33You can use an SDK to independently develop and test code that is
34destined to run on some target machine. SDKs are completely
35self-contained. The binaries are linked against their own copy of
36``libc``, which results in no dependencies on the target system. To
37achieve this, the pointer to the dynamic loader is configured at install
38time since that path cannot be dynamically altered. This is the reason
39for a wrapper around the ``populate_sdk`` and ``populate_sdk_ext``
40archives.
41
42Another feature of the SDKs is that only one set of cross-compiler
43toolchain binaries are produced for any given architecture. This feature
44takes advantage of the fact that the target hardware can be passed to
45``gcc`` as a set of compiler options. Those options are set up by the
46environment script and contained in variables such as
47:term:`CC` and
48:term:`LD`. This reduces the space needed
49for the tools. Understand, however, that every target still needs its own
50sysroot because those binaries are target-specific.
51
52The SDK development environment consists of the following:
53
54- The self-contained SDK, which is an architecture-specific
55 cross-toolchain and matching sysroots (target and native) all built
56 by the OpenEmbedded build system (e.g. the SDK). The toolchain and
57 sysroots are based on a :term:`Metadata`
58 configuration and extensions, which allows you to cross-develop on
59 the host machine for the target hardware. Additionally, the
60 extensible SDK contains the ``devtool`` functionality.
61
62- The Quick EMUlator (QEMU), which lets you simulate target hardware.
63 QEMU is not literally part of the SDK. You must build and include
64 this emulator separately. However, QEMU plays an important role in
65 the development process that revolves around use of the SDK.
66
67In summary, the extensible and standard SDK share many features.
68However, the extensible SDK has powerful development tools to help you
69more quickly develop applications. Here is a table that summarizes
70the primary differences between the standard and extensible SDK types
71when considering which to build:
72
73+-----------------------+-----------------------+-----------------------+
74| *Feature* | *Standard SDK* | *Extensible SDK* |
75+=======================+=======================+=======================+
76| Toolchain | Yes | Yes [1]_ |
77+-----------------------+-----------------------+-----------------------+
78| Debugger | Yes | Yes [1]_ |
79+-----------------------+-----------------------+-----------------------+
80| Size | 100+ MBytes | 1+ GBytes (or 300+ |
81| | | MBytes for minimal |
82| | | w/toolchain) |
83+-----------------------+-----------------------+-----------------------+
84| ``devtool`` | No | Yes |
85+-----------------------+-----------------------+-----------------------+
86| Build Images | No | Yes |
87+-----------------------+-----------------------+-----------------------+
88| Updateable | No | Yes |
89+-----------------------+-----------------------+-----------------------+
90| Managed Sysroot [2]_ | No | Yes |
91+-----------------------+-----------------------+-----------------------+
92| Installed Packages | No [3]_ | Yes [4]_ |
93+-----------------------+-----------------------+-----------------------+
94| Construction | Packages | Shared State |
95+-----------------------+-----------------------+-----------------------+
96
97.. [1] Extensible SDK contains the toolchain and debugger if :term:`SDK_EXT_TYPE`
98 is "full" or :term:`SDK_INCLUDE_TOOLCHAIN` is "1", which is the default.
99.. [2] Sysroot is managed through the use of ``devtool``. Thus, it is less
100 likely that you will corrupt your SDK sysroot when you try to add
101 additional libraries.
102.. [3] You can add runtime package management to the standard SDK but it is not
103 supported by default.
104.. [4] You must build and make the shared state available to extensible SDK
105 users for "packages" you want to enable users to install.
106
107The Cross-Development Toolchain
108-------------------------------
109
110The :term:`Cross-Development Toolchain` consists
111of a cross-compiler, cross-linker, and cross-debugger that are used to
112develop user-space applications for targeted hardware; in addition,
113the extensible SDK comes with built-in ``devtool``
114functionality. This toolchain is created by running a SDK installer
115script or through a :term:`Build Directory` that is based on
116your metadata configuration or extension for your targeted device. The
117cross-toolchain works with a matching target sysroot.
118
119Sysroots
120--------
121
122The native and target sysroots contain needed headers and libraries for
123generating binaries that run on the target architecture. The target
124sysroot is based on the target root filesystem image that is built by
125the OpenEmbedded build system and uses the same metadata configuration
126used to build the cross-toolchain.
127
128The QEMU Emulator
129-----------------
130
131The QEMU emulator allows you to simulate your hardware while running
132your application or image. QEMU is not part of the SDK but is
133automatically installed and available if you have done any one of
134the following:
135
136- cloned the ``poky`` Git repository to create a
137 :term:`Source Directory` and sourced the environment setup script.
138
139- downloaded a Yocto Project release and unpacked it to
140 create a Source Directory and sourced the environment setup
141 script.
142
143- installed the cross-toolchain tarball and
144 sourced the toolchain's setup environment script.
145
146SDK Development Model
147=====================
148
149Fundamentally, the SDK fits into the development process as follows:
150
151.. image:: figures/sdk-environment.png
152 :width: 100%
153
154The SDK is installed on any machine and can be used to develop applications,
155images, and kernels. An SDK can even be used by a QA Engineer or Release
156Engineer. The fundamental concept is that the machine that has the SDK
157installed does not have to be associated with the machine that has the
158Yocto Project installed. A developer can independently compile and test
159an object on their machine and then, when the object is ready for
160integration into an image, they can simply make it available to the
161machine that has the Yocto Project. Once the object is available, the
162image can be rebuilt using the Yocto Project to produce the modified
163image.
164
165You just need to follow these general steps:
166
167#. *Install the SDK for your target hardware:* For information on how to
168 install the SDK, see the ":ref:`sdk-manual/using:installing the sdk`"
169 section.
170
171#. *Download or Build the Target Image:* The Yocto Project supports
172 several target architectures and has many pre-built kernel images and
173 root filesystem images.
174
175 If you are going to develop your application on hardware, go to the
176 :yocto_dl:`machines </releases/yocto/&DISTRO_REL_LATEST_TAG;/machines/>` download area and choose a
177 target machine area from which to download the kernel image and root
178 filesystem. This download area could have several files in it that
179 support development using actual hardware. For example, the area
180 might contain ``.hddimg`` files that combine the kernel image with
181 the filesystem, boot loaders, and so forth. Be sure to get the files
182 you need for your particular development process.
183
184 If you are going to develop your application and then run and test it
185 using the QEMU emulator, go to the
186 :yocto_dl:`machines/qemu </releases/yocto/&DISTRO_REL_LATEST_TAG;/machines/qemu>` download area. From this
187 area, go down into the directory for your target architecture (e.g.
188 ``qemux86_64`` for an Intel-based 64-bit architecture). Download the
189 kernel, root filesystem, and any other files you need for your
190 process.
191
192 .. note::
193
194 To use the root filesystem in QEMU, you need to extract it. See the
195 ":ref:`sdk-manual/appendix-obtain:extracting the root filesystem`"
196 section for information on how to do this extraction.
197
198#. *Develop and Test your Application:* At this point, you have the
199 tools to develop your application. If you need to separately install
200 and use the QEMU emulator, you can go to `QEMU Home
201 Page <https://wiki.qemu.org/Main_Page>`__ to download and learn about
202 the emulator. See the ":doc:`/dev-manual/qemu`" chapter in the
203 Yocto Project Development Tasks Manual for information on using QEMU
204 within the Yocto Project.
205
206The remainder of this manual describes how to use the extensible and
207standard SDKs. There is also information in appendix form describing
208how you can build, install, and modify an SDK.
diff --git a/documentation/sdk-manual/using.rst b/documentation/sdk-manual/using.rst
deleted file mode 100644
index bfb306abf5..0000000000
--- a/documentation/sdk-manual/using.rst
+++ /dev/null
@@ -1,147 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3**********************
4Using the Standard SDK
5**********************
6
7This chapter describes the standard SDK and how to install it.
8Information includes unique installation and setup aspects for the
9standard SDK.
10
11.. note::
12
13 For a side-by-side comparison of main features supported for a
14 standard SDK as compared to an extensible SDK, see the
15 ":ref:`sdk-manual/intro:introduction`" section.
16
17You can use a standard SDK to work on Makefile and Autotools-based
18projects. See the
19":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter
20for more information.
21
22Why use the Standard SDK and What is in It?
23===========================================
24
25The Standard SDK provides a cross-development toolchain and libraries
26tailored to the contents of a specific image. You would use the Standard
27SDK if you want a more traditional toolchain experience as compared to
28the extensible SDK, which provides an internal build system and the
29``devtool`` functionality.
30
31The installed Standard SDK consists of several files and directories.
32Basically, it contains an SDK environment setup script, some
33configuration files, and host and target root filesystems to support
34usage. You can see the directory structure in the
35":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
36section.
37
38Installing the SDK
39==================
40
41The first thing you need to do is install the SDK on your :term:`Build
42Host` by running the ``*.sh`` installation script.
43
44You can download a tarball installer, which includes the pre-built
45toolchain, the ``runqemu`` script, and support files from the
46appropriate :yocto_dl:`toolchain </releases/yocto/&DISTRO_REL_LATEST_TAG;/toolchain/>` directory within
47the Index of Releases. Toolchains are available for several 32-bit and
4864-bit architectures with the ``x86_64`` directories, respectively. The
49toolchains the Yocto Project provides are based off the
50``core-image-sato`` and ``core-image-minimal`` images and contain
51libraries appropriate for developing against the corresponding image.
52
53The names of the tarball installer scripts are such that a string
54representing the host system appears first in the filename and then is
55immediately followed by a string representing the target architecture::
56
57 poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
58
59 Where:
60 host_system is a string representing your development system:
61
62 i686 or x86_64.
63
64 image_type is the image for which the SDK was built:
65
66 core-image-minimal or core-image-sato.
67
68 arch is a string representing the tuned target architecture:
69
70 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
71
72 release_version is a string representing the release number of the Yocto Project:
73
74 &DISTRO;, &DISTRO;+snapshot
75
76For example, the following SDK installer is for a 64-bit
77development host system and a i586-tuned target architecture based off
78the SDK for ``core-image-sato`` and using the current DISTRO snapshot::
79
80 poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
81
82.. note::
83
84 As an alternative to downloading an SDK, you can build the SDK
85 installer. For information on building the installer, see the
86 ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
87 section.
88
89The SDK and toolchains are self-contained and by default are installed
90into the ``poky_sdk`` folder in your home directory. You can choose to
91install the extensible SDK in any location when you run the installer.
92However, because files need to be written under that directory during
93the normal course of operation, the location you choose for installation
94must be writable for whichever users need to use the SDK.
95
96The following command shows how to run the installer given a toolchain
97tarball for a 64-bit x86 development host system and a 64-bit x86 target
98architecture. The example assumes the SDK installer is located in
99``~/Downloads/`` and has execution rights::
100
101 $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
102 Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
103 ===============================================================
104 Enter target directory for SDK (default: /opt/poky/&DISTRO;):
105 You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed [Y/n]? Y
106 Extracting SDK........................................ ..............................done
107 Setting it up...done
108 SDK has been successfully set up and is ready to be used.
109 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
110 $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
111
112.. note::
113
114 If you do not have write permissions for the directory into which you
115 are installing the SDK, the installer notifies you and exits. For
116 that case, set up the proper permissions in the directory and run the
117 installer again.
118
119Again, reference the
120":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
121section for more details on the resulting directory structure of the installed
122SDK.
123
124Running the SDK Environment Setup Script
125========================================
126
127Once you have the SDK installed, you must run the SDK environment setup
128script before you can actually use the SDK. This setup script resides in
129the directory you chose when you installed the SDK, which is either the
130default ``/opt/poky/&DISTRO;`` directory or the directory you chose during
131installation.
132
133Before running the script, be sure it is the one that matches the
134architecture for which you are developing. Environment setup scripts
135begin with the string "``environment-setup``" and include as part of
136their name the tuned target architecture. As an example, the following
137commands set the working directory to where the SDK was installed and
138then source the environment setup script. In this example, the setup
139script is for an IA-based target machine using i586 tuning::
140
141 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
142
143When you run the
144setup script, the same environment variables are defined as are when you
145run the setup script for an extensible SDK. See the
146":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`"
147section for more information.
diff --git a/documentation/sdk-manual/working-projects.rst b/documentation/sdk-manual/working-projects.rst
deleted file mode 100644
index 7df73b1b17..0000000000
--- a/documentation/sdk-manual/working-projects.rst
+++ /dev/null
@@ -1,404 +0,0 @@
1.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3********************************
4Using the SDK Toolchain Directly
5********************************
6
7You can use the SDK toolchain directly with Makefile and Autotools-based
8projects.
9
10Autotools-Based Projects
11========================
12
13Once you have a suitable :ref:`sdk-manual/intro:the cross-development toolchain`
14installed, it is very easy to develop a project using the :wikipedia:`GNU
15Autotools-based <GNU_Build_System>` workflow, which is outside of the
16:term:`OpenEmbedded Build System`.
17
18The following figure presents a simple Autotools workflow.
19
20.. image:: figures/sdk-autotools-flow.png
21 :align: center
22 :width: 70%
23
24Follow these steps to create a simple Autotools-based "Hello World"
25project:
26
27.. note::
28
29 For more information on the GNU Autotools workflow, see the same
30 example on the
31 GNOME Developer
32 site.
33
34#. *Create a Working Directory and Populate It:* Create a clean
35 directory for your project and then make that directory your working
36 location::
37
38 $ mkdir $HOME/helloworld
39 $ cd $HOME/helloworld
40
41 After setting up the directory, populate it with files needed for the flow.
42 You need a project source file, a file to help with configuration,
43 and a file to help create the Makefile, and a README file:
44 ``hello.c``, ``configure.ac``, ``Makefile.am``, and ``README``,
45 respectively.
46
47 Use the following command to create an empty README file, which is
48 required by GNU Coding Standards::
49
50 $ touch README
51
52 Create the remaining
53 three files as follows:
54
55 - ``hello.c``::
56
57 #include <stdio.h>
58
59 int main()
60 {
61 printf("Hello World!\n");
62 return 0;
63 }
64
65 - ``configure.ac``::
66
67 AC_INIT(hello,0.1)
68 AM_INIT_AUTOMAKE([foreign])
69 AC_PROG_CC
70 AC_CONFIG_FILES(Makefile)
71 AC_OUTPUT
72
73 - ``Makefile.am``::
74
75 bin_PROGRAMS = hello
76 hello_SOURCES = hello.c
77
78#. *Source the Cross-Toolchain Environment Setup File:* As described
79 earlier in the manual, installing the cross-toolchain creates a
80 cross-toolchain environment setup script in the directory that the
81 SDK was installed. Before you can use the tools to develop your
82 project, you must source this setup script. The script begins with
83 the string "environment-setup" and contains the machine architecture,
84 which is followed by the string "poky-linux". For this example, the
85 command sources a script from the default SDK installation directory
86 that uses the 32-bit Intel x86 Architecture and the &DISTRO; Yocto
87 Project release::
88
89 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
90
91 Another example is sourcing the environment setup directly in a Yocto
92 build::
93
94 $ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
95
96#. *Create the configure Script:* Use the ``autoreconf`` command to
97 generate the ``configure`` script::
98
99 $ autoreconf
100
101 The ``autoreconf``
102 tool takes care of running the other Autotools such as ``aclocal``,
103 ``autoconf``, and ``automake``.
104
105 .. note::
106
107 If you get errors from ``configure.ac``, which ``autoreconf``
108 runs, that indicate missing files, you can use the "-i" option,
109 which ensures missing auxiliary files are copied to the build
110 host.
111
112#. *Cross-Compile the Project:* This command compiles the project using
113 the cross-compiler. The
114 :term:`CONFIGURE_FLAGS`
115 environment variable provides the minimal arguments for GNU
116 configure::
117
118 $ ./configure ${CONFIGURE_FLAGS}
119
120 For an Autotools-based
121 project, you can use the cross-toolchain by just passing the
122 appropriate host option to ``configure.sh``. The host option you use
123 is derived from the name of the environment setup script found in the
124 directory in which you installed the cross-toolchain. For example,
125 the host option for an ARM-based target that uses the GNU EABI is
126 ``armv5te-poky-linux-gnueabi``. You will notice that the name of the
127 script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the
128 following command works to update your project and rebuild it using
129 the appropriate cross-toolchain tools::
130
131 $ ./configure --host=armv5te-poky-linux-gnueabi --with-libtool-sysroot=sysroot_dir
132
133#. *Make and Install the Project:* These two commands generate and
134 install the project into the destination directory::
135
136 $ make
137 $ make install DESTDIR=./tmp
138
139 .. note::
140
141 To learn about environment variables established when you run the
142 cross-toolchain environment setup script and how they are used or
143 overridden by the Makefile, see the
144 :ref:`sdk-manual/working-projects:makefile-based projects` section.
145
146 This next command is a simple way to verify the installation of your
147 project. Running the command prints the architecture on which the
148 binary file can run. This architecture should be the same
149 architecture that the installed cross-toolchain supports::
150
151 $ file ./tmp/usr/local/bin/hello
152
153#. *Execute Your Project:* To execute the project, you would need to run
154 it on your target hardware. If your target hardware happens to be
155 your build host, you could run the project as follows::
156
157 $ ./tmp/usr/local/bin/hello
158
159 As expected, the project displays the "Hello World!" message.
160
161Makefile-Based Projects
162=======================
163
164Simple Makefile-based projects use and interact with the cross-toolchain
165environment variables established when you run the cross-toolchain
166environment setup script. The environment variables are subject to
167general ``make`` rules.
168
169This section presents a simple Makefile development flow and provides an
170example that lets you see how you can use cross-toolchain environment
171variables and Makefile variables during development.
172
173.. image:: figures/sdk-makefile-flow.png
174 :align: center
175 :width: 70%
176
177The main point of this section is to explain the following three cases
178regarding variable behavior:
179
180- *Case 1 --- No Variables Set in the Makefile Map to Equivalent
181 Environment Variables Set in the SDK Setup Script:* Because matching
182 variables are not specifically set in the ``Makefile``, the variables
183 retain their values based on the environment setup script.
184
185- *Case 2 --- Variables Are Set in the Makefile that Map to Equivalent
186 Environment Variables from the SDK Setup Script:* Specifically
187 setting matching variables in the ``Makefile`` during the build
188 results in the environment settings of the variables being
189 overwritten. In this case, the variables you set in the ``Makefile``
190 are used.
191
192- *Case 3 --- Variables Are Set Using the Command Line that Map to
193 Equivalent Environment Variables from the SDK Setup Script:*
194 Executing the ``Makefile`` from the command line results in the
195 environment variables being overwritten. In this case, the
196 command-line content is used.
197
198.. note::
199
200 Regardless of how you set your variables, if you use the "-e" option
201 with ``make``, the variables from the SDK setup script take precedence::
202
203 $ make -e target
204
205
206The remainder of this section presents a simple Makefile example that
207demonstrates these variable behaviors.
208
209In a new shell environment variables are not established for the SDK
210until you run the setup script. For example, the following commands show
211a null value for the compiler variable (i.e.
212:term:`CC`)::
213
214 $ echo ${CC}
215
216 $
217
218Running the
219SDK setup script for a 64-bit build host and an i586-tuned target
220architecture for a ``core-image-sato`` image using the current &DISTRO;
221Yocto Project release and then echoing that variable shows the value
222established through the script::
223
224 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
225 $ echo ${CC}
226 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/&DISTRO;/sysroots/i586-poky-linux
227
228To illustrate variable use, work through this simple "Hello World!"
229example:
230
231#. *Create a Working Directory and Populate It:* Create a clean
232 directory for your project and then make that directory your working
233 location::
234
235 $ mkdir $HOME/helloworld
236 $ cd $HOME/helloworld
237
238 After
239 setting up the directory, populate it with files needed for the flow.
240 You need a ``main.c`` file from which you call your function, a
241 ``module.h`` file to contain headers, and a ``module.c`` that defines
242 your function.
243
244 Create the three files as follows:
245
246 - ``main.c``::
247
248 #include "module.h"
249 void sample_func();
250 int main()
251 {
252 sample_func();
253 return 0;
254 }
255
256 - ``module.h``::
257
258 #include <stdio.h>
259 void sample_func();
260
261 - ``module.c``::
262
263 #include "module.h"
264 void sample_func()
265 {
266 printf("Hello World!");
267 printf("\n");
268 }
269
270#. *Source the Cross-Toolchain Environment Setup File:* As described
271 earlier in the manual, installing the cross-toolchain creates a
272 cross-toolchain environment setup script in the directory that the
273 SDK was installed. Before you can use the tools to develop your
274 project, you must source this setup script. The script begins with
275 the string "environment-setup" and contains the machine architecture,
276 which is followed by the string "poky-linux". For this example, the
277 command sources a script from the default SDK installation directory
278 that uses the 32-bit Intel x86 Architecture and the &DISTRO_NAME; Yocto
279 Project release::
280
281 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
282
283 Another example is sourcing the environment setup directly in a Yocto
284 build::
285
286 $ source tmp/deploy/images/qemux86-64/environment-setup-core2-64-poky-linux
287
288#. *Create the Makefile:* For this example, the Makefile contains
289 two lines that can be used to set the :term:`CC` variable. One line is
290 identical to the value that is set when you run the SDK environment
291 setup script, and the other line sets :term:`CC` to "gcc", the default
292 GNU compiler on the build host::
293
294 # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux
295 # CC="gcc"
296 all: main.o module.o
297 ${CC} main.o module.o -o target_bin
298 main.o: main.c module.h
299 ${CC} -I . -c main.c
300 module.o: module.c module.h
301 ${CC} -I . -c module.c
302 clean:
303 rm -rf *.o
304 rm target_bin
305
306#. *Make the Project:* Use the ``make`` command to create the binary
307 output file. Because variables are commented out in the Makefile, the
308 value used for :term:`CC` is the value set when the SDK environment setup
309 file was run::
310
311 $ make
312 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
313 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
314 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
315
316 From the results of the previous command, you can see that
317 the compiler used was the compiler established through the :term:`CC`
318 variable defined in the setup script.
319
320 You can override the :term:`CC` environment variable with the same
321 variable as set from the Makefile by uncommenting the line in the
322 Makefile and running ``make`` again::
323
324 $ make clean
325 rm -rf *.o
326 rm target_bin
327 #
328 # Edit the Makefile by uncommenting the line that sets CC to "gcc"
329 #
330 $ make
331 gcc -I . -c main.c
332 gcc -I . -c module.c
333 gcc main.o module.o -o target_bin
334
335 As shown in the previous example, the
336 cross-toolchain compiler is not used. Rather, the default compiler is
337 used.
338
339 This next case shows how to override a variable by providing the
340 variable as part of the command line. Go into the Makefile and
341 re-insert the comment character so that running ``make`` uses the
342 established SDK compiler. However, when you run ``make``, use a
343 command-line argument to set :term:`CC` to "gcc"::
344
345 $ make clean
346 rm -rf *.o
347 rm target_bin
348 #
349 # Edit the Makefile to comment out the line setting CC to "gcc"
350 #
351 $ make
352 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
353 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
354 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
355 $ make clean
356 rm -rf *.o
357 rm target_bin
358 $ make CC="gcc"
359 gcc -I . -c main.c
360 gcc -I . -c module.c
361 gcc main.o module.o -o target_bin
362
363 In the previous case, the command-line argument overrides the SDK
364 environment variable.
365
366 In this last case, edit Makefile again to use the "gcc" compiler but
367 then use the "-e" option on the ``make`` command line::
368
369 $ make clean
370 rm -rf *.o
371 rm target_bin
372 #
373 # Edit the Makefile to use "gcc"
374 #
375 $ make
376 gcc -I . -c main.c
377 gcc -I . -c module.c
378 gcc main.o module.o -o target_bin
379 $ make clean
380 rm -rf *.o
381 rm target_bin
382 $ make -e
383 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
384 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
385 i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
386
387 In the previous case, the "-e" option forces ``make`` to
388 use the SDK environment variables regardless of the values in the
389 Makefile.
390
391#. *Execute Your Project:* To execute the project (i.e. ``target_bin``),
392 use the following command::
393
394 $ ./target_bin
395 Hello World!
396
397 .. note::
398
399 If you used the cross-toolchain compiler to build
400 target_bin
401 and your build host differs in architecture from that of the
402 target machine, you need to run your project on the target device.
403
404 As expected, the project displays the "Hello World!" message.