aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..bceb62e
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,22 @@
+CC ?= gcc
+CFLAGS ?= -lpthread
+
+.PHONY: all
+all: client server
+
+.PHONY: debug
+debug: CFLAGS += -g -DDEBUG=1
+debug: server client
+
+.PHONY: clean
+clean:
+ rm -rf client server *.o
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+
+client: client.o util.o
+ $(CC) -o $@ $^
+
+server: server.o util.o evloop.o tsocket.o acceptor.o connection.o tpool.o
+ $(CC) -o $@ $^