summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.cc>2026-09-11 03:11:25 +0300
committerhybrid <hybrid@hybridlabs.cc>2026-09-11 03:11:25 +0300
commit5963ab04e219636c8417de32b1b1dacd98983cd3 (patch)
treefd353c87638b5f6aa7c6a8f11f0d20288fc0cfda
downloadc-project-5963ab04e219636c8417de32b1b1dacd98983cd3.tar.gz
c-project-5963ab04e219636c8417de32b1b1dacd98983cd3.tar.bz2
c-project-5963ab04e219636c8417de32b1b1dacd98983cd3.zip
add: initmain
-rw-r--r--.gitignore59
-rw-r--r--Makefile19
-rw-r--r--src/main.c8
3 files changed, 86 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..11e7834
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,59 @@
+# Build directory
+bin/**
+
+# Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+PROTOCOL
+
+# emacs specific
+*~ \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..58421aa
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+SRCDIR := src
+BINDIR := bin
+
+CC := /usr/bin/gcc
+CFLAGS := -Wall -std=c99 -g
+
+TARGET := bin/main
+
+all: $(TARGET)
+
+$(TARGET): src/main.c | $(BINDIR)
+ $(CC) $(CFLAGS) $< -o $@ $(LDLIBS)
+
+$(BINDIR):
+ @mkdir bin
+
+.PHONY: clean
+clean:
+ rm -rf bin
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..effe055
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void) {
+ printf("Hello, world!\n");
+
+ exit(EXIT_SUCCESS);
+}