From a9ef380662da3efa382017ff8423f1a894b31bfd Mon Sep 17 00:00:00 2001
From: lonkaars <loek@pipeframe.xyz>
Date: Tue, 6 Feb 2024 13:22:04 +0100
Subject: dynamic linking application starts

---
 software/helloworld/.gitignore |  1 +
 software/helloworld/main.c     | 12 ++++++++++++
 software/helloworld/makefile   | 11 +++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 software/helloworld/.gitignore
 create mode 100644 software/helloworld/main.c
 create mode 100644 software/helloworld/makefile

(limited to 'software/helloworld')

diff --git a/software/helloworld/.gitignore b/software/helloworld/.gitignore
new file mode 100644
index 0000000..31e0fce
--- /dev/null
+++ b/software/helloworld/.gitignore
@@ -0,0 +1 @@
+helloworld
diff --git a/software/helloworld/main.c b/software/helloworld/main.c
new file mode 100644
index 0000000..126a97a
--- /dev/null
+++ b/software/helloworld/main.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <sys/random.h>
+
+int main(void) {
+	int x;
+
+	getrandom(&x, sizeof(typeof(x)), 0);
+	printf("Random number from the kernel: %d\n", x);
+
+	return 0;
+}
+
diff --git a/software/helloworld/makefile b/software/helloworld/makefile
new file mode 100644
index 0000000..0cd6c19
--- /dev/null
+++ b/software/helloworld/makefile
@@ -0,0 +1,11 @@
+CC = $(CROSS_COMPILE)gcc
+
+LFLAGS += -lc
+
+helloworld: main.c
+	$(CC) $^ $(CFLAGS) $(LFLAGS) -o $@
+
+.PHONY: clean
+clean:
+	$(RM) helloworld
+
-- 
cgit v1.2.3