#!/bin/sh
#
# umake - go up until we find a Makefile, and then run make(1) with given args
#
# Usage:
#      umake
#      umake prefix=/foo/bar install

while [ "${PWD}" != / ]; do
  for mf in makefile Makefile; do
    [ -f "${mf}" ] || continue
    make "$@"
    exit
  done
  cd .. || exit
done
printf >&2 'umake: no makefile found in ancestors\n'
exit 1
