The advantage of the script over alias is that it can be run from other
programs (e.g. editors).
--- /dev/null
+#!/bin/sh
+
+# Helper script to run OMK from directories without the leaf OMK Makefile
+
+omk_rules=$(
+old_pwd=""
+while [ ! -e Makefile.rules ]; do
+ if [ "$old_pwd" = `pwd` ]; then
+ echo "Makefile.rules has not been found in this or parent directory" >&2; exit 1;
+ else
+ old_pwd=`pwd`;
+ cd -L .. 2>/dev/null;
+ fi;
+done;
+echo `pwd`/Makefile.rules
+)
+
+[ "$omk_rules" ] && make -f $omk_rules "$@"
+++ /dev/null
-alias omk='_omk_rules=$(old_pwd=""; while [ ! -e Makefile.rules ]; do if [ "$old_pwd" = `pwd` ]; then echo "Makefile.rules has not been found in this or parent directory" >&2; exit 1; else old_pwd=`pwd`; cd -L .. 2>/dev/null; fi; done; echo `pwd`/Makefile.rules); [ "$_omk_rules" ] && make -f $_omk_rules'