Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc-cf / packages / build.gcc / Makefile
blob92e0ddff24567dd4f3772130153d56d8083be4e1
1 include ../packages.mk
3 #GCC_VERSION=4.6.1
4 #GCC_SEPARATE_PACKAGES=1
5 GCC_VERSION=4.7.2
7 ifeq ($(OS),SunOS)
8 CFGFLAGS=--with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-lto
9 # CFGENV=CC='cc -m64'
10 endif
12 .PHONY: all
13 all: gcc-install.tag gcc-clean
15 .PHONY: clean
16 clean: gcc-clean
17 rm -rf download/* *.tag
19 ifdef GCC_SEPARATE_PACKAGES
20 download/gcc-core-$(GCC_VERSION).tar.bz2:
21 $(WGET) ftp://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/gcc-core-$(GCC_VERSION).tar.bz2
23 download/gcc-g++-$(GCC_VERSION).tar.bz2:
24 $(WGET) ftp://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/gcc-g++-$(GCC_VERSION).tar.bz2
26 gcc-unpack.tag: download/gcc-core-$(GCC_VERSION).tar.bz2 download/gcc-g++-$(GCC_VERSION).tar.bz2
27 for i in $^; do \
28 tar -xjf $$i; \
29 done
30 #bunzip2 -c download/gcc*.tar.bz2 | tar -xf -
31 touch $@
32 else
33 download/gcc-$(GCC_VERSION).tar.bz2:
34 $(WGET) ftp://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.bz2
36 gcc-unpack.tag: download/gcc-$(GCC_VERSION).tar.bz2
37 tar -xjf download/gcc-$(GCC_VERSION).tar.bz2
38 touch $@
39 endif
41 gcc-configure.tag: gcc-unpack.tag
42 rm -rf objdir-gcc
43 mkdir -p objdir-gcc
44 cd objdir-gcc && \
45 ../gcc-$(GCC_VERSION)/configure \
46 --prefix=$(LOCAL_DIR) \
47 --enable-languages=c,c++ \
48 --with-gmp=$(LOCAL_DIR) --with-mpfr=$(LOCAL_DIR) --with-mpc=$(LOCAL_DIR) \
49 --enable-threads --disable-nls \
50 --disable-shared $(CFGFLAGS) $(CFGENV)
51 touch $@
53 gcc-make.tag: gcc-configure.tag
54 cd objdir-gcc && \
55 PATH=$(PATH):$(LOCAL_DIR)/bin \
56 make LDFLAGS=-s -j 2
57 touch $@
59 gcc-install.tag: gcc-make.tag
60 cd objdir-gcc && \
61 PATH=$(PATH):$(LOCAL_DIR)/bin \
62 make install
63 rm -r $(LOCAL_DIR)/man $(LOCAL_DIR)/info
64 touch $@
67 .PHONY: gcc-clean
68 gcc-clean:
69 rm -rf gcc-$(GCC_VERSION)
70 rm -rf objdir-gcc
71 rm -f gcc-unpack.tag gcc-configure.tag gcc-make.tag