forked from lix-project/lix
* Cleanup; sync with thesis.
This commit is contained in:
parent
0399365675
commit
714b7256cd
|
@ -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";
|
||||||
|
|
|
@ -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];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 [])
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue