1 include $(TOP)/config/make.cfg
3 BINUTILS_VERSION = 2.20.1
8 --target=$(AROS_TARGET_CPU)-aros --bindir=$(CROSSTOOLSDIR) --enable-languages=$(GCC_LANGUAGES) \
9 --enable-long-long --enable-version-specific-runtime-libs
11 ifeq ($(AROS_TARGET_CPU), arm)
12 # FIXME: Update patch to work with --with-sysroot then set GCC_INCLUDES and GCC_PATH for --enable-crosstools
14 GCC_EXTRA_OPTS += --with-headers=$(AROS_DEVELOPMENT)/include --with-libs=$(AROS_DEVELOPMENT)/lib
17 GCC_EXTRA_OPTS += --with-sysroot=$(AROS_DEVELOPMENT)
18 GCC_INCLUDES = $(CROSSTOOLSDIR)/lib/gcc/$(AROS_TARGET_CPU)-aros/$(GCC_VERSION)/include
19 GCC_PATH = `LANG=en_US $(CROSSTOOLSDIR)/$(AROS_TARGET_CPU)-aros-gcc -print-search-dirs | grep "programs: =" | cut -c 12-`
22 GNU_REPOSITORY := gnu://
24 binutils-installflag := $(CROSSTOOLSDIR)/.installflag-binutils-$(BINUTILS_VERSION)
25 gcc-installflag := $(CROSSTOOLSDIR)/.installflag-gcc-$(GCC_VERSION)
27 #MM- tools-crosstools : tools-crosstools-$(AROS_TARGET_CPU)
29 # m68k build is disabled, since there is no AROS cross compiler yet, just m68k-elf cross compiler
30 ##MM- tools-crosstools-m68k : tools-crosstools-gcc crosstools-gcc
31 #MM- tools-crosstools-i386 : tools-crosstools-gcc crosstools-gcc
32 #MM- tools-crosstools-x86_64 : tools-crosstools-gcc crosstools-gcc
33 #MM- tools-crosstools-ppc : tools-crosstools-gcc crosstools-gcc
34 # arm still needs linklibs be build before, can be removed after patch is updated to work with --with-sysroot
35 #MM- tools-crosstools-arm : core-linklibs tools-crosstools-gcc crosstools-gcc
37 #MM tools-crosstools-gcc : tools-crosstools-binutils tools-crosstools-collect-aros compiler-includes compiler-clib-includes
39 # We intentionally bypass the usual fetch_and_build macro below and call mmakefile and gcc makefile
40 # targets directly. This is in order to not build the core-linklibs target during binutils and gcc
41 # builds because we want these static linker libraries be generated by the cross tool chain we are building
42 # right here. Additionally, we also want to maintain our own install flag files inside the directory
43 # specified by --with-crosstools. This directory may even reside outside of the usual aros build directory
44 # and can be reused between complete rebuilds.
47 tools-crosstools-binutils :
48 @$(IF) ! $(TEST) -d $(CROSSTOOLSDIR) \
49 || ! $(TEST) -f $(binutils-installflag) \
50 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(binutils-installflag))" ; then \
51 $(RM) $(HOSTGENDIR)/$(CURDIR)/binutils/.files-touched \
52 && $(MAKE) -f ./mmakefile crosstools-binutils--fetch \
53 && $(MAKE) -f ./mmakefile crosstools-binutils--build_and_install-quick \
54 && $(ECHO) $(AROS_DEVELOPMENT) > $(binutils-installflag) ; \
57 %fetch_and_build mmake=crosstools-binutils package=binutils version=$(BINUTILS_VERSION) compiler=host \
58 package_repo="$(GNU_REPOSITORY)/binutils" \
60 prefix="$(CROSSTOOLSDIR)" \
61 extraoptions="--target=$(AROS_TARGET_CPU)-aros -bindir=$(CROSSTOOLSDIR) --with-sysroot=$(AROS_DEVELOPMENT) --disable-werror"
63 HOST_CFLAGS := $(HOST_CFLAGS) $(HOST_GNU89_INLINE)
66 tools-crosstools-gcc :
67 @$(SED) -i -e "s|@aros_target_cc_includes@|$(GCC_INCLUDES)|g" $(GENDIR)/config/specs
68 @$(IF) ! $(TEST) -f $(gcc-installflag) \
69 || $(TEST) "$(AROS_DEVELOPMENT)" != "$(shell $(CAT) 2>/dev/null $(gcc-installflag))" ; then \
70 $(RM) $(HOSTGENDIR)/$(CURDIR)/gcc/.files-touched \
71 && $(MAKE) -f ./mmakefile crosstools-gcc--fetch \
72 && $(MAKE) -f ./mmakefile crosstools-gcc--configure \
73 && $(MAKE) -C $(HOSTGENDIR)/$(CURDIR)/gcc all-gcc \
74 && $(MAKE) -j1 -C $(HOSTGENDIR)/$(CURDIR)/gcc install-gcc \
75 && $(ECHO) $(AROS_DEVELOPMENT) > $(gcc-installflag) ; \
77 @$(IF) $(TEST) -f $(gcc-installflag); then \
78 $(SED) -i -e "s|@aros_target_cc_path@|$(GCC_PATH)|g" $(TOOLDIR)/$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)$(AROS_TARGET_SUFFIX)-aros-ld ; \
81 %fetch_and_build mmake=crosstools-gcc package=gcc version=$(GCC_VERSION) compiler=host \
82 package_repo="$(GNU_REPOSITORY)/gcc/gcc-$(GCC_VERSION)" \
84 prefix="$(CROSSTOOLSDIR)" \
85 extraoptions="$(GCC_EXTRA_OPTS)"