Project

General

Profile

1 9555 aaronmk
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.run
3 9854 aaronmk
.rel ../sh/local.sh
4 10096 aaronmk
.rel ../sh/datasrc.sh
5 9555 aaronmk
6
if self_not_included; then
7
8 14764 aaronmk
datasrc_dir="$(canon_rel_path "$top_dir"/..)"
9
10 9555 aaronmk
: "${schema="$(log+ 2 cd "$top_dir"/..; basename "$PWD")"}"
11 9585 aaronmk
: "${subdir="$(log+ 2 cd "$top_dir"   ; basename "$PWD")"}"
12
export schema subdir
13 10097 aaronmk
dir2schema
14 9555 aaronmk
15 9585 aaronmk
subdir_make()
16 9555 aaronmk
# requires Makefile in datasrc dir with `include ../input.Makefile`
17 9585 aaronmk
# target names are relative to the subdir itself, not the datasrc dir
18 9555 aaronmk
{
19 9584 aaronmk
	echo_func
20 9745 aaronmk
	set -- "${@/#/$subdir/}" # replace empty str at start (/#) with $subdir/
21 9943 aaronmk
	set -- "${@/%/${remake:+-remake}}" # replace empty str at end (/%)
22 14765 aaronmk
	make --directory="$datasrc_dir" "$@"
23 9555 aaronmk
}
24
25
fi