add host package
[openadk.git] / mk / host-bottom.mk
blob303e3a93c9272c906c0f29ce94b0bce42ca9b814
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 host-extract: ${_HOST_PATCH_COOKIE}
6 hostpre-configure:
7 host-configure:
8 ${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
9 @mkdir -p ${WRKBUILD}
10 @$(CMD_TRACE) "host configuring... "
11 ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
12 @$(CMD_TRACE) "autotool configuring... "
13 @cd ${WRKSRC}; env ${AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
14 endif
15 ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
16 cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoreconf -if $(MAKE_TRACE)
17 @rm -rf ${WRKSRC}/autom4te.cache
18 @touch ${WRKDIR}/.autoreconf_done
19 endif
20 @cd ${WRKBUILD}; \
21 for i in $$(find . -name config.sub);do \
22 if [ -f $$i ]; then \
23 ${CP} ${SCRIPT_DIR}/config.sub $$i; \
24 fi; \
25 done; \
26 for i in $$(find . -name config.guess);do \
27 if [ -f $$i ]; then \
28 ${CP} ${SCRIPT_DIR}/config.guess $$i; \
29 fi; \
30 done;
31 @${MAKE} hostpre-configure $(MAKE_TRACE)
32 ifeq (${HOST_STYLE},)
33 cd ${WRKBUILD}; \
34 env ${HOST_CONFIGURE_ENV} \
35 ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
36 --program-prefix= \
37 --program-suffix= \
38 --prefix=${STAGING_HOST_DIR}/usr \
39 --bindir=${STAGING_HOST_DIR}/usr/bin \
40 --datadir=${STAGING_HOST_DIR}/usr/share \
41 --mandir=${STAGING_HOST_DIR}/usr/share/man \
42 --libexecdir=${STAGING_HOST_DIR}/usr/libexec \
43 --sysconfdir=${STAGING_HOST_DIR}/etc \
44 --disable-dependency-tracking \
45 --disable-libtool-lock \
46 --disable-nls \
47 ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
48 endif
49 ifeq (${HOST_STYLE},auto)
50 cd ${WRKBUILD}; \
51 env ${HOST_CONFIGURE_ENV} \
52 ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
53 --program-prefix= \
54 --program-suffix= \
55 --prefix=/usr \
56 --bindir=/usr/bin \
57 --datadir=/usr/share \
58 --mandir=/usr/share/man \
59 --libexecdir=/usr/libexec \
60 --localstatedir=/var \
61 --sysconfdir=/etc \
62 --disable-dependency-tracking \
63 --disable-libtool-lock \
64 --disable-nls \
65 ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
66 endif
67 ifeq (${HOST_STYLE},manual)
68 ${MAKE} host-configure $(MAKE_TRACE)
69 endif
70 ifeq (${HOST_STYLE},perl)
71 @$(CMD_TRACE) "configuring perl module... "
72 cd ${WRKBUILD}; \
73 PATH='${HOST_PATH}' \
74 PERL_MM_USE_DEFAULT=1 \
75 PERL_AUTOINSTALL=--skipdeps \
76 $(HOST_PERL_ENV) \
77 perl-host Makefile.PL ${HOST_CONFIGURE_ARGS}
78 endif
79 touch $@
81 host-build:
82 ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
83 ifneq (${HOST_STYLE},manual)
84 @$(CMD_TRACE) "host compiling... "
85 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
86 ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
87 endif
88 ${MAKE} host-build $(MAKE_TRACE)
89 touch $@
91 hostpost-install:
92 host-install: ${ALL_HOSTINST}
93 ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
94 @$(CMD_TRACE) "host installing... "
95 @mkdir -p ${HOST_WRKINST}
96 ifeq (${HOST_STYLE},)
97 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
98 DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
99 endif
100 ifeq (${HOST_STYLE},auto)
101 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
102 DESTDIR='${STAGING_HOST_DIR}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
103 endif
104 ifeq (${HOST_STYLE},manual)
105 env ${HOST_MAKE_ENV} ${MAKE} host-install $(MAKE_TRACE)
106 endif
107 env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
108 @find $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
109 @for a in $(STAGING_HOST_DIR)/usr/bin/*-config; do \
110 [[ -e $$a ]] || continue; \
111 $(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
112 chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
113 done
114 @touch $@
116 ${_HOST_COOKIE}:
117 exec ${MAKE} hostpackage
119 ifeq ($(HOST_LINUX_ONLY),)
120 hostpackage: ${ALL_HOSTDIRS}
121 @touch ${_HOST_COOKIE}
122 endif
124 hostclean:
125 @$(CMD_TRACE) "cleaning... "
126 rm -rf ${WRKDIR} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}\x01*-host