added package schedtool
[openadk.git] / toolchain / glibc / Makefile
blobcecb784c989dc34c4e9dfe86ca023f177a2c6c8c
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 include $(ADK_TOPDIR)/rules.mk
5 include ../rules.mk
7 TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS))
9 # glibc does not compile with Os
10 TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
11 ifneq ($(ADK_DEBUG),)
12 TARGET_CFLAGS+= -O2
13 endif
15 include Makefile.inc
16 include ${ADK_TOPDIR}/mk/buildhlp.mk
18 GLIBC_MAKEOPTS+= cross-compiling=yes
19 ifeq (${ADK_MAKE_PARALLEL},y)
20 GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"
21 endif
24 GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
25 GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
27 $(WRKBUILD)/.headers_configure:
28 mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
29 (cd $(GLIBC_BUILD_DIR_INITIAL); \
30 ${GLIBC_ENV} \
31 $(WRKBUILD)/configure \
32 --prefix=$(STAGING_TARGET_DIR)/usr \
33 --with-sysroot=$(STAGING_TARGET_DIR) \
34 ${GLIBC_CONFOPTS} \
36 touch $@
38 $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
39 (cd $(GLIBC_BUILD_DIR_INITIAL); \
40 ${GLIBC_ENV} \
41 $(MAKE) ${GLIBC_MAKEOPTS} install-headers \
43 touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
44 touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64,soft,hard}.h
45 touch $@
47 $(WRKBUILD)/.configured:
48 mkdir -p $(GLIBC_BUILD_DIR_FINAL)
49 (cd $(GLIBC_BUILD_DIR_FINAL); \
50 ${GLIBC_ENV} \
51 $(WRKBUILD)/configure \
52 --prefix=/usr \
53 --enable-shared \
54 --enable-stackguard-randomization \
55 ${GLIBC_CONFOPTS} \
57 touch $@
59 $(WRKBUILD)/.compiled:
60 ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} asm-CPPFLAGS='$${CFLAGS}' -C $(GLIBC_BUILD_DIR_FINAL) all
61 touch $@
63 $(WRKBUILD)/.installed:
64 ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
65 mkdir -p ${STAGING_TARGET_DIR}/etc
66 ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
67 ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
68 touch $@
70 $(WRKBUILD)/.fixup:
71 -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
72 rm -rf $(STAGING_TARGET_DIR)/usr/share/locale $(STAGING_TARGET_DIR)/usr/share/i18n
73 ifeq ($(ADK_TARGET_TOOLCHAIN),y)
74 # strip target libs and host tools for toolchain builds
75 PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
76 $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME)
77 debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin
78 endif
79 touch $@
81 include ${ADK_TOPDIR}/mk/toolchain.mk