| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:guide-developer:toolchain:use-buildsystem [2023/12/08 08:51] – [Make tips] make checksum javad.rahimi | docs:guide-developer:toolchain:use-buildsystem [2024/10/16 18:12] (current) – [Build system usage] jannoke |
|---|
| </WRAP> | </WRAP> |
| |
| After [[docs:guide-developer:toolchain:install-buildsystem|setting up]] a build system, these are typical build steps: | After [[docs:guide-developer:toolchain:install-buildsystem|installing your build system's prerequisites]], these are typical build steps: |
| |
| <code bash> | <code bash> |
| git branch -a | git branch -a |
| git tag | git tag |
| git checkout v23.05.0 | git checkout v23.05.5 |
| |
| # Update the feeds | # Update the feeds |
| - Create a dir: ''mkdir -p <buildroot>/my_packages/<section>/<category>/<package_name>''.\\ Replace the ''<package_name>'' with the name of your package.\\ e.g. ''mkdir -p my_packages/net/network/rpcbind''.\\ The section and category can be found in the ''Makefile''. | - Create a dir: ''mkdir -p <buildroot>/my_packages/<section>/<category>/<package_name>''.\\ Replace the ''<package_name>'' with the name of your package.\\ e.g. ''mkdir -p my_packages/net/network/rpcbind''.\\ The section and category can be found in the ''Makefile''. |
| - Write a Makefile or download one ''Makefile'' from another package, look at samples on github.\\ Edit your Makefile and add necessary files, sources...\\ More: [[docs:guide-developer:packages|Creating packages]] & [[docs:guide-developer:helloworld:chapter3|Creating a package from your application]]\\ | - Write a Makefile or download one ''Makefile'' from another package, look at samples on github.\\ Edit your Makefile and add necessary files, sources...\\ More: [[docs:guide-developer:packages|Creating packages]] & [[docs:guide-developer:helloworld:chapter3|Creating a package from your application]]\\ |
| - Append a line with your custom feed to ''feeds.conf.default'':\\ ''src-link my_packages <buildroot>/my_packages''\\ Replace the ''<buildroot>'' with cloned openwrt sources directory e.g. ''~/openwrt''\\ Move the line with your custom feed above standard feeds to override them.\\ | - Append a line with your custom feed to ''feeds.conf.default'':\\ ''src-link my_packages <buildroot>/my_packages''\\ Replace the ''<buildroot>'' with cloned openwrt sources directory e.g. ''/home///user///openwrt'' (the path must be absolute).\\ Move the line with your custom feed above standard feeds to override them.\\ |
| - Now run: ''./scripts/feeds update -a; ./scripts/feeds install <package_name>''\\ If you are doing this to resolve a dependency you can run ''./scripts/feeds install <package_name>'' one more time and you should notice the dependency has been resolved.\\ | - Now run: ''./scripts/feeds update -a; ./scripts/feeds install <package_name>''\\ If you are doing this to resolve a dependency you can run ''./scripts/feeds install <package_name>'' one more time and you should notice the dependency has been resolved.\\ |
| - Build your package.\\ Select it in the menu of ''Make menuconfig''\\ Build it with ''make package/my_package/{clean,compile}''\\ More: [[docs:guide-developer:toolchain:single.package|Building a single package]]\\ | - Build your package.\\ Select it in the menu of ''Make menuconfig''\\ Build it with ''make package///my_package_name///{clean,compile}''\\ More: [[docs:guide-developer:toolchain:single.package|Building a single package]]\\ |
| |
| ===== Selecting code revision ===== | ===== Selecting code revision ===== |
| :!: Also you won't be able to install kernel packages from the official repositories when you make changes here. | :!: Also you won't be able to install kernel packages from the official repositories when you make changes here. |
| |
| While you won't typically need to do this, you can do it: | While you won't typically need to do this, first define the target, subtarget, and device in a ''.config'', for example: |
| | <code bash> |
| | CONFIG_TARGET_x86=y |
| | CONFIG_TARGET_x86_64=y |
| | CONFIG_TARGET_x86_64_DEVICE_generic=y |
| | </code> |
| |
| | Now run the following where subtarget is not a variable, it is a literal and it references the ''.config'' we just created (in this case x86/64): |
| <code bash> | <code bash> |
| make kernel_menuconfig CONFIG_TARGET=subtarget | make kernel_menuconfig CONFIG_TARGET=subtarget |
| Use only if you need a "factory reset" of the build system! | Use only if you need a "factory reset" of the build system! |
| |
| |
| ==== Cacheclean ==== | |
| <code bash> | |
| make cacheclean | |
| </code> | |
| |
| If compiler cache is enabled (''CONFIG_CCACHE''), this command will cleans the compiler cache directory. The default directory is ''./.ccache''. For more information please visit [[https://ccache.samba.org/|ccache]] website. | |
| |
| ==== Selective cleanup ==== | ==== Selective cleanup ==== |