Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:helloworld:chapter6 [2018/06/01 08:38] – LEDE -> OpenWrt tmomasdocs:guide-developer:helloworld:chapter6 [2018/12/05 04:52] (current) – [Modifying the package manifest, and testing the build] gth
Line 87: Line 87:
 make make
 </code> </code>
 +
 +If you get the message ''make: Nothing to be done for `all`'' this means the executable is already up to date.  To mimic a change in the code, let's update the source file, then try the make command again:
 +
 +<code>
 +touch helloworld.c
 +make
 +</code>
 +
 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 ''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.
  
 ===== 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 into the package manifest. To do so, we modify the build instructions in the package manifest to contain the necessary instructions. This file is located in ''/home/buildbot/mypackages/examples/helloworld/'' directory.+Now that our package'makefile is created and tested, we can integrate it into the package manifest. To do so, we modify the build instructions in the package manifest to contain the necessary instructions. This file is located in ''/home/buildbot/mypackages/examples/helloworld/'' directory.  Open this particular ''Makefile'' in your preferred editor.
  
 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 '\', the adjacent lines do not need hard tabs. 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 '\', the adjacent lines do not need hard tabs.
Line 119: Line 127:
 ./scripts/feeds install -a -p mypackages ./scripts/feeds install -a -p mypackages
 </code> </code>
 +
 +If still having issues, ensure your source directory (/home/buildbot/helloworld) is cleaned of any *.o files or final executables built for your host rather than OpenWRT (only .c and Makefile).
  
 ===== 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.
  • Last modified: 2018/06/01 08:38
  • by tmomas