| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | // -*- mode:doc; -*-// vim: set syntax=asciidoc:Infrastructure for host packages~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[[host-package-tutorial]]First, let's see how to write a +Makefile+ for an host only package, requiredby another target package to build, with an example:------------------------01: # This file is part of the OpenADK project. OpenADK is copyrighted02: # material, please see the LICENCE file in the top-level directory.03:04: include $(ADK_TOPDIR)/rules.mk05:06: PKG_NAME:=              hostfoo07: PKG_VERSION:=           1.008: PKG_RELEASE:=           109: PKG_HASH:=              62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd158710: PKG_DESCR:=             hostfoo utility11: PKG_SECTION:=           misc12: PKG_URL:=               http://www.foo.org/13: PKG_SITES:=             http://download.foo.org/14:15: PKG_CFLINE_HOSTFOO:=    depends on ADK_HOST_ONLY16:17: include $(ADK_TOPDIR)/mk/host.mk18: include $(ADK_TOPDIR)/mk/package.mk19:20: $(eval $(call HOST_template,HOSTFOO,hostfoo,$(PKG_VERSION)-${PKG_RELEASE}))21:22: HOST_STYLE:=            auto23:24: include ${ADK_TOPDIR}/mk/host-bottom.mk25: include ${ADK_TOPDIR}/mk/pkg-bottom.mk------------------------The differences to a target package is the inclusion of +mk/host.mk+ in line 17 and+mk/host-bottom.mk+ in line 24. Furthermore the HOST_template is called instead ofthe PKG_template. The last difference is the usage of +PKG_CFLINE_HOSTFOO+ to markthe package as host only package.Following mix between host and target package is possible, too:------------------------01: # This file is part of the OpenADK project. OpenADK is copyrighted02: # material, please see the LICENCE file in the top-level directory.03:04: include ${ADK_TOPDIR}/rules.mk05:06: PKG_NAME:=		foo07: PKG_VERSION:=	1.008: PKG_RELEASE:=	109: PKG_HASH:=          62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd158710: PKG_DESCR:=		foo tool11: PKG_SECTION:=	lang12: PKG_BUILDDEP:=	foo-host13: PKG_URL:=		http://www.foo.org/14: PKG_SITES:=		http://download.foo.org/15:16: include ${ADK_TOPDIR}/mk/host.mk17: include ${ADK_TOPDIR}/mk/package.mk18:19: $(eval $(call HOST_template,FOO,foo,${PKG_VERSION}-${PKG_RELEASE}))20: $(eval $(call PKG_template,FOO,foo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))21:22: HOST_STYLE:=	auto23:24: foo-install:25:	${INSTALL_DIR} ${IDIR_FOO}/usr/bin26:	${INSTALL_BIN} ${WRKINST}/usr/bin/foo ${IDIR_FOO}/usr/bin27:28: include ${ADK_TOPDIR}/mk/host-bottom.mk29: include ${ADK_TOPDIR}/mk/pkg-bottom.mk------------------------If you need to rebuild a mixed package, you can do:------------ $ make package=<package> hostclean hostpackage clean package------------If your host package have some dependencies, use following:------------ HOST_BUILDDEP:=libbaz-host bar-host------------
 |