2002-01-15 22:15:47 +03:00
|
|
|
#! /bin/sh
|
2020-07-26 12:17:24 +03:00
|
|
|
# $NetBSD: buildmake.sh.in,v 1.16 2020/07/26 09:17:24 rillig Exp $
|
2002-01-15 22:15:47 +03:00
|
|
|
#
|
|
|
|
# buildmake.sh.in - Autoconf-processed shell script for building make(1).
|
|
|
|
#
|
|
|
|
|
2018-01-15 22:52:54 +03:00
|
|
|
: ${NETBSDSRCDIR:=@srcdir@/../..}
|
2018-01-16 11:53:51 +03:00
|
|
|
MKSRCDIR=${NETBSDSRCDIR}/usr.bin/make
|
|
|
|
|
|
|
|
_CC="@CC@"
|
|
|
|
|
|
|
|
_CFLAGS="@CPPFLAGS@"
|
|
|
|
_CFLAGS="${_CFLAGS} -D_PATH_DEFSYSPATH=\"${NETBSDSRCDIR}/share/mk\""
|
|
|
|
_CFLAGS="${_CFLAGS} @DEFS@"
|
|
|
|
_CFLAGS="${_CFLAGS} @CFLAGS@"
|
2018-01-15 22:52:54 +03:00
|
|
|
|
2018-01-16 11:53:51 +03:00
|
|
|
_LDFLAGS="@LDFLAGS@ @LIBS@"
|
2002-01-15 22:15:47 +03:00
|
|
|
|
|
|
|
docmd () {
|
2020-06-13 14:39:43 +03:00
|
|
|
case "${MAKEVERBOSE:-2}" in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
1)
|
|
|
|
echo " $1 ${2##*/}" ;;
|
|
|
|
*)
|
|
|
|
echo "$3" ;;
|
|
|
|
esac
|
2020-06-13 14:28:24 +03:00
|
|
|
$3 || exit 1
|
2002-01-15 22:15:47 +03:00
|
|
|
}
|
|
|
|
|
2020-07-26 12:17:24 +03:00
|
|
|
for f in $MKSRCDIR/*.c; do
|
2020-06-13 14:28:24 +03:00
|
|
|
docmd "compile " "$f" "${_CC} ${_CFLAGS} -c $f"
|
2002-01-15 22:15:47 +03:00
|
|
|
done
|
|
|
|
|
2020-06-13 14:28:24 +03:00
|
|
|
docmd " link " "${_TOOL_PREFIX:-nb}make" \
|
|
|
|
"${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}"
|