about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-08-14T10·19+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-08-14T10·19+0000
commit714b7256cd5a6783813c3d3a7468f36ba637f567 (patch)
tree7383259dc8998d20ac10142beb96c73816c5b011
parent039936567539c1d6d7a3b824b94726b3fed3343b (diff)
* Cleanup; sync with thesis.
-rw-r--r--make/examples/aterm/aterm/default.nix6
-rw-r--r--make/examples/aterm/test/default.nix21
-rw-r--r--make/lib/default.nix4
3 files changed, 12 insertions, 19 deletions
diff --git a/make/examples/aterm/aterm/default.nix b/make/examples/aterm/aterm/default.nix
index 8b139219e916..56e830c84af4 100644
--- a/make/examples/aterm/aterm/default.nix
+++ b/make/examples/aterm/aterm/default.nix
@@ -19,11 +19,7 @@ rec {
     ./version.c
   ];
 
-  compile = fn: compileC {
-    main = fn;
-    localIncludes = "auto";
-    forSharedLib = sharedLib;
-  };
+  compile = main: compileC {inherit main sharedLib;};
 
   libATerm = makeLibrary {
     libraryName = "ATerm";
diff --git a/make/examples/aterm/test/default.nix b/make/examples/aterm/test/default.nix
index b7a9dd361977..8d2bed5fc388 100644
--- a/make/examples/aterm/test/default.nix
+++ b/make/examples/aterm/test/default.nix
@@ -1,18 +1,15 @@
-let {
-
-  inherit (import ../../../lib) compileC link;
+with (import ../../../lib);
 
+let {
   inherit (import ../aterm {}) libATerm;
 
-  compile = fn: compileC {
-    main = fn;
-    localIncludes = "auto";
-    cFlags = "-I../aterm";
+  compileTest = main: link {
+    objects = [(compileC {inherit main; cFlags = "-I../aterm";})];
+    libraries = libATerm;
   };
 
-  fib = link {objects = compile ./fib.c; libraries = libATerm;};
-
-  primes = link {objects = compile ./primes.c; libraries = libATerm;};
-  
-  body = [fib primes];
+  body = [
+    (compileTest ./fib.c)
+    (compileTest ./primes.c)
+  ];
 }
diff --git a/make/lib/default.nix b/make/lib/default.nix
index a5059252daa7..a9b17d2ced77 100644
--- a/make/lib/default.nix
+++ b/make/lib/default.nix
@@ -8,7 +8,7 @@ rec {
   stdenv = pkgs.stdenv;
   
 
-  compileC = {main, localIncludes ? [], cFlags ? "", forSharedLib ? false}:
+  compileC = {main, localIncludes ? "auto", cFlags ? "", sharedLib ? false}:
   stdenv.mkDerivation {
     name = "compile-c";
     builder = ./compile-c.sh;
@@ -24,7 +24,7 @@ rec {
     inherit main;
     cFlags = [
       cFlags
-      (if forSharedLib then ["-fpic"] else [])
+      (if sharedLib then ["-fpic"] else [])
     ];
   };