summaryrefslogtreecommitdiff
path: root/src/c/__Makefile__
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/__Makefile__')
-rw-r--r--src/c/__Makefile__30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/c/__Makefile__ b/src/c/__Makefile__
new file mode 100644
index 0000000..d6e2bf1
--- /dev/null
+++ b/src/c/__Makefile__
@@ -0,0 +1,30 @@
+# Minimal Makefile to compile main.c into an executable named main
+
+# Compiler
+CC = gcc
+
+
+# Flags
+CFLAGS = -Wall -Wextra -O2
+
+
+# Default target
+# Tells make what dependencies to compile
+all: main
+
+
+# Dependency 'main'
+# main.c is the source file
+main: main.c
+ $(CC) $(CFLAGS) -o main main.c
+
+
+# Test target
+test: main
+ @echo -n "main.c test............................"
+ @./main >/dev/null 2>&1 && echo "OK" || echo "FAILED"
+
+
+# Clean target
+clean:
+ rm -f main