summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-12-25 10:14:11 +0100
committertomsmeding <tom.smeding@gmail.com>2016-12-25 10:14:11 +0100
commitef28fcb0f59d11bdf9f574a999045bc24ca40e18 (patch)
tree5e998366f3ef2f2be88216d28631656c84036e41 /Makefile
Initial
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1583287
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+CC = gcc
+CFLAGS = -Wall -Wextra -std=c11 -fwrapv
+ifneq ($(DEBUG),)
+ CFLAGS += -g
+else
+ CFLAGS += -O2
+endif
+BIN = cserver
+
+.PHONY: all clean remake
+
+all: $(BIN)
+
+clean:
+ rm -rf $(BIN) *.o *.dSYM
+
+remake: clean all
+
+
+$(BIN): $(patsubst %.c,%.o,$(wildcard *.c))
+ $(CC) -o $@ $^
+
+%.o: %.cpp $(wildcard *.h)
+ $(CC) $(CFLAGS) -c -o $@ $<