Revision 9667
Added by Aaron Marcuse-Kubitza about 11 years ago
make.sh | ||
---|---|---|
5 | 5 |
|
6 | 6 |
if isset rm; then : "${remake:=$rm}"; fi #mnemonic: files are rm'd (overwritten) |
7 | 7 |
|
8 |
# usage: remaking || check if exists |
|
9 |
# cmd line usage: [remake=1] func |
|
10 |
alias remaking='test "$remake"' |
|
11 |
|
|
12 | 8 |
# usage: target_filename/command() { echo_func; set_make_vars; use $target...; } |
13 | 9 |
alias set_make_vars="$(cat <<'EOF' |
14 | 10 |
local command="${FUNCNAME##*/}"; echo_vars command |
15 | 11 |
local target_filename="${FUNCNAME%/*}"; echo_vars target_filename |
16 | 12 |
local target="$top_dir/$target_filename"; echo_vars target |
17 | 13 |
local target_stem="${target_filename%.*}"; echo_vars target_stem |
14 |
local _remake="$remake" remake= # don\'t progagate remake to prerequisites |
|
18 | 15 |
EOF |
19 | 16 |
)" |
20 | 17 |
|
18 |
# usage: remaking || check if exists |
|
19 |
# cmd line usage: [remake=1] func |
|
20 |
alias remaking='test "$_remake"' |
|
21 |
|
|
21 | 22 |
# usage: set_make_vars; check_target_exists |
22 | 23 |
alias check_target_exists='remaking || require_not_exists "$target" || return 0' |
23 | 24 |
alias check_fake_target_exists='remaking || declare if_not_exists=1' |
Also available in: Unified diff
lib/sh/make.sh: set_make_vars: don't progagate remake to prerequisites, so that remake=1 only applies to the outermost target rather than forcing every prerequisite to be remade, too