mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
* Merge remaining stuff from the nix-make branch.
* Add support for the creation of shared libraries to `compileC', `link', and `makeLibrary'. * Enable the ATerm library to be made into a shared library.
This commit is contained in:
parent
02f2da0142
commit
36fb29f8f0
22 changed files with 347 additions and 0 deletions
11
make/examples/simple-header/default.nix
Normal file
11
make/examples/simple-header/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
let {
|
||||
|
||||
inherit (import ../../lib) compileC link;
|
||||
|
||||
hello = link {objects = compileC {
|
||||
main = ./hello.c;
|
||||
localIncludes = [ [./hello.h "hello.h"] ];
|
||||
};};
|
||||
|
||||
body = [hello];
|
||||
}
|
9
make/examples/simple-header/hello.c
Normal file
9
make/examples/simple-header/hello.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include "hello.h"
|
||||
|
||||
int main(int argc, char * * argv)
|
||||
{
|
||||
printf("Hello " WHAT "\n");
|
||||
return 0;
|
||||
}
|
1
make/examples/simple-header/hello.h
Normal file
1
make/examples/simple-header/hello.h
Normal file
|
@ -0,0 +1 @@
|
|||
#define WHAT "World"
|
Loading…
Add table
Add a link
Reference in a new issue