From f777f6a9450d2bd5fc7ec531e6fb69f79942499a Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 5 Nov 2024 20:24:40 +0100 Subject: Musl make --- compile_make.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 compile_make.sh (limited to 'compile_make.sh') diff --git a/compile_make.sh b/compile_make.sh new file mode 100755 index 0000000..78bc6c0 --- /dev/null +++ b/compile_make.sh @@ -0,0 +1,29 @@ +#!/bin/sh -e + +defined() { + [ x"$2" = x ] && echo $1 is undefined && exit 1 + echo $1 = $2 +} + +pexec() { + echo $@ + $@ +} + +defined CC "$CC" +defined LD "$LD" + +arch=x86_64 + +gcc_prefix=$(dirname $(gcc -print-libgcc-file-name)) + +tool_cflags="-Wall -nostdinc -Wno-main \ + -ffreestanding -fno-pic -fno-stack-protector \ + -Igenerated/include -Iarch/$arch \ + -I${gcc_prefix}/include -Iarch/generic" + +cflags="$tool_cflags $CFLAGS" + +pexec $CC $cflags -c -o tools/common.o tools/common.c +pexec $CC $cflags -c -o tools/make.o tools/make.c +pexec $LD -nostdlib -o tools/make tools/make.o tools/common.o -- cgit v1.2.3