imgtec-ci20: genimage config/ u-boot env
[openadk.git] / mk / host-bottom.mk
blob21ba5223f18ba1c9135443d6c20c73d596c12686
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 HOST_CONFIG_STYLE?= ${HOST_STYLE}
8 hostpre-configure:
9 host-configure:
10 ${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
11 mkdir -p ${WRKBUILD}
12 ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
13 @$(CMD_TRACE) "autotooling.. "
14 @cd ${WRKSRC}; env ${HOST_AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
15 endif
16 ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
17 cd ${WRKSRC}; env ${HOST_AUTOTOOL_ENV} autoreconf -vif $(MAKE_TRACE)
18 @rm -rf ${WRKSRC}/autom4te.cache
19 @touch ${WRKDIR}/.autoreconf_done
20 endif
21 @${MAKE} hostpre-configure $(MAKE_TRACE)
22 ifeq (${HOST_CONFIG_STYLE},)
23 @$(CMD_TRACE) "configuring.. "
24 cd ${WRKBUILD}; \
25 env ${HOST_CONFIGURE_ENV} \
26 ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
27 --prefix=${STAGING_HOST_DIR}/usr \
28 --bindir=${STAGING_HOST_DIR}/usr/bin \
29 --datadir=${STAGING_HOST_DIR}/usr/share \
30 --mandir=${STAGING_HOST_DIR}/usr/share/man \
31 --libdir=${STAGING_HOST_DIR}/usr/lib \
32 --libexecdir=${STAGING_HOST_DIR}/usr/libexec \
33 --sysconfdir=${STAGING_HOST_DIR}/etc \
34 ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
35 endif
36 ifeq (${HOST_CONFIG_STYLE},auto)
37 @$(CMD_TRACE) "configuring.. "
38 cd ${WRKBUILD}; \
39 env ${HOST_CONFIGURE_ENV} \
40 ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
41 --program-prefix= \
42 --program-suffix= \
43 --prefix=/usr \
44 --bindir=/usr/bin \
45 --datadir=/usr/share \
46 --mandir=/usr/share/man \
47 --libdir=/usr/lib \
48 --libexecdir=/usr/libexec \
49 --localstatedir=/var \
50 --sysconfdir=/etc \
51 --disable-dependency-tracking \
52 --disable-libtool-lock \
53 --disable-nls \
54 ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
55 endif
56 ifeq (${HOST_CONFIG_STYLE},cmake)
57 @$(CMD_TRACE) "configuring cmake.. "
58 cd ${WRKBUILD}; PATH='${HOST_PATH}' \
59 cmake -Wno-dev -DCMAKE_INSTALL_PREFIX:PATH=$(STAGING_HOST_DIR)/usr \
60 ${HOST_CMAKE_FLAGS} ${WRKSRC} $(MAKE_TRACE)
61 endif
62 ifeq (${HOST_CONFIG_STYLE},meson)
63 @$(CMD_TRACE) "configuring meson.. "
64 cd ${WRKSRC}; env PATH='${HOST_PATH}' CPPFLAGS='$(HOST_CPPFLAGS)' \
65 LDFLAGS='$(HOST_LDFLAGS)' CFLAGS='$(HOST_CFLAGS)' \
66 meson setup --prefix $(STAGING_HOST_DIR)/usr \
67 --pkg-config-path $(STAGING_HOST_DIR)/usr/lib/pkgconfig \
68 --buildtype release $(HOST_MESON_FLAGS) \
69 $(WRKSRC) $(WRKBUILD) $(MAKE_TRACE)
70 endif
71 ifeq (${HOST_CONFIG_STYLE},perl)
72 @$(CMD_TRACE) "configuring perl module.. "
73 cd ${WRKBUILD}; \
74 PATH='${HOST_PATH}' \
75 PERL_MM_USE_DEFAULT=1 \
76 PERL_AUTOINSTALL=--skipdeps \
77 $(HOST_PERL_ENV) \
78 perl-host Makefile.PL ${HOST_CONFIGURE_ARGS}
79 endif
80 ifeq (${HOST_CONFIG_STYLE},manual)
81 @$(CMD_TRACE) "configuring.. "
82 ${MAKE} host-configure $(MAKE_TRACE)
83 endif
84 touch $@
86 host-build:
87 ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
88 @$(CMD_TRACE) "compiling.. "
89 ifneq ($(filter meson,${HOST_STYLE}),)
90 PATH='$(HOST_PATH)' ninja -v -C $(WRKBUILD) $(MAKE_TRACE)
91 else ifneq (${HOST_STYLE},manual)
92 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \
93 ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
94 endif
95 ${MAKE} host-build $(MAKE_TRACE)
96 touch $@
98 HOST_INSTALL_STYLE?= ${HOST_STYLE}
100 hostpost-install:
101 host-install: ${ALL_HOSTINST}
102 ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
103 @$(CMD_TRACE) "installing.. "
104 @mkdir -p ${HOST_WRKINST}
105 ifeq (${HOST_INSTALL_STYLE},)
106 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
107 DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
108 endif
109 ifeq (${HOST_INSTALL_STYLE},auto)
110 cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
111 DESTDIR='${STAGING_HOST_DIR}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
112 endif
113 ifeq (${HOST_INSTALL_STYLE},meson)
114 DESTDIR='' PATH='$(HOST_PATH)' \
115 ninja -C $(WRKBUILD) install $(MAKE_TRACE)
116 endif
117 ifeq (${HOST_INSTALL_STYLE},manual)
118 env ${HOST_MAKE_ENV} ${MAKE} host-install $(MAKE_TRACE)
119 endif
120 env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
121 @find $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
122 @for a in $(STAGING_HOST_DIR)/usr/bin/*-config; do \
123 [[ -e $$a ]] || continue; \
124 $(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
125 chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
126 done
127 touch $@
129 ${_HOST_COOKIE}:
130 exec ${MAKE} hostpackage
132 ifeq ($(HOST_LINUX_ONLY),)
133 hostpackage: ${ALL_HOSTDIRS}
134 @touch ${_HOST_COOKIE}
135 endif
137 hostclean:
138 @printf " ---> cleaning host package build directories and files.. "
139 -rm -rf ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host ${WRKDIR}
140 @printf " done\n"