Adding a tool which needs to be compiled for host

  • Hi all!

    I have a tool written in C that needs to be compiled for the host buildsystem. It aggregates DTBs for Amlogic devices which is used as one of the build step when generating the device image.

    How do I go about integrating this into the build system? For starters, I've tried creating a folder dtbTool under the tools folder, then adding tools/dtbTool/dtbTool.c and tools/dtbTool/Makefile, and finally inserting the make and $ROOT/tools/dtbTool/dtbTool commands in scripts/image. However, when the make executes, it generates the binary for the target platform. I know that this is the wrong way to do it, but I had to start from somewhere.

    Edited once, last by SnT2k (December 29, 2016 at 7:06 AM).

  • Thanks for the guidelines.

    Where/how do I "install" it though? Is it alright to do a cp dtbTool $ROOT/tools/dtbTool under makeinstall_host or do I put in under the install target of my makefile?

    Edited once, last by SnT2k (December 29, 2016 at 4:44 PM).

  • Thanks for your guidance! I have no idea on how the build system is structured since the Kodi wiki (assuming the documentation on the build system is there) seems to be down as of the moment.

  • That's the first thing I actually checked! But that's just for compiling though. I was looking for how the directories are structured (e.g. how do the 'patches' in the packages resolved against the 'patches' in the projects?), how the build scripts interact with each other, and what are the entries in package.mk files which look like OpenWRT's package.mk files but slightly different.

    I managed to get most of the info by reading through the scripts and working backwards with the help of nice people here, so all's well and good.

  • The lack of documentation is bad, but also a good n00b filter. Over the years we noticed those who will be successful in their attempts to create custom builds (and have some dev skills) figure out the build system quickly and get on with things relatively unaided as it works logically and already contains a wealth of prior-art which serves as the instruction manual. Those who have no skills or aptitude for the task will continue to ask in forums/IRC for howto guides. It's fairly easy to spot the first group from the questions asked. Carry on :)