swissChili | 3555885 | 2022-07-02 18:15:45 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Jay MaKe |
| 4 | |
| 5 | dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
| 6 | root="$(dirname $dir)" |
| 7 | jmkscript="$root/share/jmk/jmk.tcl" |
| 8 | options="" |
| 9 | |
| 10 | disable_gtags=false |
| 11 | |
| 12 | while getopts "hD:" arg; do |
| 13 | case $arg in |
| 14 | h) echo "Please read the JMK manual for more information." ;; |
| 15 | D) options="$options $(echo $OPTARG | sed 's/=/ /')" ;; |
| 16 | ?) echo "Invalid argument" |
| 17 | exit 1 ;; |
| 18 | esac |
| 19 | done |
| 20 | |
| 21 | echo "$options" |
| 22 | |
| 23 | for file in $(find -name Jmk2); do |
| 24 | echo "$file" > /dev/stderr |
| 25 | outdir="$(dirname $file)" |
| 26 | cat - $file << EOF | tclsh - $options > "$outdir/Makefile" |
| 27 | source {$root/share/jmk/jmk.tcl} |
| 28 | set root {$root} |
| 29 | set jmk_build_cmd {$0} |
| 30 | set jmk_build_dir {$(pwd)} |
| 31 | cd {$outdir} |
| 32 | array set options {$options} |
| 33 | EOF |
| 34 | done |