Re:A Tutorial on Portable Makefiles
by CJefferson on Sunday August 20, 2017 @05:35PM
(#15060367)
Nowadays I write a GNUmakefile, then add a Makefile with a message telling people to use gmake. Same idea.
[ Parent
| on HN ]
Re:A Tutorial on Portable Makefiles
by contras1970 on Monday August 21, 2017 @03:37PM
(#15067150)
i have this in a (hand-written) configure script:
case "$(uname -s)" in
Darvin|Linux)
MAKE=make
GMAKE=$MAKE
;;
DragonFly|*BSD)
MAKE=make
GMAKE=gmake
;;
*)
MAKE=gmake
GMAKE=$MAKE
;;
esac
...
if test "$MAKE" != "$GMAKE"; then
case "$(uname -s)" in
DragonFly|*BSD)
populate $rootdir/Makefile.in Makefile
;;
esac
fi
cat <<EOF
to build the programs from their sources:
$MAKE
to test their correctness:
$MAKE check
EOF
$rootdir/Makefile.in contains all .DEFAULT:
@@GMAKE@ --no-print-directory "$@"