about summary refs log tree commit diff
path: root/make/examples/trivial
diff options
context:
space:
mode:
Diffstat (limited to 'make/examples/trivial')
-rw-r--r--make/examples/trivial/default.nix8
-rw-r--r--make/examples/trivial/hello.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/make/examples/trivial/default.nix b/make/examples/trivial/default.nix
new file mode 100644
index 000000000000..132245e5823f
--- /dev/null
+++ b/make/examples/trivial/default.nix
@@ -0,0 +1,8 @@
+let {
+
+  inherit (import ../../lib) compileC link;
+
+  hello = link {objects = compileC {main = ./hello.c;};};
+
+  body = [hello];
+}
diff --git a/make/examples/trivial/hello.c b/make/examples/trivial/hello.c
new file mode 100644
index 000000000000..237ad8ffe76f
--- /dev/null
+++ b/make/examples/trivial/hello.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char * * argv)
+{
+    printf("Hello World\n");
+    return 0;
+}