about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-05 18:56:20 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-05 18:56:20 -0700
commit267ebb590b0a08d6e8bc9e3f8644b491d0d790ac (patch)
treeb0a5106b3a9373764cf1148ce2827301f3fc7510
parentf2cafededd8d57237263fc7cb7d726ad1eacecd2 (diff)
downloadmu-267ebb590b0a08d6e8bc9e3f8644b491d0d790ac.tar.gz
1018 - build system now handles .mu layers
No support for tests yet. Need to manually run the current test with:
  $ mu string-test.mu

Also, string-equal seems to have a problem.
-rw-r--r--cpp/013run12
-rw-r--r--cpp/031string.mu (renamed from cpp/core.mu)7
-rwxr-xr-xcpp/build_and_test_until1
-rw-r--r--cpp/makefile3
-rw-r--r--cpp/string-test.mu6
5 files changed, 18 insertions, 11 deletions
diff --git a/cpp/013run b/cpp/013run
index 48de68d0..7296d128 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -83,10 +83,9 @@ inline bool done(routine& rr) {
 :(before "End Main")
 if (argc > 1) {
   setup();
+  load("core.mu");
   for (int i = 1; i < argc; ++i) {
-    ifstream fin(argv[i]);
-    while (!fin.eof()) add_recipe(fin);
-    fin.close();
+    load(argv[i]);
   }
 
   Trace_stream = new trace_stream;
@@ -97,6 +96,13 @@ if (argc > 1) {
   dump_memory();
 }
 
+:(code)
+void load(string filename) {
+  ifstream fin(filename.c_str());
+  while (!fin.eof()) add_recipe(fin);
+  fin.close();
+}
+
 //: helper for tests
 
 :(before "End Globals")
diff --git a/cpp/core.mu b/cpp/031string.mu
index b1fd34d2..eff288eb 100644
--- a/cpp/core.mu
+++ b/cpp/031string.mu
@@ -27,10 +27,3 @@ recipe string-equal [
   }
   reply 1:literal
 ]
-
-recipe main [
-  default-space:address:space <- new location:type, 30:literal
-  x:address:array:character <- new [abc]
-  y:address:array:character <- new [abd]
-  3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
-]
diff --git a/cpp/build_and_test_until b/cpp/build_and_test_until
index cd0db64b..6c469604 100755
--- a/cpp/build_and_test_until
+++ b/cpp/build_and_test_until
@@ -7,6 +7,7 @@ set -v
 make tangle/tangle
 make enumerate/enumerate
 ./tangle/tangle $(./enumerate/enumerate --until $* |grep -v '.mu$') |grep -v "^\s*//:" > mu.cc
+cat /dev/null $(./enumerate/enumerate --until $* |grep '.mu$') > core.mu
 make autogenerated_lists
 g++ -g -Wall -Wextra -fno-strict-aliasing mu.cc -o mu
 ./mu test
diff --git a/cpp/makefile b/cpp/makefile
index a42667c9..470c20c0 100644
--- a/cpp/makefile
+++ b/cpp/makefile
@@ -5,6 +5,7 @@ mu: makefile enumerate/enumerate tangle/tangle mu.cc
 # mu.cc
 mu.cc: 0*
 	./tangle/tangle $$(./enumerate/enumerate --until 999 |grep -v '.mu$$') |grep -v "^\s*//:" > mu.cc
+	cat $$(./enumerate/enumerate --until 999 |grep '.mu$$') > core.mu
 	@make autogenerated_lists >/dev/null
 
 enumerate/enumerate:
@@ -32,4 +33,4 @@ clena: clean
 clean:
 	cd enumerate && make clean
 	cd tangle && make clean
-	rm -rf mu.cc mu *_list
+	rm -rf mu.cc core.mu mu *_list
diff --git a/cpp/string-test.mu b/cpp/string-test.mu
new file mode 100644
index 00000000..158c59fd
--- /dev/null
+++ b/cpp/string-test.mu
@@ -0,0 +1,6 @@
+recipe main [
+  default-space:address:space <- new location:type, 30:literal
+  x:address:array:character <- new [abcd]
+  y:address:array:character <- new [abc]
+  3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
+]