• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Building Source Code
2
3
4For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
5
6
7## Prerequisites
8
9- The [required libraries and tools](quickstart-pkg-install-package.md) have been installed.
10
11- The [compilation tools](quickstart-pkg-install-tool.md) have been installed.
12
13- The Hello World program is ready for use.
14
15- The access to the Ubuntu environment is normal.
16
17
18## Procedure
19
20Method 1: using hb for compilation (install [compilation tools](quickstart-pkg-install-tool.md) first)
21
22Go to the root directory of the source code and run the build command.
23
241. Set the build path.
25
26   ```
27   hb set
28   ```
29
302. Select the current path.
31
32   ```
33   .
34   ```
35
363. Select **ipcamera_hispark_taurus** under **hisilicon** and press **Enter**.
37   > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
38   >
39   > When adapting the development board to a specific use case, select an appropriate build form factor, that is, **product** settings. For details, see [Build Form Factors](quickstart-appendix-compiledform.md).
40
41     **Figure 1** Hi3516 build settings
42
43   ![quickstart-lite-3516-build](figures/quickstart-lite-3516-build.png)
44
454. Start building.
46   > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
47   > - To build a component (for example, **hello**), run the **hb build -T *targetName*** command.
48   >
49   > - To build a product incrementally, run the **hb build** command.
50   >
51   > - To build a product from the scratch, run the **hb build -f** command.
52   >
53   > This example builds a product from the scratch.
54
55
56   ```
57   hb build -f
58   ```
59
605. Check the build result. If "build success" is displayed, the building is successful.
61   > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
62   >
63   > Paths to burning-related files:
64   >
65   > - Build result and log files: **out/hispark_taurus/ipcamera_hispark_taurus**
66   >
67   > - U-Boot file: **device/board/hisilicon/hispark_taurus/uboot/out/boot/u-boot-hi3516dv300.bin**
68
69Method 2: using the **build.sh** script for compilation
70
71For details, see [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md).