]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | # Makefile for to build a gcc/uClibc toolchain |
2 | # | |
3 | # Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org> | |
9badc9e9 | 4 | # Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org> |
cd1a2927 MT |
5 | # |
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 | ||
1d4ec104 | 20 | GCC_VERSION:=4.0.3 |
cd1a2927 | 21 | |
9badc9e9 MT |
22 | ifeq ($(GCC_SNAP_DATE),) |
23 | GCC_OFFICIAL_VER:=$(GCC_VERSION) | |
24 | GCC_SITE:=http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION) | |
25 | #GCC_SITE:=ftp://ftp.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-$(GCC_OFFICIAL_VER) | |
26 | else | |
27 | GCC_OFFICIAL_VER:=$(GCC_VERSION)-$(GCC_SNAP_DATE) | |
28 | GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_OFFICIAL_VER) | |
29 | endif | |
30 | ||
31 | GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2 | |
32 | GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER) | |
33 | GCC_CAT:=bzcat | |
34 | GCC_STRIP_HOST_BINARIES:=true | |
cd1a2927 MT |
35 | |
36 | ############################################################# | |
37 | # | |
38 | # Setup some initial stuff | |
39 | # | |
40 | ############################################################# | |
41 | ||
9badc9e9 MT |
42 | TARGET_LANGUAGES:=c |
43 | ||
cd1a2927 MT |
44 | ifeq ($(INSTALL_LIBSTDCPP),true) |
45 | TARGET_LANGUAGES:=c,c++ | |
46 | else | |
47 | TARGET_LANGUAGES:=c | |
48 | endif | |
49 | ||
50 | ############################################################# | |
51 | # | |
52 | # build the first pass gcc compiler | |
53 | # | |
54 | ############################################################# | |
1d4ec104 | 55 | GCC_BUILD_DIR1:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-initial |
cd1a2927 MT |
56 | |
57 | $(DL_DIR)/$(GCC_SOURCE): | |
9badc9e9 | 58 | # mkdir -p $(DL_DIR) |
cd1a2927 MT |
59 | # $(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE) |
60 | ||
9badc9e9 | 61 | gcc-unpacked: $(GCC_DIR)/.unpacked |
cd1a2927 | 62 | $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE) |
9badc9e9 MT |
63 | mkdir -p $(TOOL_BUILD_DIR) |
64 | $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) -xf - | |
65 | # $(CONFIG_UPDATE) $(GCC_DIR) | |
cd1a2927 MT |
66 | touch $(GCC_DIR)/.unpacked |
67 | ||
9badc9e9 | 68 | gcc-patched: $(GCC_DIR)/.patched |
cd1a2927 MT |
69 | $(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked |
70 | # Apply any files named gcc-*.patch from the source directory to gcc | |
9badc9e9 MT |
71 | ifeq ($(GCC_SNAP_DATE),) |
72 | $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc/$(GCC_VERSION)\*.patch | |
73 | else | |
74 | ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),) | |
75 | $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc/$(GCC_OFFICIAL_VER)\*.patch | |
76 | else | |
77 | $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc/$(GCC_VERSION)\*.patch | |
78 | endif | |
79 | endif | |
cd1a2927 | 80 | |
9badc9e9 MT |
81 | # Note: The soft float situation has improved considerably with gcc 3.4.x. |
82 | # We can dispense with the custom spec files, as well as libfloat for the arm case. | |
83 | # However, we still need a patch for arm. There's a similar patch for gcc 3.3.x | |
84 | # which needs to be integrated so we can kill of libfloat for good, except for | |
85 | # anyone (?) who might still be using gcc 2.95. mjn3 | |
86 | ifeq ($(BR2_SOFT_FLOAT),y) | |
87 | ifeq ("$(strip $(ARCH))","arm") | |
88 | $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional | |
89 | endif | |
90 | ifeq ("$(strip $(ARCH))","armeb") | |
91 | $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional | |
92 | endif | |
93 | # Not yet updated to 3.4.1. | |
94 | #ifeq ("$(strip $(ARCH))","i386") | |
95 | #$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) toolchain/gcc i386-gcc-soft-float.patch | |
96 | #endif | |
97 | endif | |
98 | touch $(GCC_DIR)/.patched | |
cd1a2927 MT |
99 | |
100 | # The --without-headers option stopped working with gcc 3.0 and has never been | |
9badc9e9 MT |
101 | # fixed, so we need to actually have working C library header files prior to |
102 | # the step or libgcc will not build... | |
103 | ||
104 | $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched | |
cd1a2927 | 105 | mkdir -p $(GCC_BUILD_DIR1) |
9badc9e9 | 106 | (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \ |
cd1a2927 | 107 | CC="$(HOSTCC)" \ |
cd1a2927 | 108 | $(GCC_DIR)/configure \ |
cd1a2927 | 109 | --prefix=$(STAGING_DIR) \ |
9badc9e9 MT |
110 | --build=$(GNU_HOST_NAME) \ |
111 | --host=$(GNU_HOST_NAME) \ | |
112 | --target=$(REAL_GNU_TARGET_NAME) \ | |
113 | --enable-languages=c \ | |
114 | --with-sysroot=$(TOOL_BUILD_DIR)/uClibc_dev/ \ | |
115 | --disable-__cxa_atexit \ | |
116 | --enable-target-optspace \ | |
117 | --with-gnu-ld \ | |
118 | --disable-shared \ | |
119 | $(DISABLE_NLS) \ | |
120 | $(THREADS) \ | |
121 | $(MULTILIB) \ | |
cd1a2927 | 122 | $(SOFT_FLOAT_CONFIG_OPTION) \ |
9badc9e9 MT |
123 | $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ |
124 | $(EXTRA_GCC_CONFIG_OPTIONS)); | |
cd1a2927 MT |
125 | touch $(GCC_BUILD_DIR1)/.configured |
126 | ||
127 | $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured | |
9badc9e9 | 128 | PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc |
cd1a2927 MT |
129 | touch $(GCC_BUILD_DIR1)/.compiled |
130 | ||
9badc9e9 MT |
131 | $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled |
132 | PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc | |
133 | #rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov | |
134 | #rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc $(STAGING_DIR)/share/locale | |
cd1a2927 | 135 | |
9badc9e9 | 136 | gcc_initial: uclibc-configured binutils $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gcc |
cd1a2927 | 137 | |
9badc9e9 | 138 | gcc_initial-clean: |
cd1a2927 | 139 | rm -rf $(GCC_BUILD_DIR1) |
cd1a2927 | 140 | |
9badc9e9 MT |
141 | gcc_initial-dirclean: |
142 | rm -rf $(GCC_BUILD_DIR1) $(GCC_DIR) | |
cd1a2927 MT |
143 | |
144 | ############################################################# | |
145 | # | |
9badc9e9 | 146 | # second pass compiler build. Build the compiler targeting |
cd1a2927 MT |
147 | # the newly built shared uClibc library. |
148 | # | |
149 | ############################################################# | |
9badc9e9 MT |
150 | # |
151 | # Sigh... I had to rework things because using --with-gxx-include-dir | |
152 | # causes issues with include dir search order for g++. This seems to | |
153 | # have something to do with "path translations" and possibly doesn't | |
154 | # affect gcc-target. However, I haven't tested gcc-target yet so no | |
155 | # guarantees. mjn3 | |
156 | ||
1d4ec104 | 157 | GCC_BUILD_DIR2:=$(TOOL_BUILD_DIR)/gcc-$(GCC_VERSION)-final |
9badc9e9 | 158 | $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched $(STAGING_DIR)/lib/libc.a |
cd1a2927 | 159 | mkdir -p $(GCC_BUILD_DIR2) |
9badc9e9 MT |
160 | # Important! Required for limits.h to be fixed. |
161 | ln -snf ../include $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include | |
162 | (cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) \ | |
cd1a2927 | 163 | CC="$(HOSTCC)" \ |
cd1a2927 | 164 | $(GCC_DIR)/configure \ |
cd1a2927 | 165 | --prefix=$(STAGING_DIR) \ |
9badc9e9 MT |
166 | --build=$(GNU_HOST_NAME) \ |
167 | --host=$(GNU_HOST_NAME) \ | |
168 | --target=$(REAL_GNU_TARGET_NAME) \ | |
cd1a2927 | 169 | --enable-languages=$(TARGET_LANGUAGES) \ |
9badc9e9 MT |
170 | --disable-__cxa_atexit \ |
171 | --enable-target-optspace \ | |
172 | --with-gnu-ld \ | |
173 | $(GCC_SHARED_LIBGCC) \ | |
174 | $(DISABLE_NLS) \ | |
175 | $(THREADS) \ | |
176 | $(MULTILIB) \ | |
177 | $(SOFT_FLOAT_CONFIG_OPTION) \ | |
178 | $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ | |
179 | $(GCC_USE_SJLJ_EXCEPTIONS) \ | |
180 | $(EXTRA_GCC_CONFIG_OPTIONS)); | |
cd1a2927 MT |
181 | touch $(GCC_BUILD_DIR2)/.configured |
182 | ||
183 | $(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured | |
9badc9e9 | 184 | PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all |
cd1a2927 MT |
185 | touch $(GCC_BUILD_DIR2)/.compiled |
186 | ||
9badc9e9 MT |
187 | $(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled |
188 | PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install | |
189 | if [ -d "$(STAGING_DIR)/lib64" ] ; then \ | |
190 | if [ ! -e "$(STAGING_DIR)/lib" ] ; then \ | |
191 | mkdir "$(STAGING_DIR)/lib" ; \ | |
192 | fi ; \ | |
193 | mv "$(STAGING_DIR)/lib64/"* "$(STAGING_DIR)/lib/" ; \ | |
194 | rmdir "$(STAGING_DIR)/lib64" ; \ | |
195 | fi | |
cd1a2927 | 196 | # Strip the host binaries |
9badc9e9 | 197 | ifeq ($(GCC_STRIP_HOST_BINARIES),true) |
cd1a2927 | 198 | -strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/* |
9badc9e9 MT |
199 | endif |
200 | # Make sure we have 'cc'. | |
201 | if [ ! -e $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ] ; then \ | |
202 | ln -snf $(REAL_GNU_TARGET_NAME)-gcc \ | |
203 | $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-cc ; \ | |
204 | fi; | |
205 | if [ ! -e $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ] ; then \ | |
206 | ln -snf gcc $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/cc ; \ | |
207 | fi; | |
208 | # Set up the symlinks to enable lying about target name. | |
cd1a2927 | 209 | set -e; \ |
9badc9e9 MT |
210 | (cd $(STAGING_DIR); \ |
211 | ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ | |
212 | cd bin; \ | |
213 | for app in $(REAL_GNU_TARGET_NAME)-* ; do \ | |
214 | ln -snf $${app} \ | |
215 | $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \ | |
216 | done; \ | |
217 | ); | |
218 | # | |
219 | # Now for the ugly 3.3.x soft float hack... | |
220 | # | |
221 | ifeq ($(BR2_SOFT_FLOAT),y) | |
222 | ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.) | |
223 | # Make sure we have a soft float specs file for this arch | |
224 | if [ ! -f toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float ] ; then \ | |
225 | echo soft float configured but no specs file for this arch ; \ | |
226 | /bin/false ; \ | |
227 | fi; | |
228 | # Replace specs file with one that defaults to soft float mode. | |
229 | if [ ! -f $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs ] ; then \ | |
230 | echo staging dir specs file is missing ; \ | |
231 | /bin/false ; \ | |
232 | fi; | |
233 | cp toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float $(STAGING_DIR)/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs | |
234 | endif | |
235 | endif | |
236 | # | |
237 | # Ok... that's enough of that. | |
238 | # | |
cd1a2927 MT |
239 | touch $(GCC_BUILD_DIR2)/.installed |
240 | ||
9badc9e9 MT |
241 | $(TARGET_DIR)/lib/libgcc_s.so.1: $(GCC_BUILD_DIR2)/.installed |
242 | # These are in /lib, so... | |
243 | rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so* | |
244 | -cp -a $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib/libgcc_s* $(TARGET_DIR)/lib/ | |
245 | ifeq ($(BR2_INSTALL_LIBSTDCPP),y) | |
246 | -cp -a $(STAGING_DIR)/lib/libstdc++.so* $(TARGET_DIR)/lib/ | |
cd1a2927 | 247 | endif |
9badc9e9 MT |
248 | ifeq ($(BR2_INSTALL_LIBGCJ),y) |
249 | -cp -a $(STAGING_DIR)/lib/libgcj.so* $(TARGET_DIR)/lib/ | |
250 | -cp -a $(STAGING_DIR)/lib/lib-org-w3c-dom.so* $(TARGET_DIR)/lib/ | |
251 | -cp -a $(STAGING_DIR)/lib/lib-org-xml-sax.so* $(TARGET_DIR)/lib/ | |
252 | -mkdir -p $(TARGET_DIR)/usr/lib/security | |
253 | -cp -a $(STAGING_DIR)/usr/lib/security/libgcj.security $(TARGET_DIR)/usr/lib/security/ | |
254 | -cp -a $(STAGING_DIR)/usr/lib/security/classpath.security $(TARGET_DIR)/usr/lib/security/ | |
cd1a2927 | 255 | endif |
9badc9e9 | 256 | touch -c $(TARGET_DIR)/lib/libgcc_s.so.1 |
cd1a2927 | 257 | |
9badc9e9 | 258 | gcc: uclibc-configured binutils gcc_initial $(LIBFLOAT_TARGET) uclibc \ |
cd1a2927 MT |
259 | $(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS) |
260 | ||
9badc9e9 | 261 | gcc-source: $(DL_DIR)/$(GCC_SOURCE) |
cd1a2927 | 262 | |
9badc9e9 | 263 | gcc-clean: |
cd1a2927 | 264 | rm -rf $(GCC_BUILD_DIR2) |
9badc9e9 MT |
265 | for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \ |
266 | rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-$$prog \ | |
267 | rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$$prog; \ | |
268 | done | |
cd1a2927 | 269 | |
9badc9e9 | 270 | gcc-dirclean: gcc_initial-dirclean |
cd1a2927 MT |
271 | rm -rf $(GCC_BUILD_DIR2) |
272 | ||
273 | ############################################################# | |
274 | # | |
275 | # Next build target gcc compiler | |
276 | # | |
277 | ############################################################# | |
1d4ec104 | 278 | GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target |
cd1a2927 | 279 | |
9badc9e9 | 280 | $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR2)/.installed |
cd1a2927 | 281 | mkdir -p $(GCC_BUILD_DIR3) |
9badc9e9 MT |
282 | (cd $(GCC_BUILD_DIR3); PATH=$(TARGET_PATH) \ |
283 | $(GCC_DIR)/configure \ | |
cd1a2927 | 284 | --prefix=/usr \ |
9badc9e9 MT |
285 | --build=$(GNU_HOST_NAME) \ |
286 | --host=$(REAL_GNU_TARGET_NAME) \ | |
287 | --target=$(REAL_GNU_TARGET_NAME) \ | |
288 | --enable-languages=$(TARGET_LANGUAGES) \ | |
289 | --with-gxx-include-dir=/usr/include/c++ \ | |
290 | --disable-__cxa_atexit \ | |
cd1a2927 | 291 | --enable-target-optspace \ |
9badc9e9 MT |
292 | --with-gnu-ld \ |
293 | $(GCC_SHARED_LIBGCC) \ | |
cd1a2927 | 294 | $(DISABLE_NLS) \ |
9badc9e9 MT |
295 | $(THREADS) \ |
296 | $(MULTILIB) \ | |
297 | $(SOFT_FLOAT_CONFIG_OPTION) \ | |
298 | $(GCC_WITH_CPU) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \ | |
299 | $(GCC_USE_SJLJ_EXCEPTIONS) \ | |
300 | $(EXTRA_GCC_CONFIG_OPTIONS)); | |
cd1a2927 MT |
301 | touch $(GCC_BUILD_DIR3)/.configured |
302 | ||
303 | $(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured | |
9badc9e9 MT |
304 | PATH=$(TARGET_PATH) \ |
305 | $(MAKE) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3) all | |
cd1a2927 MT |
306 | touch $(GCC_BUILD_DIR3)/.compiled |
307 | ||
9badc9e9 MT |
308 | # |
309 | # gcc-lib dir changes names to gcc with 3.4.mumble | |
310 | # | |
311 | ifeq ($(findstring 3.4.,$(GCC_VERSION)),3.4.) | |
312 | GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) | |
313 | else | |
314 | GCC_LIB_SUBDIR=lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) | |
315 | endif | |
316 | # sigh... we need to find a better way | |
317 | ifeq ($(findstring 4.0.,$(GCC_VERSION)),4.0.) | |
318 | GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) | |
319 | endif | |
320 | ifeq ($(findstring 4.1.,$(GCC_VERSION)),4.1.) | |
321 | GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) | |
322 | endif | |
323 | ifeq ($(findstring 4.2.,$(GCC_VERSION)),4.2.) | |
324 | GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION) | |
325 | endif | |
326 | ||
cd1a2927 | 327 | $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled |
9badc9e9 MT |
328 | PATH=$(TARGET_PATH) \ |
329 | $(MAKE) DESTDIR=$(TARGET_DIR) -C $(GCC_BUILD_DIR3) install | |
330 | # Remove broken specs file (cross compile flag is set). | |
331 | rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs | |
332 | # | |
333 | # Now for the ugly 3.3.x soft float hack... | |
334 | # | |
335 | ifeq ($(BR2_SOFT_FLOAT),y) | |
336 | ifeq ($(findstring 3.3.,$(GCC_VERSION)),3.3.) | |
337 | # Add a specs file that defaults to soft float mode. | |
338 | cp toolchain/gcc/$(GCC_VERSION)/specs-$(ARCH)-soft-float $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs | |
cd1a2927 | 339 | # Make sure gcc does not think we are cross compiling |
9badc9e9 MT |
340 | $(SED) "s/^1/0/;" $(TARGET_DIR)/usr/lib/gcc-lib/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)/specs |
341 | endif | |
342 | endif | |
343 | # | |
344 | # Ok... that's enough of that. | |
345 | # | |
cd1a2927 MT |
346 | -(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1) |
347 | -(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1) | |
9badc9e9 | 348 | -(cd $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1) |
cd1a2927 | 349 | -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1) |
9badc9e9 | 350 | -(cd $(TARGET_DIR)/lib; $(STRIP) libgcc_s*.so.*.*.* > /dev/null 2>&1) |
cd1a2927 MT |
351 | # |
352 | rm -f $(TARGET_DIR)/usr/lib/*.la* | |
9badc9e9 MT |
353 | #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \ |
354 | # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc | |
cd1a2927 | 355 | # Work around problem of missing syslimits.h |
9badc9e9 MT |
356 | if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/syslimits.h ] ; then \ |
357 | echo "warning: working around missing syslimits.h" ; \ | |
358 | cp -f $(STAGING_DIR)/$(GCC_LIB_SUBDIR)/include/syslimits.h \ | |
359 | $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/include/ ; \ | |
360 | fi | |
361 | # Make sure we have 'cc'. | |
362 | if [ ! -e $(TARGET_DIR)/usr/bin/cc ] ; then \ | |
363 | ln -snf gcc $(TARGET_DIR)/usr/bin/cc ; \ | |
364 | fi; | |
cd1a2927 | 365 | # These are in /lib, so... |
9badc9e9 MT |
366 | #rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so* |
367 | #touch -c $(TARGET_DIR)/usr/bin/gcc | |
cd1a2927 | 368 | |
9badc9e9 | 369 | gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc |
cd1a2927 | 370 | |
9badc9e9 | 371 | gcc_target-clean: |
cd1a2927 | 372 | rm -rf $(GCC_BUILD_DIR3) |
9badc9e9 | 373 | rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)* |
cd1a2927 | 374 | |
9badc9e9 | 375 | gcc_target-dirclean: |
cd1a2927 | 376 | rm -rf $(GCC_BUILD_DIR3) |