summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile17
-rw-r--r--src/main.c7
3 files changed, 26 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0949834
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+obj
+main
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..10e7c66
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+CC=tcc
+SRC=src
+OBJ=obj
+SOURCES=$(wildcard $(SRC)/*.c)
+OBJECTS=$(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES))
+BIN=main
+
+
+$(BIN): $(OBJECTS)
+ $(CC) $(OBJECTS) -o $(BIN)
+
+$(OBJ)/%.o: $(SRC)/%.c
+ $(CC) -c $< -o $@
+
+clean:
+ rm -r $(BIN) $(OBJ)/*.o
+
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..ce974d6
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+
+int main() {
+ printf("Hello, world\n");
+ return 0;
+}