aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile24
-rw-r--r--src/Makefile22
-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
diff --git a/Makefile b/Makefile
index bceb62e..1c79ae9 100644
--- a/Makefile
+++ b/Makefile
@@ -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/client.c b/src/client.c
index 0b9cbfe..0b9cbfe 100644
--- a/client.c
+++ b/src/client.c
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/evloop.c b/src/evloop.c
index 5bed1e9..5bed1e9 100644
--- a/evloop.c
+++ b/src/evloop.c
diff --git a/evloop.h b/src/evloop.h
index f0d4f72..f0d4f72 100644
--- a/evloop.h
+++ b/src/evloop.h
diff --git a/server.c b/src/server.c
index 8525689..8525689 100644
--- a/server.c
+++ b/src/server.c
diff --git a/tpool.c b/src/tpool.c
index 1aa5986..1aa5986 100644
--- a/tpool.c
+++ b/src/tpool.c
diff --git a/tpool.h b/src/tpool.h
index e1079ef..e1079ef 100644
--- a/tpool.h
+++ b/src/tpool.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
diff --git a/util.c b/src/util.c
index b4053fd..b4053fd 100644
--- a/util.c
+++ b/src/util.c
diff --git a/util.h b/src/util.h
index 850a245..850a245 100644
--- a/util.h
+++ b/src/util.h