summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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 $@ $<