# Auto-generate a Makefile in build directory
# Args:
# $1: path of project src root
-# $2: path of build dir (can be relative to $1)
echo "# Automatically generated by gen-build-mk.sh"
echo
echo "MAKEFLAGS += --no-print-directory"
echo
echo "all:"
-echo " @\$(MAKE) -C $1 O=$2"
+echo " @\$(MAKE) -C $1 O=\$(CURDIR)"
echo
echo "%::"
-echo " @\$(MAKE) -C $1 O=$2 \$@"
+echo " @\$(MAKE) -C $1 O=\$(CURDIR) \$@"