$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
mkdir -p $(BINUTILS_DIR1)
- (cd $(BINUTILS_DIR1); CC=$(HOSTCC) \
- CC_FOR_HOST=$(HOSTCC) \
- CXX_FOR_HOST=$(HOSTCC) \
+ (cd $(BINUTILS_DIR1); CC="$(HOSTCC)" \
+ CC_FOR_HOST="$(HOSTCC)" \
+ CXX_FOR_HOST="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
$(BINUTILS_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_HOST_NAME) \
touch $(BINUTILS_DIR1)/.configured
$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
- $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+ $(MAKE) $(JLEVEL) CC_FOR_HOST="$(HOSTCC)" \
+ CXX_FOR_HOST="$(HOSTCC)" LDFLAGS="$(HOSTLDFLAGS)" \
-C $(BINUTILS_DIR1);
$(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump
- $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+ $(MAKE) $(JLEVEL) CC_FOR_HOST="$(HOSTCC)" \
+ CXX_FOR_HOST="$(HOSTCC)" LDFLAGS="$(HOSTLDFLAGS)" \
-C $(BINUTILS_DIR1) install;
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
mkdir -p $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin
mkdir -p $(STAGING_DIR)/usr/include/
mkdir -p $(STAGING_DIR)/usr/lib/
- $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ar rv $(STAGING_DIR)/lib/libg.a;
+ $(TARGET_CROSS)ar rv $(STAGING_DIR)/lib/libg.a;
cp $(BINUTILS_DIR)/include/ansidecl.h $(STAGING_DIR)/usr/include/
cp $(BINUTILS_DIR)/include/bfdlink.h $(STAGING_DIR)/usr/include/
cp $(BINUTILS_DIR)/include/dis-asm.h $(STAGING_DIR)/usr/include/
(cd $(BINUTILS_DIR2); \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
- CC_FOR_BUILD=$(HOSTCC) \
- CXX_FOR_BUILD=$(HOSTCC) \
+ CC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
AR_FOR_TARGET=$(TARGET_CROSS)ar \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
$(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
- CC_FOR_BUILD=$(HOSTCC) \
- CXX_FOR_BUILD=$(HOSTCC) \
+ CC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
AR_FOR_TARGET=$(TARGET_CROSS)ar \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
$(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump
$(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
- CC_FOR_BUILD=$(HOSTCC) \
- CXX_FOR_BUILD=$(HOSTCC) \
+ CC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
AR_FOR_TARGET=$(TARGET_CROSS)ar \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
echo -e "#!/bin/sh\nexec $(GCC_BUILD_DIR1)/gcc/xgcc -B$(GCC_BUILD_DIR1)/gcc/ -B$(STAGING_DIR)/arm-linux/bin/ -B$(STAGING_DIR)/arm-linux/lib/ -isystem $(STAGING_DIR)/arm-linux/include $(TARGET_SOFT_FLOAT) \$$@" > $(GCC_BUILD_DIR1)/target_gcc
chmod a+x $(GCC_BUILD_DIR1)/target_gcc
(cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) AR=$(TARGET_CROSS)ar \
- RANLIB=$(TARGET_CROSS)ranlib CC=$(HOSTCC) \
+ RANLIB=$(TARGET_CROSS)ranlib \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
gcc_cv_as_hidden=no \
$(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-linux-ar \
RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-linux-ranlib \
CC_FOR_TARGET=$(GCC_BUILD_DIR1)/target_gcc \
touch $(GCC_BUILD_DIR1)/.compiled
$(STAGING_DIR)/bin/$(ARCH)-linux-gcc: $(GCC_BUILD_DIR1)/.compiled
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) install;
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
+ -C $(GCC_BUILD_DIR1) install;
#Cleanup then mess when --program-prefix mysteriously fails
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-linux-cpp
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-linux-gcc
chmod a+x $(GCC_BUILD_DIR2)/target_gcc
(cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) AR=$(TARGET_CROSS)ar \
RANLIB=$(TARGET_CROSS)ranlib LD=$(TARGET_CROSS)ld \
- NM=$(TARGET_CROSS)nm CC=$(HOSTCC) \
+ NM=$(TARGET_CROSS)nm \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
gcc_cv_as_hidden=no \
$(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
touch $(GCC_BUILD_DIR2)/.configured
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) \
- CC=$(HOSTCC) \
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
AR_FOR_TARGET=$(TARGET_CROSS)ar RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
LD_FOR_TARGET=$(TARGET_CROSS)ld NM_FOR_TARGET=$(TARGET_CROSS)nm \
CC_FOR_TARGET=$(GCC_BUILD_DIR2)/target_gcc \
GCC_FOR_TARGET=$(GCC_BUILD_DIR2)/target_gcc \
CXX_FOR_TARGET=$(GCC_BUILD_DIR2)/target_g++
+ -C $(GCC_BUILD_DIR2)
touch $(GCC_BUILD_DIR2)/.compiled
$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled $(STAGING_DIR)/lib/libc.a
- PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install;
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
+ -C $(GCC_BUILD_DIR2) install;
-mv $(STAGING_DIR)/bin/gcc $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/protoize $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/unprotoize $(STAGING_DIR)/usr/bin;
LD_FOR_BUILD=ld \
NM_FOR_BUILD=nm \
RANLIB_FOR_BUILD=ranlib \
- HOST_CC=$(HOSTCC) \
- CC_FOR_BUILD=$(HOSTCC) \
- GCC_FOR_BUILD=$(HOSTCC) \
- CXX_FOR_BUILD=$(HOSTCC) \
+ CC="$(HOSTCC)" \
+ LDFLAGS="$(HOSTLDFLAGS)" \
+ CC_FOR_BUILD="$(HOSTCC)" \
+ GCC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCC)" \
AR_FOR_TARGET=$(TARGET_CROSS)ar \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \