diff options
-rw-r--r-- | Makefile | 24 | ||||
-rw-r--r-- | src/Makefile | 22 | ||||
-rw-r--r-- | src/acceptor.c (renamed from acceptor.c) | 0 | ||||
-rw-r--r-- | src/acceptor.h (renamed from acceptor.h) | 0 | ||||
-rw-r--r-- | src/client.c (renamed from client.c) | 0 | ||||
-rw-r--r-- | src/connection.c (renamed from connection.c) | 0 | ||||
-rw-r--r-- | src/connection.h (renamed from connection.h) | 0 | ||||
-rw-r--r-- | src/constant.h (renamed from constant.h) | 0 | ||||
-rw-r--r-- | src/evloop.c (renamed from evloop.c) | 0 | ||||
-rw-r--r-- | src/evloop.h (renamed from evloop.h) | 0 | ||||
-rw-r--r-- | src/server.c (renamed from server.c) | 0 | ||||
-rw-r--r-- | src/tpool.c (renamed from tpool.c) | 0 | ||||
-rw-r--r-- | src/tpool.h (renamed from tpool.h) | 0 | ||||
-rw-r--r-- | src/tsocket.c (renamed from tsocket.c) | 0 | ||||
-rw-r--r-- | src/tsocket.h (renamed from tsocket.h) | 0 | ||||
-rw-r--r-- | src/util.c (renamed from util.c) | 0 | ||||
-rw-r--r-- | src/util.h (renamed from util.h) | 0 |
17 files changed, 25 insertions, 21 deletions
@@ -1,22 +1,4 @@ -CC ?= gcc -CFLAGS ?= -lpthread +default: all -.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 $@ $^ +.DEFAULT: + cd src && $(MAKE) $@ 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 $@ $^ diff --git a/acceptor.c b/src/acceptor.c index 1f28fcc..1f28fcc 100644 --- a/acceptor.c +++ b/src/acceptor.c diff --git a/acceptor.h b/src/acceptor.h index f4c9284..f4c9284 100644 --- a/acceptor.h +++ b/src/acceptor.h diff --git a/connection.c b/src/connection.c index c164ec8..c164ec8 100644 --- a/connection.c +++ b/src/connection.c diff --git a/connection.h b/src/connection.h index 4e14487..4e14487 100644 --- a/connection.h +++ b/src/connection.h diff --git a/constant.h b/src/constant.h index 1bb6bf4..1bb6bf4 100644 --- a/constant.h +++ b/src/constant.h diff --git a/tsocket.c b/src/tsocket.c index 8d8038a..8d8038a 100644 --- a/tsocket.c +++ b/src/tsocket.c diff --git a/tsocket.h b/src/tsocket.h index 5028b04..5028b04 100644 --- a/tsocket.h +++ b/src/tsocket.h |