about summary refs log tree commit diff
path: root/make/examples/not-so-simple-header
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-05-02T15·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-05-02T15·25+0000
commit36fb29f8f0317144a0074d7b6689912a4dc40325 (patch)
tree026fb03a97ca8b40a04ab38fa29759dbb0a9081e /make/examples/not-so-simple-header
parent02f2da01426b338c75051397dcbdcb0c75913670 (diff)
* 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.

Diffstat (limited to 'make/examples/not-so-simple-header')
-rw-r--r--make/examples/not-so-simple-header/bar/hello.h1
-rw-r--r--make/examples/not-so-simple-header/default.nix14
-rw-r--r--make/examples/not-so-simple-header/foo/fnord/indirect.h3
-rw-r--r--make/examples/not-so-simple-header/foo/hello.c9
4 files changed, 27 insertions, 0 deletions
diff --git a/make/examples/not-so-simple-header/bar/hello.h b/make/examples/not-so-simple-header/bar/hello.h
new file mode 100644
index 000000000000..4595fad98d43
--- /dev/null
+++ b/make/examples/not-so-simple-header/bar/hello.h
@@ -0,0 +1 @@
+#define WHAT "World"
diff --git a/make/examples/not-so-simple-header/default.nix b/make/examples/not-so-simple-header/default.nix
new file mode 100644
index 000000000000..61ded57c82bb
--- /dev/null
+++ b/make/examples/not-so-simple-header/default.nix
@@ -0,0 +1,14 @@
+let {
+
+  inherit (import ../../lib) compileC link;
+
+  hello = link {programName = "hello"; objects = compileC {
+    main = ./foo/hello.c;
+    localIncludes = [
+      [./foo/fnord/indirect.h "fnord/indirect.h"]
+      [./bar/hello.h "fnord/../../bar/hello.h"]
+    ];
+  };};
+
+  body = [hello];
+}
diff --git a/make/examples/not-so-simple-header/foo/fnord/indirect.h b/make/examples/not-so-simple-header/foo/fnord/indirect.h
new file mode 100644
index 000000000000..2fde1e26c1dd
--- /dev/null
+++ b/make/examples/not-so-simple-header/foo/fnord/indirect.h
@@ -0,0 +1,3 @@
+#define HELLO "Hello"
+
+#include "../../bar/hello.h"
diff --git a/make/examples/not-so-simple-header/foo/hello.c b/make/examples/not-so-simple-header/foo/hello.c
new file mode 100644
index 000000000000..7d5b402ce5c2
--- /dev/null
+++ b/make/examples/not-so-simple-header/foo/hello.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+#include "fnord/indirect.h"
+
+int main(int argc, char * * argv)
+{
+    printf(HELLO " " WHAT "\n");
+    return 0;
+}