Revision 12983
Added by Aaron Marcuse-Kubitza almost 11 years ago
make.sh | ||
---|---|---|
31 | 31 |
# usage: target() { begin_target; use $target...; } |
32 | 32 |
alias begin_target='echo_target; echo_func; set_make_vars' # echo all targets |
33 | 33 |
|
34 |
# usage: set_make_vars; ...; remaking || check if exists
|
|
34 |
# usage: begin_target; ...; remaking || check if exists
|
|
35 | 35 |
# cmd line usage: [remake=1] func |
36 |
# **WARNING**: you *MUST* use set_make_vars at the beginning of any function
|
|
36 |
# **WARNING**: you *MUST* use begin_target at the beginning of any function
|
|
37 | 37 |
# that uses this, so that $_remake is properly set to $remake and not left at |
38 | 38 |
# its previous value |
39 | 39 |
alias remaking='test "$_remake"' |
40 | 40 |
|
41 |
# usage: set_make_vars; ...; with_rm target ... # progagates $rm/$remake
|
|
41 |
# usage: begin_target; ...; with_rm target ... # progagates $rm/$remake
|
|
42 | 42 |
# **WARNING**: only works inside a runscript target that starts w/ begin_target |
43 | 43 |
function with_rm() { remake="$_remake" "$@"; } |
44 | 44 |
alias with_rm='"with_rm" ' # last space alias-expands next word |
45 | 45 |
|
46 |
# usage: set_make_vars; check_target_exists
|
|
46 |
# usage: begin_target; check_target_exists
|
|
47 | 47 |
alias check_target_exists='remaking || require_not_exists "$target" || return 0' |
48 | 48 |
alias deferred_check_target_exists='remaking || declare if_not_exists=1' |
49 | 49 |
# defer check until to_file |
... | ... | |
51 | 51 |
alias wildcard1_target='local target="$(wildcard1 "$top_dir"/$target_filename)"' |
52 | 52 |
alias check_wildcard_target_exists='wildcard1_target; check_target_exists' |
53 | 53 |
|
54 |
# usage: set_make_vars; to_target cmd...
|
|
54 |
# usage: begin_target; to_target cmd...
|
|
55 | 55 |
alias to_target='stdout="$target" to_file ' # last space alias-expands next word |
56 | 56 |
|
57 | 57 |
make() # usage: make target... |
Also available in: Unified diff
fix: lib/sh/make.sh: direct the user to use begin_target instead of set_make_vars (set_make_vars is now used by begin_target)