common-usage.txt 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. Daily use
  4. ---------
  5. Understanding when a full rebuild is necessary
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. OpenADK tries to detect what part of the system should be rebuilt when the
  8. system configuration is changed through +make menuconfig+. In some cases it
  9. automatically rebuilds packages, but sometimes just a warning is printed to the
  10. terminal, that a rebuild is necessary to make the changes an effect. If strange
  11. things are happening, the autodetection might have not worked correctly, then
  12. you should consider to rebuild everything. If you are following development you
  13. should always do a full rebuild after fetching updates via +git pull+. It is
  14. not always required, but if anything fails, you are on your own.
  15. Use following to do a full rebuild without refetching distfiles:
  16. --------------------
  17. $ make cleandir && make
  18. --------------------
  19. Understanding how to rebuild packages
  20. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  21. In OpenADK you can rebuild a single package with:
  22. --------------------
  23. $ make package=<pkgname> clean package
  24. --------------------
  25. It will automatically remove all files added to the staging target directory
  26. +target_*+. If you just want to restart compilation process, after making
  27. some fixes in +build_*/w-<pkgname>-<pkgversion>/+, just do:
  28. --------------------
  29. $ make package=<pkgname> package
  30. --------------------
  31. If you are happy with your changes to the package sources, you can automatically
  32. generate a patch, which will be saved in +package/<pkgname>/patches+ and automatically
  33. applied on the next clean rebuild:
  34. --------------------
  35. $ make package=<pkgname> update-patches
  36. --------------------
  37. The newly created patches will be opened in $EDITOR, so you can add some comments to
  38. the top of the file, before the diff.
  39. Offline builds
  40. ~~~~~~~~~~~~~~
  41. If you intend to do an offline build and just want to download
  42. all sources that you previously selected in the configurator
  43. then issue:
  44. --------------------
  45. $ make download
  46. --------------------
  47. You can now disconnect or copy the content of your +dl+
  48. directory to the build-host.
  49. [[env-vars]]
  50. Environment variables
  51. ~~~~~~~~~~~~~~~~~~~~~
  52. OpenADK also honors some environment variables, when they are passed
  53. to +make+. The most useful and common ones are:
  54. * +ADK_APPLIANCE+, the appliance task you want to build
  55. * +ADK_CUSTOM_TASKS_DIR+, extra directory to fetch tasks from
  56. * +ADK_TARGET_OS+, the operating system of the target system
  57. * +ADK_TARGET_ARCH+, the architecture of the target system
  58. * +ADK_TARGET_CPU+, the specific CPU optimization for the target system (f.e. cortex-a53)
  59. * +ADK_TARGET_SYSTEM+, the embedded target system name
  60. * +ADK_TARGET_LIBC+, the C library for the target system
  61. * +ADK_TARGET_ABI+, the ABI for the target system (f.e. MIPS N64)
  62. * +ADK_TARGET_ENDIAN+, the endianess for the target system (little/big)
  63. * +ADK_TARGET_BINFMT+, the binary format for the target system (f.e. ELF/FLAT/FDPIC)
  64. * +ADK_TARGET_FLOAT+, the float support for the target system (f.e. soft/softfp/hard)
  65. * +ADK_TARGET_FS+, the firmware type or root filesystem for the target system
  66. * +ADK_VERBOSE+, verbose build, when set to 1
  67. An example that creates a configuration file for Raspberry PI with all
  68. software packages enabled, but not included in the resulting firmware image:
  69. --------------------
  70. $ make ADK_APPLIANCE=new ADK_TARGET_ARCH=arm ADK_TARGET_SYSTEM=raspberry-pi ADK_TARGET_LIBC=musl allmodconfig
  71. --------------------
  72. This is often used in the development process of a target system, to verify that
  73. all packages are compilable.