mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
* Cleanup; sync with thesis.
This commit is contained in:
parent
0399365675
commit
714b7256cd
3 changed files with 12 additions and 19 deletions
|
@ -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";
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
with (import ../../../lib);
|
||||
|
||||
let {
|
||||
|
||||
inherit (import ../../../lib) compileC link;
|
||||
|
||||
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)
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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 [])
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue