+# Cross-compile GNU awk.
+stage3-chroot/usr/bin/gawk: gawk-$(GAWK_VERSION).tar.gz
+ rm -rf gawk-$(GAWK_VERSION)
+ tar -zxf $^
+ cd gawk-$(GAWK_VERSION) && \
+ PATH=$(ROOT)/fixed-gcc:$$PATH \
+ ./configure \
+ --host=riscv64-unknown-linux-gnu \
+ --prefix=/usr --libdir=/usr/lib64
+ cd gawk-$(GAWK_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make
+ cd gawk-$(GAWK_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot
+
+gawk-$(GAWK_VERSION).tar.gz:
+ rm -f $@ $@-t
+ wget -O $@-t https://ftp.gnu.org/gnu/gawk/gawk-$(GAWK_VERSION).tar.gz
+ mv $@-t $@
+