summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules6
-rw-r--r--tools/toolchain/Makefile37
m---------tools/toolchain/src/binutils0
m---------tools/toolchain/src/gcc0
4 files changed, 43 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ec7d90e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "tools/toolchain/src/binutils"]
+ path = tools/toolchain/src/binutils
+ url = git://sourceware.org/git/binutils-gdb.git
+[submodule "tools/toolchain/src/binutils"]
+ path = tools/toolchain/src/gcc
+ url = git://gcc.gnu.org/git/gcc.git
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
diff --git a/tools/toolchain/src/binutils b/tools/toolchain/src/binutils
new file mode 160000
+Subproject b51c2fec1da205ea3e7354cbb3e253018d64873
diff --git a/tools/toolchain/src/gcc b/tools/toolchain/src/gcc
new file mode 160000
+Subproject 2ee5e4300186a92ad73f1a1a64cb918dc76c8d6