This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MPATH=$PWD | |
MAKECOMMAND=$(which make) | |
if [ "${MAKECOMMAND}" = "" ]; then | |
echo "make command could't find in your \$PATH. Did you install it?" | |
exit 1 | |
fi | |
while :; do | |
if [ -f "${MPATH}/Makefile" ]; then | |
break | |
elif [ "${MPATH}" = "/" ]; then | |
echo "Couldn't find up Makefile." | |
exit 1 | |
fi | |
MPATH=$(cd "$(dirname "${MPATH}")"; pwd) || exit | |
done | |
cd "${MPATH}" && make "$@" |
そういうこと。