]> git.mdlowis.com Git - proto/gir.git/commitdiff
Setup to generate artiacts into build/
authorMike D. Lowis <mike.lowis@gentex.com>
Fri, 25 Sep 2015 15:03:26 +0000 (11:03 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Fri, 25 Sep 2015 15:03:26 +0000 (11:03 -0400)
build.ninja

index 92b2c34d27871f7f8fa010f1cd4edfaa78b1783f..24c6c198deded480e48cc6b7f3f55a15fe3fce80 100644 (file)
@@ -1,10 +1,10 @@
 # Construction Variables
-cc      = gcc
-ar      = ar
-ld      = gcc
-cflags  = -g -O3 -Wall -Wextra --std=c99 --pedantic
-incdirs = -Isource/ -Imodules/atf/source/
-depgen  =
+builddir = build
+cc       = gcc
+ar       = ar
+ld       = gcc
+cflags   = -g -O3 -Wall -Wextra --std=c99 --pedantic
+incdirs  = -Isource/ -Imodules/atf/source/
 
 # Construction Rules
 rule cc
@@ -21,56 +21,56 @@ rule ar
     description = AR $out
 
 rule runtest
-    command = ./$in > $out && cat $out
+    command = $in > $out && cat $out
     description = TEST $out
 
 # Build the static library
-build source/gir.o: cc source/gir.c
-build source/hamt.o: cc source/hamt.c
-build source/parser.o: cc source/parser.c
-build source/slist.o: cc source/slist.c
-build libgir.a: ar source/gir.o source/hamt.o source/parser.o source/slist.o
+build $builddir/source/gir.o: cc source/gir.c
+build $builddir/source/hamt.o: cc source/hamt.c
+build $builddir/source/parser.o: cc source/parser.c
+build $builddir/source/slist.o: cc source/slist.c
+build $builddir/libgir.a: ar $builddir/source/gir.o $builddir/source/hamt.o $builddir/source/parser.o $builddir/source/slist.o
 
 # Build the interpreter
-build source/main.o: cc source/main.c
-build gir: ld source/main.o libgir.a
+build $builddir/source/main.o: cc source/main.c
+build $builddir/gir: ld $builddir/source/main.o $builddir/libgir.a
 
 # Build the test suite
-build modules/atf/source/atf.o: cc modules/atf/source/atf.c
-build tests/test_block.o: cc tests/test_block.c
-build tests/test_false.o: cc tests/test_false.c
-build tests/test_list.o: cc tests/test_list.c
-build tests/test_map.o: cc tests/test_map.c
-build tests/test_num.o: cc tests/test_num.c
-build tests/test_string.o: cc tests/test_string.c
-build tests/test_true.o: cc tests/test_true.c
-build tests/test_array.o: cc tests/test_array.c
-build tests/test_bool.o: cc tests/test_bool.c
-build tests/test_gir.o: cc tests/test_gir.c
-build tests/test_lobby.o: cc tests/test_lobby.c
-build tests/test_nil.o: cc tests/test_nil.c
-build tests/test_set.o: cc tests/test_set.c
-build tests/test_symbol.o: cc tests/test_symbol.c
-build tests/main.o: cc tests/main.c
-build test_gir: ld           $
-    modules/atf/source/atf.o $
-    tests/test_block.o       $
-    tests/test_false.o       $
-    tests/test_list.o        $
-    tests/test_map.o         $
-    tests/test_num.o         $
-    tests/test_string.o      $
-    tests/test_true.o        $
-    tests/test_array.o       $
-    tests/test_bool.o        $
-    tests/test_gir.o         $
-    tests/test_lobby.o       $
-    tests/test_nil.o         $
-    tests/test_set.o         $
-    tests/test_symbol.o      $
-    tests/main.o             $
-    libgir.a
+build $builddir/modules/atf/source/atf.o: cc modules/atf/source/atf.c
+build $builddir/tests/test_block.o: cc tests/test_block.c
+build $builddir/tests/test_false.o: cc tests/test_false.c
+build $builddir/tests/test_list.o: cc tests/test_list.c
+build $builddir/tests/test_map.o: cc tests/test_map.c
+build $builddir/tests/test_num.o: cc tests/test_num.c
+build $builddir/tests/test_string.o: cc tests/test_string.c
+build $builddir/tests/test_true.o: cc tests/test_true.c
+build $builddir/tests/test_array.o: cc tests/test_array.c
+build $builddir/tests/test_bool.o: cc tests/test_bool.c
+build $builddir/tests/test_gir.o: cc tests/test_gir.c
+build $builddir/tests/test_lobby.o: cc tests/test_lobby.c
+build $builddir/tests/test_nil.o: cc tests/test_nil.c
+build $builddir/tests/test_set.o: cc tests/test_set.c
+build $builddir/tests/test_symbol.o: cc tests/test_symbol.c
+build $builddir/tests/main.o: cc tests/main.c
+build $builddir/test_gir: ld           $
+    $builddir/modules/atf/source/atf.o $
+    $builddir/tests/test_block.o       $
+    $builddir/tests/test_false.o       $
+    $builddir/tests/test_list.o        $
+    $builddir/tests/test_map.o         $
+    $builddir/tests/test_num.o         $
+    $builddir/tests/test_string.o      $
+    $builddir/tests/test_true.o        $
+    $builddir/tests/test_array.o       $
+    $builddir/tests/test_bool.o        $
+    $builddir/tests/test_gir.o         $
+    $builddir/tests/test_lobby.o       $
+    $builddir/tests/test_nil.o         $
+    $builddir/tests/test_set.o         $
+    $builddir/tests/test_symbol.o      $
+    $builddir/tests/main.o             $
+    $builddir/libgir.a
 
 # Run the test suite
-build tests.log: runtest test_gir
+build $builddir/tests.log: runtest $builddir/test_gir