1 include $(TOP)/config/make.cfg
3 BINUTILS_VERSION = 2.21.1
8 # gcc 4.6.2 can't build arm Objective C support without
10 ifneq (,$(findstring $(AROS_TARGET_CPU),arm))
13 GCC_LANGUAGES = c,c++,objc
17 --target=$(AROS_TARGET_CPU)-aros --bindir=$(CROSSTOOLSDIR) --enable-languages=$(GCC_LANGUAGES) \
18 --enable-long-long --enable-version-specific-runtime-libs
21 GCC_EXTRA_OPTS += --with-sysroot=$(AROS_DEVELOPMENT) --with-build-sysroot=$(AROS_DEVELOPMENT)
22 GCC_EXTRA_OPTS += --disable-bootstrap
23 GCC_EXTRA_OPTS += --enable-sjlj-exceptions=no --enable-tls=no
24 GCC_PATH = `LANG=en_US $(CROSSTOOLSDIR)/$(AROS_TARGET_CPU)-aros-gcc -print-search-dirs | grep "programs: =" | cut -c 12-`
25 GCC_UNUSED_BUT_SET_VARIABLE := -Wno-unused-but-set-variable
26 GCC_ARRAY_BOUNDS := -Wno-array-bounds
27 GCC_ENUM_COMPARE := -Wno-enum-compare
29 GNU_REPOSITORY := gnu://
30 MPC_REPOSITORY := http://www.multiprecision.org/mpc/download/
32 binutils-installflag := $(CROSSTOOLSDIR)/.installflag-binutils-$(BINUTILS_VERSION)
33 gmp-installflag := $(CROSSTOOLSDIR)/.installflag-gmp-$(GMP_VERSION)
34 mpfr-installflag := $(CROSSTOOLSDIR)/.installflag-mpfr-$(MPFR_VERSION)
35 mpc-installflag := $(CROSSTOOLSDIR)/.installflag-mpc-$(MPC_VERSION)
36 gcc-installflag := $(CROSSTOOLSDIR)/.installflag-gcc-$(GCC_VERSION)
38 #MM- tools-crosstools : tools-crosstools-$(AROS_TARGET_CPU)
40 #MM- tools-crosstools-m68k : tools-crosstools-gcc crosstools-gcc
41 #MM- tools-crosstools-i386 : tools-crosstools-gcc crosstools-gcc
42 #MM- tools-crosstools-x86_64 : tools-crosstools-gcc crosstools-gcc
43 #MM- tools-crosstools-ppc : tools-crosstools-gcc crosstools-gcc
44 #MM- tools-crosstools-arm : tools-crosstools-gcc crosstools-gcc
46 #MM- crosstools-gcc: includes-copy-mlib core-linklibs
48 #MM tools-crosstools-gcc : tools-crosstools-binutils tools-crosstools-collect-aros \
49 #MM compiler-includes compiler-clib-includes \
50 #MM tools-crosstools-gmp \
51 #MM tools-crosstools-mpfr \
52 #MM tools-crosstools-mpc
54 # We intentionally bypass the usual fetch_and_build macro below and call mmakefile and gcc makefile
55 # targets directly. This is in order to not build the core-linklibs target during binutils and gcc
56 # builds because we want these static linker libraries be generated by the cross tool chain we are building
57 # right here. Additionally, we also want to maintain our own install flag files inside the directory
58 # specified by --with-crosstools. This directory may even reside outside of the usual aros build directory
59 # and can be reused between complete rebuilds.
62 tools-crosstools-gmp :
63 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
64 || ! $(TEST) -f $(gmp-installflag) \
65 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(gmp-installflag))" ; then \
66 $(RM) $(HOSTGENDIR)/$(CURDIR)/gmp/.files-touched \
67 && $(MAKE) -f ./mmakefile crosstools-gmp--fetch \
68 && $(MAKE) -f ./mmakefile crosstools-gmp--build_and_install-quick \
69 && $(ECHO) $(AROS_DEVELOPMENT) > $(gmp-installflag) ; \
73 %fetch_and_build mmake=crosstools-gmp package=gmp version=$(GMP_VERSION) compiler=host \
74 package_repo="$(GNU_REPOSITORY)/gmp" \
76 prefix="$(CROSSTOOLSDIR)" \
77 extraoptions="--bindir=$(CROSSTOOLSDIR) --disable-shared"
80 tools-crosstools-mpfr :
81 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
82 || ! $(TEST) -f $(mpfr-installflag) \
83 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(mpfr-installflag))" ; then \
84 $(RM) $(HOSTGENDIR)/$(CURDIR)/mpfr/.files-touched \
85 && $(MAKE) -f ./mmakefile crosstools-mpfr--fetch \
86 && $(MAKE) -f ./mmakefile crosstools-mpfr--build_and_install-quick \
87 && $(ECHO) $(AROS_DEVELOPMENT) > $(mpfr-installflag) ; \
91 %fetch_and_build mmake=crosstools-mpfr package=mpfr version=$(MPFR_VERSION) compiler=host \
92 package_repo="$(GNU_REPOSITORY)/mpfr" \
94 prefix="$(CROSSTOOLSDIR)" \
95 extraoptions="--bindir=$(CROSSTOOLSDIR) --disable-shared"
98 tools-crosstools-mpc :
99 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
100 || ! $(TEST) -f $(mpc-installflag) \
101 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(mpc-installflag))" ; then \
102 $(RM) $(HOSTGENDIR)/$(CURDIR)/mpc/.files-touched \
103 && $(MAKE) -f ./mmakefile crosstools-mpc--fetch \
104 && $(MAKE) -f ./mmakefile crosstools-mpc--build_and_install-quick \
105 && $(ECHO) $(AROS_DEVELOPMENT) > $(mpc-installflag) ; \
109 %fetch_and_build mmake=crosstools-mpc package=mpc version=$(MPC_VERSION) compiler=host \
110 package_repo="$(MPC_REPOSITORY)" suffixes="tar.gz" \
112 prefix="$(CROSSTOOLSDIR)" \
113 extraoptions="--bindir=$(CROSSTOOLSDIR) --disable-shared"
116 tools-crosstools-binutils :
117 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
118 || ! $(TEST) -f $(binutils-installflag) \
119 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(binutils-installflag))" ; then \
120 $(RM) $(HOSTGENDIR)/$(CURDIR)/binutils/.files-touched \
121 && $(MAKE) -f ./mmakefile crosstools-binutils--fetch \
122 && $(MAKE) -f ./mmakefile crosstools-binutils--build_and_install-quick \
123 && $(ECHO) $(AROS_DEVELOPMENT) > $(binutils-installflag) ; \
127 %fetch_and_build mmake=crosstools-binutils package=binutils version=$(BINUTILS_VERSION) compiler=host \
128 package_repo="$(GNU_REPOSITORY)/binutils" \
130 prefix="$(CROSSTOOLSDIR)" \
131 extraoptions="--target=$(AROS_TARGET_CPU)-aros -bindir=$(CROSSTOOLSDIR) --with-sysroot=$(AROS_DEVELOPMENT) --disable-werror"
133 HOST_CFLAGS := $(HOST_CFLAGS) $(HOST_GNU89_INLINE)
136 tools-crosstools-gcc :
137 @$(IF) ! $(TEST) -f $(gcc-installflag) \
138 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(gcc-installflag))" ; then \
139 $(RM) $(HOSTGENDIR)/$(CURDIR)/gcc/.files-touched \
140 && $(MAKE) -f ./mmakefile crosstools-gcc--fetch \
141 && $(MAKE) -f ./mmakefile crosstools-gcc--configure \
142 && $(MAKE) -C $(HOSTGENDIR)/$(CURDIR)/gcc all-gcc \
143 && $(MAKE) -j1 -C $(HOSTGENDIR)/$(CURDIR)/gcc install-gcc \
144 && $(ECHO) $(AROS_DEVELOPMENT) > $(gcc-installflag) ; \
146 @$(IF) $(TEST) -f $(gcc-installflag); then \
147 $(SED) -i -e "s|@aros_target_cc_path@|$(GCC_PATH)|g" $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-ld ; \
148 $(SED) -i -e "s|@aros_cflags_unused_but_set_variable@|$(GCC_UNUSED_BUT_SET_VARIABLE)|g" $(GENDIR)/config/target.cfg ; \
149 $(SED) -i -e "s|@aros_cflags_array_bounds@|$(GCC_ARRAY_BOUNDS)|g" $(GENDIR)/config/target.cfg ; \
150 $(SED) -i -e "s|@aros_cflags_enum_compare@|$(GCC_ENUM_COMPARE)|g" $(GENDIR)/config/target.cfg ; \
151 $(SED) -i -e "s|@aros_cflags_format_security@|-Wno-format-security|g" $(GENDIR)/config/target.cfg ; \
152 $(SED) -i -e "s|@aros_cflags_strict_overflow@|-Wno-strict-overflow|g" $(GENDIR)/config/target.cfg ; \
155 %fetch_and_build mmake=crosstools-gcc package=gcc version=$(GCC_VERSION) compiler=host \
156 package_repo="$(GNU_REPOSITORY)/gcc/gcc-$(GCC_VERSION)" \
158 prefix="$(CROSSTOOLSDIR)" \
159 extraoptions="$(GCC_EXTRA_OPTS)"