xenomai: new package, only mercury for now supported
[openadk.git] / docs / adding-packages-host.txt
blob35cf3ab6c2eff0d0f9eee9f52aa14934f5ec1d35
1 // -*- mode:doc; -*-
2 // vim: set syntax=asciidoc:
4 Infrastructure for host packages
5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 [[host-package-tutorial]]
9 First, let's see how to write a +Makefile+ for an host only package, required
10 by another target package to build, with an example:
12 ------------------------
13 01: # This file is part of the OpenADK project. OpenADK is copyrighted
14 02: # material, please see the LICENCE file in the top-level directory.
15 03:
16 04: include $(ADK_TOPDIR)/rules.mk
17 05:
18 06: PKG_NAME:=              hostfoo
19 07: PKG_VERSION:=           1.0
20 08: PKG_RELEASE:=           1
21 09: PKG_HASH:=              62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd1587
22 10: PKG_DESCR:=             hostfoo utility
23 11: PKG_SECTION:=           misc
24 12: PKG_URL:=               http://www.foo.org/
25 13: PKG_SITES:=             http://download.foo.org/
26 14:
27 15: PKG_CFLINE_HOSTFOO:=    depends on ADK_HOST_ONLY
28 16:
29 17: include $(ADK_TOPDIR)/mk/host.mk
30 18: include $(ADK_TOPDIR)/mk/package.mk
31 19:
32 20: $(eval $(call HOST_template,HOSTFOO,hostfoo,$(PKG_VERSION)-${PKG_RELEASE}))
33 21:
34 22: HOST_STYLE:=            auto
35 23:
36 24: include ${ADK_TOPDIR}/mk/host-bottom.mk
37 25: include ${ADK_TOPDIR}/mk/pkg-bottom.mk
38 ------------------------
40 The differences to a target package is the inclusion of +mk/host.mk+ in line 17 and
41 +mk/host-bottom.mk+ in line 24. Furthermore the HOST_template is called instead of
42 the PKG_template. The last difference is the usage of +PKG_CFLINE_HOSTFOO+ to mark
43 the package as host only package.
45 Following mix between host and target package is possible, too:
46 ------------------------
47 01: # This file is part of the OpenADK project. OpenADK is copyrighted
48 02: # material, please see the LICENCE file in the top-level directory.
49 03:
50 04: include ${ADK_TOPDIR}/rules.mk
51 05:
52 06: PKG_NAME:=          foo
53 07: PKG_VERSION:=       1.0
54 08: PKG_RELEASE:=       1
55 09: PKG_HASH:=          62333167b79afb0b25a843513288c67b59547acf653e8fbe62ee64e71ebd1587
56 10: PKG_DESCR:=         foo tool
57 11: PKG_SECTION:=       lang
58 12: PKG_BUILDDEP:=      foo-host
59 13: PKG_URL:=           http://www.foo.org/
60 14: PKG_SITES:=         http://download.foo.org/
61 15:
62 16: include ${ADK_TOPDIR}/mk/host.mk
63 17: include ${ADK_TOPDIR}/mk/package.mk
64 18:
65 19: $(eval $(call HOST_template,FOO,foo,${PKG_VERSION}-${PKG_RELEASE}))
66 20: $(eval $(call PKG_template,FOO,foo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
67 21:
68 22: HOST_STYLE:=        auto
69 23:
70 24: foo-install:
71 25:     ${INSTALL_DIR} ${IDIR_FOO}/usr/bin
72 26:     ${INSTALL_BIN} ${WRKINST}/usr/bin/foo ${IDIR_FOO}/usr/bin
73 27:
74 28: include ${ADK_TOPDIR}/mk/host-bottom.mk
75 29: include ${ADK_TOPDIR}/mk/pkg-bottom.mk
76 ------------------------
78 If you need to rebuild a mixed package, you can do:
79 ------------
80  $ make package=<package> hostclean hostpackage clean package
81 ------------
83 If your host package have some dependencies, use following:
84 ------------
85  HOST_BUILDDEP:=libbaz-host bar-host
86 ------------