summaryrefslogtreecommitdiff
path: root/ninja.rc
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-07-10 12:37:55 -0700
committerMichael Forney <mforney@mforney.org>2016-07-10 12:37:55 -0700
commit8d37aa716d4c4232343509ca9aae47bd249a750e (patch)
tree7a40b86d8f6819934b6814ef8140d4e30b35170b /ninja.rc
parent064f02c45807259d435082c93cd9dae4b1ea4621 (diff)
Delete sub and go back to subninja
Using a pipe allows us to specify the file name only once, but also runs in a subshell, so we lose the list of dependent sources. So, just go back to subninja, and make it slightly cleaner by assuming $dir.
Diffstat (limited to 'ninja.rc')
-rw-r--r--ninja.rc10
1 files changed, 4 insertions, 6 deletions
diff --git a/ninja.rc b/ninja.rc
index c279dd4e..36d431b9 100644
--- a/ninja.rc
+++ b/ninja.rc
@@ -16,18 +16,16 @@ fn with {
}
fn subninja {
- echo subninja $*
+ file=$1
+ if(! ~ $file '$'*)
+ file='$dir'/$file
+ echo subninja $file
}
fn include {
echo include $*
}
-fn sub {
- cat >$1
- subninja '$dir'/$1
-}
-
fn rule {
name=$1 {
shift