summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/binutils.mk30
-rw-r--r--make/gcc-3.3.mk35
2 files changed, 43 insertions, 22 deletions
diff --git a/make/binutils.mk b/make/binutils.mk
index 85c9eea32..291ee62ce 100644
--- a/make/binutils.mk
+++ b/make/binutils.mk
@@ -33,9 +33,10 @@ $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
$(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) \
@@ -59,11 +60,13 @@ $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
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
@@ -86,7 +89,7 @@ $(STAGING_DIR)/lib/libg.a:
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/
@@ -123,8 +126,9 @@ $(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
(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 \
@@ -147,8 +151,9 @@ $(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
$(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 \
@@ -161,8 +166,9 @@ $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
$(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 \
diff --git a/make/gcc-3.3.mk b/make/gcc-3.3.mk
index 8ae0c4dd9..28212c556 100644
--- a/make/gcc-3.3.mk
+++ b/make/gcc-3.3.mk
@@ -120,7 +120,9 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc3_3_build_hacks
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) \
@@ -147,6 +149,8 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc3_3_build_hacks
$(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 \
@@ -154,7 +158,10 @@ $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
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
@@ -209,7 +216,9 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
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) \
@@ -239,17 +248,22 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
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;
@@ -328,10 +342,11 @@ TARGET_GCC_ARGS= $(TARGET_CONFIGURE_OPTS) \
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 \