From 7369505397cdfddf0883e2c24e1652df8bd488fe Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 16 Dec 2022 13:53:35 +0800 Subject: Refactor file structure --- src/Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Makefile (limited to 'src/Makefile') 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 $@ $^ -- cgit v1.2.3