Project

General

Profile

1
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.run
3
.rel ../sh/local.sh
4
.rel ../sh/datasrc.sh
5

    
6
if self_not_included; then
7

    
8
datasrc_dir="$(canon_rel_path "$top_dir"/..)"
9

    
10
: "${schema="$(log+ 2 cd "$top_dir"/..; basename "$PWD")"}"
11
: "${subdir="$(log+ 2 cd "$top_dir"   ; basename "$PWD")"}"
12
export schema subdir
13
dir2schema
14

    
15
subdir_make()
16
# requires Makefile in datasrc dir with `include ../input.Makefile`
17
# target names are relative to the subdir itself, not the datasrc dir
18
{
19
	echo_func
20
	set -- "${@/#/$subdir/}" # replace empty str at start (/#) with $subdir/
21
	set -- "${@/%/${remake:+-remake}}" # replace empty str at end (/%)
22
	make --directory="$datasrc_dir" "$@"
23
}
24

    
25
fi
(14-14/18)