summaryrefslogtreecommitdiff
path: root/gen.rc
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-12 22:34:23 -0700
committerMichael Forney <mforney@mforney.org>2016-04-15 02:10:08 -0700
commit9c2e14cc8a64b62f0ee607ec924ce76a4f2a04ac (patch)
treeb324a4faffa057f48078aadcf054374d83784213 /gen.rc
parentb88023a0c8cced80c765ac47c731627e837f2652 (diff)
Move ninja helpers to ninja.rc
Diffstat (limited to 'gen.rc')
-rw-r--r--gen.rc91
1 files changed, 0 insertions, 91 deletions
diff --git a/gen.rc b/gen.rc
index 03385ce5..5a153d99 100644
--- a/gen.rc
+++ b/gen.rc
@@ -1,94 +1,3 @@
-fn stamp {
- build '$outdir/stamp' stamp '$outdir'/$*
-}
-
-fn cflags {
- set cflags '$cflags' $*
-}
-
-fn cc {
- src=$1 obj=$src.o {
- shift
- if(! ~ $src '$'*) {
- src='$srcdir'/src/$src
- obj='$outdir'/$obj
- }
- build $obj cc $src $*
- }
-}
-
-fn link {
- out='$outdir'/$1 objs=() {
- shift
- for(obj in $*) {
- if(! ~ $obj '$'*) obj='$outdir'/$obj
- objs=( $objs $obj )
- }
- build $out link $objs
- }
-}
-
-fn ar {
- out='$outdir'/$1 objs=() {
- shift
- for(obj in $*) {
- if(! ~ $obj '$'*) obj='$outdir'/$obj
- objs=( $objs $obj )
- }
- build $out ar $objs
- }
-}
-
-fn static_lib {
- out=$1 {
- shift
- for(src) cc $src
- ar $out $*.o
- }
-}
-
-fn exe {
- out=$1 objs=() {
- shift
- for(src) {
- if(~ $src *.c) {
- cc $src
- obj=$src.o
- }
- if not obj=$src
- objs=( $objs $obj )
- }
- link $out $objs
- }
-}
-
-fn yacc {
- outs='$outdir'/$1.tab.^( c h ) {
- let yaccflags '-d -b '$1 -- build $"outs yacc $2
- }
-}
-
-fn file {
- out='$hash_root'/$1
- let args 100$3' '$1 --\
- build $out githash $2 '|' '$repo.stamp' '$root_srcdir/scripts/hash.rc'
- root_inputs=( $root_inputs $out )
-
- if(! ~ $3 755 644) root_perms=( $root_perms 100$3' '$1 )
- status=()
-}
-
-fn dir {
- root_perms=( $root_perms '010'$2' '$1 )
-}
-
-fn sym {
- out='$hash_root'/$1
- let args 120000' '$1' '$2 --\
- build $out githash '| $repo.stamp' '$root_srcdir/scripts/hash.rc'
- root_inputs=( $root_inputs $out )
-}
-
root_inputs=()
root_perms=()