From 8aac5dc8b403110bc52571d74530f4e54a1a5a27 Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Fri, 27 Jun 2025 02:27:09 -0400 Subject: [PATCH] add hello world program --- .gitignore | 2 ++ Makefile | 14 ++++++++++++++ src/main.c | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..91ec74f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +hello-world diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91e72ae --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ + +OBJS = src/main.o + +all: hello-world + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +hello-world: $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) + +clean: + rm -f $(OBJS) hello-world + diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..82f8eec --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + printf("Hello, world!\n"); + return 0; +}