* Cleanup; sync with thesis.

This commit is contained in:
Eelco Dolstra 2005-08-14 10:19:55 +00:00
parent 0399365675
commit 714b7256cd
3 changed files with 12 additions and 19 deletions

View file

@ -19,11 +19,7 @@ rec {
./version.c ./version.c
]; ];
compile = fn: compileC { compile = main: compileC {inherit main sharedLib;};
main = fn;
localIncludes = "auto";
forSharedLib = sharedLib;
};
libATerm = makeLibrary { libATerm = makeLibrary {
libraryName = "ATerm"; libraryName = "ATerm";

View file

@ -1,18 +1,15 @@
with (import ../../../lib);
let { let {
inherit (import ../../../lib) compileC link;
inherit (import ../aterm {}) libATerm; inherit (import ../aterm {}) libATerm;
compile = fn: compileC { compileTest = main: link {
main = fn; objects = [(compileC {inherit main; cFlags = "-I../aterm";})];
localIncludes = "auto"; libraries = libATerm;
cFlags = "-I../aterm";
}; };
fib = link {objects = compile ./fib.c; libraries = libATerm;}; body = [
(compileTest ./fib.c)
primes = link {objects = compile ./primes.c; libraries = libATerm;}; (compileTest ./primes.c)
];
body = [fib primes];
} }

View file

@ -8,7 +8,7 @@ rec {
stdenv = pkgs.stdenv; stdenv = pkgs.stdenv;
compileC = {main, localIncludes ? [], cFlags ? "", forSharedLib ? false}: compileC = {main, localIncludes ? "auto", cFlags ? "", sharedLib ? false}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "compile-c"; name = "compile-c";
builder = ./compile-c.sh; builder = ./compile-c.sh;
@ -24,7 +24,7 @@ rec {
inherit main; inherit main;
cFlags = [ cFlags = [
cFlags cFlags
(if forSharedLib then ["-fpic"] else []) (if sharedLib then ["-fpic"] else [])
]; ];
}; };