Skip to content

Commit

Permalink
修改构建工具自动搭建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
qvjp committed Jun 27, 2020
1 parent 8ea472b commit 0fd1f68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -53,8 +53,8 @@ qemu-curses: $(ISO)
qemu-curses-dbg: $(ISO)
qemu-system-i386 -cdrom $^ -S -s -curses -m 8M

install-toolchain:
$(TO_ROOT)/build-config/install-toolchains.sh
install-toolchain: install-headers
SYSROOT=$(SYSROOT) $(TO_ROOT)/build-config/install-toolchains.sh

clean:
rm -rf $(BUILD_DIR)
Expand Down
1 change: 1 addition & 0 deletions build-config/config.mk
@@ -1,5 +1,6 @@
ARCH := i686
BUILD_DIR = $(TO_ROOT)/build
SYSROOT ?= $(TO_ROOT)/sysroot
AR := $(ARCH)-inwox-ar
CC := $(ARCH)-inwox-gcc
CXX := $(ARCH)-inwox-g++
Expand Down
9 changes: 6 additions & 3 deletions build-config/install-toolchains.sh
Expand Up @@ -10,7 +10,10 @@ gcc_repo=https://github.com/qvjp/gcc-10.1.0-inwox.git
[ -z "$SRCDIR" ] && SRCDIR="$HOME/src"
[ -z "$BUILDDIR" ] && BUILDDIR="$SRCDIR"
[ -z "$ARCH" ] && ARCH=i686
[ -z "$TARGET" ] && TARGET=$ARCH-elf
[ -z "$TARGET" ] && TARGET=$ARCH-inwox
[ -z "$SYSROOT" ] && echo "Error: \$SYSROOT not set" && exit 1

SYSROOT="$(cd "$SYSROOT" && pwd)"

CPU_CORE=`cat /proc/cpuinfo | grep "processor" | wc -l`

Expand Down Expand Up @@ -43,7 +46,7 @@ git clone $gcc_repo inwox-gcc
echo Building binutils...
mkdir -p "$BUILDDIR/build-binutils"
cd "$BUILDDIR/build-binutils"
"$SRCDIR/inwox-binutils/configure" --target=$TARGET --prefix="$PREFIX" --with-sysroot \
"$SRCDIR/inwox-binutils/configure" --target=$TARGET --prefix="$PREFIX" --with-sysroot="$SYSROOT" \
--disable-nls --disable-werror
make -j"$CPU_CORE"
make install
Expand All @@ -52,7 +55,7 @@ echo Building gcc...
mkdir -p "$BUILDDIR/build-gcc"
cd "$BUILDDIR/build-gcc"
"$SRCDIR/inwox-gcc/configure" --target=$TARGET --prefix="$PREFIX" --disable-nls \
--enable-languages=c,c++ --without-headers
--enable-languages=c,c++ --with-sysroot="$SYSROOT"
make -j"$CPU_CORE" all-gcc all-target-libgcc
make install-gcc install-target-libgcc

Expand Down

0 comments on commit 0fd1f68

Please sign in to comment.