diff options
author | Joursoir <chat@joursoir.net> | 2022-09-26 02:10:04 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2022-10-03 20:43:44 +0300 |
commit | 719919dd0dfc8a22186b3394bb6a8f951431f909 (patch) | |
tree | b2e0d2c3ebcdf7c34cbc9279c8d0c5536be9855f /tools/toolchain/Makefile | |
parent | b6ce3db0609318907cb2d34d8dde52fe17c31b5c (diff) | |
download | mfsos-719919dd0dfc8a22186b3394bb6a8f951431f909.tar.gz mfsos-719919dd0dfc8a22186b3394bb6a8f951431f909.tar.bz2 mfsos-719919dd0dfc8a22186b3394bb6a8f951431f909.zip |
add cross-toolchain
Add git submodules and use next versions:
GNU binutils 2.39
GCC 12.2.0
Diffstat (limited to 'tools/toolchain/Makefile')
-rw-r--r-- | tools/toolchain/Makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/toolchain/Makefile b/tools/toolchain/Makefile new file mode 100644 index 0000000..2e5ab33 --- /dev/null +++ b/tools/toolchain/Makefile @@ -0,0 +1,37 @@ +TARGET = i686-elf +TOOLS_PREFIX = $(PWD) +# The $TOOLS_PREFIX/bin dir MUST be in the PATH. GCC will use it. +PATH := "$(TOOLS_PREFIX)/bin:$(PATH)" +export PATH + +BINUTILS_OUT = src/binutils/out +GCC_OUT = src/gcc/out + +all: binutils gcc + bin/$(TARGET)-as --version + bin/$(TARGET)-gcc -### + +binutils: + mkdir $(BINUTILS_OUT) + (cd $(BINUTILS_OUT); ../configure --target=$(TARGET) --prefix="$(TOOLS_PREFIX)" \ + --with-sysroot \ + --disable-nls \ + --disable-gdb \ + --disable-werror) + $(MAKE) -C $(BINUTILS_OUT) + $(MAKE) -C $(BINUTILS_OUT) install + +gcc: + mkdir $(GCC_OUT) + (cd $(GCC_OUT); ../configure --target=$(TARGET) --prefix="$(TOOLS_PREFIX)" \ + --disable-nls \ + --enable-languages=c \ + --without-headers) + $(MAKE) -C $(GCC_OUT) all-gcc + $(MAKE) -C $(GCC_OUT) all-target-libgcc + $(MAKE) -C $(GCC_OUT) install-gcc + $(MAKE) -C $(GCC_OUT) install-target-libgcc + +clean: + -rm -r $(BINUTILS_OUT) $(GCC_OUT) + -rm -r bin $(TARGET) include lib libexec share |