add setpwc package
[openwrt.git] / obsolete-buildroot / make / binutils-uclibc.mk
1 #############################################################
2 #
3 # build binutils for use on the host system
4 #
5 #############################################################
6 BINUTILS_SITE:=http://ftp.kernel.org/pub/linux/devel/binutils
7 BINUTILS_SOURCE:=binutils-2.14.90.0.7.tar.bz2
8 BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-2.14.90.0.7
9 BINUTILS_CAT:=bzcat
10
11 BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-build
12
13 $(DL_DIR)/$(BINUTILS_SOURCE):
14 $(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
15
16 $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
17 mkdir -p $(TOOL_BUILD_DIR)
18 mkdir -p $(DL_DIR)
19 $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xvf -
20 touch $(BINUTILS_DIR)/.unpacked
21
22 $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
23 # Apply any files named binutils-*.patch from the source directory to binutils
24 $(SOURCE_DIR)/patch-kernel.sh $(BINUTILS_DIR) $(SOURCE_DIR) binutils-uclibc*.patch
25 touch $(BINUTILS_DIR)/.patched
26
27 $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
28 mkdir -p $(BINUTILS_DIR1)
29 (cd $(BINUTILS_DIR1); \
30 $(BINUTILS_DIR)/configure \
31 --prefix=$(STAGING_DIR) \
32 --build=$(GNU_HOST_NAME) \
33 --host=$(GNU_HOST_NAME) \
34 --target=$(REAL_GNU_TARGET_NAME) \
35 $(DISABLE_NLS) \
36 $(MULTILIB) \
37 $(SOFT_FLOAT_CONFIG_OPTION) );
38 touch $(BINUTILS_DIR1)/.configured
39
40 $(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
41 $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR1) all
42
43 # Make install will put gettext data in staging_dir/share/locale.
44 # Unfortunatey, it isn't configureable.
45 $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump
46 $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR1) install
47
48 binutils-dependancies:
49 @if [ -z "`which bison`" ] ; then \
50 echo -e "\n\nYou must install 'bison' on your build machine\n"; \
51 exit 1; \
52 fi;
53 @if [ -z "`which flex`" ] ; then \
54 echo -e "\n\nYou must install 'flex' on your build machine\n"; \
55 exit 1; \
56 fi;
57 @if [ -z "`which msgfmt`" ] ; then \
58 echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
59 exit 1; \
60 fi;
61
62 binutils: binutils-dependancies $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld
63
64 binutils-source: $(DL_DIR)/$(BINUTILS_SOURCE)
65
66 binutils-clean:
67 rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
68 -$(MAKE) -C $(BINUTILS_DIR1) clean
69
70 binutils-dirclean:
71 rm -rf $(BINUTILS_DIR1)
72
73
74
75 #############################################################
76 #
77 # build binutils for use on the target system
78 #
79 #############################################################
80 BINUTILS_DIR2:=$(BUILD_DIR)/binutils-target
81 $(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
82 mkdir -p $(BINUTILS_DIR2)
83 (cd $(BINUTILS_DIR2); \
84 PATH=$(TARGET_PATH) \
85 CFLAGS="$(TARGET_CFLAGS)" \
86 CFLAGS_FOR_BUILD="-O2 -g" \
87 $(BINUTILS_DIR)/configure \
88 --prefix=/usr \
89 --exec-prefix=/usr \
90 --build=$(GNU_HOST_NAME) \
91 --host=$(REAL_GNU_TARGET_NAME) \
92 --target=$(REAL_GNU_TARGET_NAME) \
93 $(DISABLE_NLS) \
94 $(MULTILIB) \
95 $(SOFT_FLOAT_CONFIG_OPTION) );
96 touch $(BINUTILS_DIR2)/.configured
97
98 $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
99 PATH=$(TARGET_PATH) \
100 $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) all
101
102 $(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump
103 PATH=$(TARGET_PATH) \
104 $(MAKE) $(JLEVEL) DESTDIR=$(TARGET_DIR) \
105 tooldir=/usr build_tooldir=/usr \
106 -C $(BINUTILS_DIR2) install
107 #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
108 # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
109 -$(STRIP) $(TARGET_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/* > /dev/null 2>&1
110 -$(STRIP) $(TARGET_DIR)/usr/bin/* > /dev/null 2>&1
111
112 binutils_target: $(GCC_DEPENDANCY) $(TARGET_DIR)/usr/bin/ld
113
114 binutils_target-clean:
115 rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
116 -$(MAKE) -C $(BINUTILS_DIR2) clean
117
118 binutils_target-dirclean:
119 rm -rf $(BINUTILS_DIR2)
120
This page took 0.048422 seconds and 5 git commands to generate.