about summary refs log tree commit diff
path: root/make/examples/not-so-simple-header-auto
diff options
context:
space:
mode:
Diffstat (limited to 'make/examples/not-so-simple-header-auto')
-rw-r--r--make/examples/not-so-simple-header-auto/bar/hello.h1
-rw-r--r--make/examples/not-so-simple-header-auto/default.nix11
-rw-r--r--make/examples/not-so-simple-header-auto/foo/fnord/indirect.h3
-rw-r--r--make/examples/not-so-simple-header-auto/foo/hello.c9
4 files changed, 24 insertions, 0 deletions
diff --git a/make/examples/not-so-simple-header-auto/bar/hello.h b/make/examples/not-so-simple-header-auto/bar/hello.h
new file mode 100644
index 000000000000..4595fad98d43
--- /dev/null
+++ b/make/examples/not-so-simple-header-auto/bar/hello.h
@@ -0,0 +1 @@
+#define WHAT "World"
diff --git a/make/examples/not-so-simple-header-auto/default.nix b/make/examples/not-so-simple-header-auto/default.nix
new file mode 100644
index 000000000000..9e84b0c28ae5
--- /dev/null
+++ b/make/examples/not-so-simple-header-auto/default.nix
@@ -0,0 +1,11 @@
+let {
+
+  inherit (import ../../lib) compileC findIncludes link;
+
+  hello = link {programName = "hello"; objects = compileC {
+    main = ./foo/hello.c;
+    localIncludes = "auto";
+  };};
+
+  body = [hello];
+}
diff --git a/make/examples/not-so-simple-header-auto/foo/fnord/indirect.h b/make/examples/not-so-simple-header-auto/foo/fnord/indirect.h
new file mode 100644
index 000000000000..2fde1e26c1dd
--- /dev/null
+++ b/make/examples/not-so-simple-header-auto/foo/fnord/indirect.h
@@ -0,0 +1,3 @@
+#define HELLO "Hello"
+
+#include "../../bar/hello.h"
diff --git a/make/examples/not-so-simple-header-auto/foo/hello.c b/make/examples/not-so-simple-header-auto/foo/hello.c
new file mode 100644
index 000000000000..7d5b402ce5c2
--- /dev/null
+++ b/make/examples/not-so-simple-header-auto/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;
+}