mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
* ATerm library example.
This commit is contained in:
parent
17e20716c0
commit
f1ed34081e
30
examples/aterm/aterm/default.nix
Normal file
30
examples/aterm/aterm/default.nix
Normal file
@ -0,0 +1,30 @@
|
||||
rec {
|
||||
|
||||
inherit (import ../../../lib) compileC makeLibrary;
|
||||
|
||||
sources = [
|
||||
./afun.c
|
||||
./aterm.c
|
||||
./bafio.c
|
||||
./byteio.c
|
||||
./gc.c
|
||||
./hash.c
|
||||
./list.c
|
||||
./make.c
|
||||
./md5c.c
|
||||
./memory.c
|
||||
./tafio.c
|
||||
./version.c
|
||||
];
|
||||
|
||||
compile = fn: compileC {
|
||||
main = fn;
|
||||
localIncludes = "auto";
|
||||
};
|
||||
|
||||
libATerm = makeLibrary {
|
||||
libraryName = "ATerm";
|
||||
objects = map {function = compile; list = sources;};
|
||||
};
|
||||
|
||||
}
|
1
examples/aterm/default.nix
Normal file
1
examples/aterm/default.nix
Normal file
@ -0,0 +1 @@
|
||||
import test/default.nix
|
16
examples/aterm/test/default.nix
Normal file
16
examples/aterm/test/default.nix
Normal file
@ -0,0 +1,16 @@
|
||||
let {
|
||||
|
||||
inherit (import ../../../lib) compileC link;
|
||||
|
||||
inherit (import ../aterm) libATerm;
|
||||
|
||||
compile = fn: compileC {
|
||||
main = fn;
|
||||
localIncludes = "auto";
|
||||
cFlags = "-I../aterm";
|
||||
};
|
||||
|
||||
fib = link {objects = compile ./fib.c; libraries = libATerm;};
|
||||
|
||||
body = [fib];
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
[ (import ./trivial)
|
||||
(import ./simple-header)
|
||||
(import ./not-so-simple-header)
|
||||
(import ./not-so-simple-header-auto)
|
||||
(import ./aterm)
|
||||
]
|
@ -4,7 +4,7 @@ let {
|
||||
|
||||
hello = link {programName = "hello"; objects = compileC {
|
||||
main = ./foo/hello.c;
|
||||
localIncludes = import (findIncludes {main = toString ./foo/hello.c;});
|
||||
localIncludes = "auto";
|
||||
};};
|
||||
|
||||
body = [hello];
|
||||
|
Loading…
Reference in New Issue
Block a user