swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Jay MaKe |
| 4 | |
swissChili | 4418ca5 | 2021-06-14 17:36:00 -0700 | [diff] [blame] | 5 | dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
| 6 | root="$(dirname $dir)" |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 7 | jmkscript="$root/share/jmk/jmk.m4" |
| 8 | |
swissChili | d98781b | 2021-07-25 21:04:17 -0700 | [diff] [blame^] | 9 | disable_gtags=false |
| 10 | |
| 11 | while getopts "Gh" arg; do |
| 12 | case $arg in |
| 13 | G) gen_gtags=false ;; |
| 14 | h) echo "Please read the JMK manual for more information." ;; |
| 15 | ?) echo "Invalid argument" |
| 16 | exit 1 ;; |
| 17 | esac |
| 18 | done |
| 19 | |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 20 | for file in $(find -name Jmk); do |
| 21 | echo "Processing $file" > /dev/stderr |
| 22 | outdir="$(dirname $file)" |
swissChili | d98781b | 2021-07-25 21:04:17 -0700 | [diff] [blame^] | 23 | m4 -D jmk_root="$root" -D jmk_build_cmd="$0" -D jmk_build_dir="$(pwd)" \ |
| 24 | -D disable_gtags="$disable_gtags" "$jmkscript" "$file" > "$outdir/Makefile" \ |
| 25 | || exit 2 |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 26 | done |