From 6115cb2e10b3bc143eaf547118ff3060872b4789 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 10 Aug 2016 15:27:22 +0100 Subject: [PATCH] Add GNU make to the stage3 chroot. --- .gitignore | 1 + Makefile | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index a274f3c..1ca9a8b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ stamp-* /grep-2.25/ /gzip-1.8/ /less-481/ +/make-4.1/ /mpc-1.0.3/ /mpfr-3.1.4/ /nano-2.6.2/ diff --git a/Makefile b/Makefile index d69846e..56d330a 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ LESS_VERSION = 481 STRACE_COMMIT = f320e1897832fd07a62e18ed288e75d8e79f4c5b STRACE_SHORT_COMMIT = f320e189 BZIP2_VERSION = 1.0.6 +MAKE_VERSION = 4.1 all: stage1 stage2 stage3 stage4 @@ -287,6 +288,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \ stage3-chroot/usr/bin/less \ stage3-chroot/usr/bin/strace \ stage3-chroot/usr/bin/bzip2 \ + stage3-chroot/usr/bin/make \ stage3-chroot/init \ stage3-disk.img @@ -776,6 +778,23 @@ bzip2-$(BZIP2_VERSION).tar.gz: wget -O $@-t http://www.bzip.org/1.0.6/bzip2-$(BZIP2_VERSION).tar.gz mv $@-t $@ +# Cross-compile GNU make. +stage3-chroot/usr/bin/make: make-$(MAKE_VERSION).tar.gz + rm -rf make-$(MAKE_VERSION) + tar -zxf $^ + cd make-$(MAKE_VERSION) && \ + PATH=$(ROOT)/fixed-gcc:$$PATH \ + ./configure \ + --host=riscv64-unknown-linux-gnu \ + --prefix=/usr --libdir=/usr/lib64 + cd make-$(MAKE_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make + cd make-$(MAKE_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot + +make-$(MAKE_VERSION).tar.gz: + rm -f $@ $@-t + wget -O $@-t https://ftp.gnu.org/gnu/make/make-$(MAKE_VERSION).tar.gz + mv $@-t $@ + # Create an /init script. stage3-chroot/init: init.sh install -m 0755 $^ $@ -- 1.8.3.1