* ATerm library example.

This commit is contained in:
Eelco Dolstra 2004-07-06 17:27:11 +00:00
parent 17e20716c0
commit f1ed34081e
5 changed files with 50 additions and 1 deletions

View 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;};
};
}

View File

@ -0,0 +1 @@
import test/default.nix

View 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];
}

View File

@ -1,4 +1,6 @@
[ (import ./trivial) [ (import ./trivial)
(import ./simple-header) (import ./simple-header)
(import ./not-so-simple-header) (import ./not-so-simple-header)
(import ./not-so-simple-header-auto)
(import ./aterm)
] ]

View File

@ -4,7 +4,7 @@ let {
hello = link {programName = "hello"; objects = compileC { hello = link {programName = "hello"; objects = compileC {
main = ./foo/hello.c; main = ./foo/hello.c;
localIncludes = import (findIncludes {main = toString ./foo/hello.c;}); localIncludes = "auto";
};}; };};
body = [hello]; body = [hello];