d1481e0a3605806ff036d1a522e6c6d09cd0ba82
[openwrt/openwrt.git] / toolchain / gcc / initial / Makefile
1 GCC_VARIANT:=initial
2
3 include ../common.mk
4
5 GCC_CONFIGURE += \
6 --with-newlib \
7 --with-sysroot=$(TOOLCHAIN_DIR) \
8 --enable-languages=c \
9 --disable-shared \
10 --disable-threads \
11
12 define Host/Compile
13 $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/
14 +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \
15 all-build-libiberty \
16 all-gcc \
17 $(if $(GCC_BUILD_TARGET_LIBGCC),all-target-libgcc)
18 endef
19
20 define Host/Install
21 $(GCC_MAKE) -C $(GCC_BUILD_DIR) \
22 prefix="$(TOOLCHAIN_DIR)/initial" \
23 install-gcc \
24 $(if $(GCC_BUILD_TARGET_LIBGCC),install-target-libgcc)
25
26 # XXX: glibc insists on linking against libgcc_eh
27 ( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \
28 [ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \
29 cp libgcc.a libgcc_initial.a; \
30 )
31
32 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
33 $$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/)
34 endef
35
36 $(eval $(call HostBuild))