Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:helloworld:chapter6 [2017/10/14 11:45] – [Modifying the package manifest, and testing the build] ldir | docs:guide-developer:helloworld:chapter6 [2018/12/05 04:52] (current) – [Modifying the package manifest, and testing the build] gth | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Migrating to use GNU make in your application ====== | ====== Migrating to use GNU make in your application ====== | ||
| - | This is the sixth chapter in the “Hello, world!” for LEDE article series. At this point, you should' | + | This is the sixth chapter in the “Hello, world!” for OpenWrt |
| * Commissioned your development environment | * Commissioned your development environment | ||
| Line 11: | Line 11: | ||
| * Created a local package feed for your application | * Created a local package feed for your application | ||
| * Created a package manifest file for your application | * Created a package manifest file for your application | ||
| - | * Included your new package feed into the LEDE build system | + | * Included your new package feed into the OpenWrt |
| * Updated the package index, and installed your package from the feed | * Updated the package index, and installed your package from the feed | ||
| * Built, deployed and tested the application on your target device | * Built, deployed and tested the application on your target device | ||
| Line 35: | Line 35: | ||
| ===== Creating a makefile ===== | ===== Creating a makefile ===== | ||
| - | In order to use GNU make, it is necessary to create a makefile for our test application. When writing the makefile, you will only need to pay attention to the source files of your application; | + | In order to use GNU make, it is necessary to create a makefile for our test application. When writing the makefile, you will only need to pay attention to the source files of your application; |
| Let's change to the source directory of the application and create the makefile: | Let's change to the source directory of the application and create the makefile: | ||
| Line 87: | Line 87: | ||
| make | make | ||
| </ | </ | ||
| + | |||
| + | If you get the message '' | ||
| + | |||
| + | < | ||
| + | touch helloworld.c | ||
| + | make | ||
| + | </ | ||
| + | |||
| This will build the application using the native compilation tools. | This will build the application using the native compilation tools. | ||
| - | You'll see that GNU make will output the steps it took to build the application and that these steps are quite similar to the manual steps you took in chapter 2. If you encounter errors during the process, then one of the most common errors is that the whitespaces at the start of the rows in the makefile are not tab characters. | + | You'll see that GNU '' |
| ===== Modifying the package manifest, and testing the build ===== | ===== Modifying the package manifest, and testing the build ===== | ||
| - | Now that our makefile is created and tested, we can integrated | + | Now that our package' |
| When migrating to use the GNU make tool, you might not need to use hard tabs anymore. However, I find it good practise to use a hard tab at the start of each command row. When using the multi-line separator ' | When migrating to use the GNU make tool, you might not need to use hard tabs anymore. However, I find it good practise to use a hard tab at the start of each command row. When using the multi-line separator ' | ||
| Line 106: | Line 114: | ||
| </ | </ | ||
| - | After modifying your package manifest, test the package build process again from the LEDE build system' | + | After modifying your package manifest, test the package build process again from the OpenWrt |
| < | < | ||
| cd / | cd / | ||
| Line 119: | Line 127: | ||
| ./ | ./ | ||
| </ | </ | ||
| + | |||
| + | If still having issues, ensure your source directory (/ | ||
| ===== Conclusion ===== | ===== Conclusion ===== | ||
| In this lengthy chapter, we modified our original application to use GNU make instead of direct compilation commands. We wrote a simple makefile to evaluate all source code files in the directory, compile them, and link the generated object files into an executable. We then tested the makefile using native compilation tools to ensure it runs properly, and finally modified our package manifest to use the GNU make build process instead of the hard-coded compilation commands. | In this lengthy chapter, we modified our original application to use GNU make instead of direct compilation commands. We wrote a simple makefile to evaluate all source code files in the directory, compile them, and link the generated object files into an executable. We then tested the makefile using native compilation tools to ensure it runs properly, and finally modified our package manifest to use the GNU make build process instead of the hard-coded compilation commands. | ||