#!/bin/sh | |
# Jay MaKe | |
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) | |
root="$(dirname $dir)" | |
jmkscript="$root/share/jmk/jmk.m4" | |
disable_gtags=false | |
while getopts "Gh" arg; do | |
case $arg in | |
G) gen_gtags=false ;; | |
h) echo "Please read the JMK manual for more information." ;; | |
?) echo "Invalid argument" | |
exit 1 ;; | |
esac | |
done | |
for file in $(find -name Jmk); do | |
echo "Processing $file" > /dev/stderr | |
outdir="$(dirname $file)" | |
m4 -D jmk_root="$root" -D jmk_build_cmd="$0" -D jmk_build_dir="$(pwd)" \ | |
-D disable_gtags="$disable_gtags" "$jmkscript" "$file" > "$outdir/Makefile" \ | |
|| exit 2 | |
done |