0344e1a7eca3571005e9879f73711c06f1db88e8
[openwrt/openwrt.git] / toolchain / gcc / minimal / Makefile
1 GCC_VARIANT:=minimal
2
3 include ../common.mk
4
5 GCC_CONFIGURE += \
6 --with-newlib \
7 --without-headers \
8 --enable-languages=c \
9 --disable-libsanitizer \
10 --disable-libssp \
11 --disable-shared \
12 --disable-threads
13
14 define Host/SetToolchainInfo
15 $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk
16 $(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk
17 endef
18
19 define Host/Prepare
20 $(call Host/SetToolchainInfo)
21 $(call Host/Prepare/Default)
22 ln -snf $(GCC_DIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
23 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
24 $(SED) 's,^MULTILIB_OSDIRNAMES,# MULTILIB_OSDIRNAMES,' $(HOST_BUILD_DIR)/gcc/config/*/t-*
25 $(SED) 'd' $(HOST_BUILD_DIR)/gcc/DEV-PHASE
26 $(SED) 's, DATESTAMP,,' $(HOST_BUILD_DIR)/gcc/version.c
27 #(cd $(HOST_BUILD_DIR)/libstdc++-v3; autoconf;);
28 $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_BUILD_DIR)/libstdc++-v3/configure
29 mkdir -p $(GCC_BUILD_DIR)
30 endef
31
32 define Host/Compile
33 +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all-gcc all-target-libgcc
34 endef
35
36 define Host/Install
37 $(GCC_MAKE) -C $(GCC_BUILD_DIR) install-gcc install-target-libgcc
38 endef
39
40 define Host/Clean
41 rm -rf \
42 $(HOST_BUILD_DIR) \
43 $(GCC_BUILD_DIR)
44 endef
45
46 $(eval $(call HostBuild))