aboutsummaryrefslogtreecommitdiff
path: root/example/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'example/Makefile')
-rw-r--r--example/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/example/Makefile b/example/Makefile
new file mode 100644
index 0000000..6f0fff8
--- /dev/null
+++ b/example/Makefile
@@ -0,0 +1,21 @@
+SERVER_NAME=server
+SERVER_OBJ=server.o ../src/server.o ../src/tsocket.o ../src/util.o ../src/evloop.o ../src/tpool.o ../src/connection.o ../src/acceptor.o
+
+CLIENT_NAME=client
+CLIENT_OBJ=client.o ../src/util.o
+
+.PHONY: all
+all: $(SERVER_NAME) $(CLIENT_NAME)
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+$(SERVER_NAME): $(SERVER_OBJ)
+ $(CC) -o $@ $^
+
+$(CLIENT_NAME): $(CLIENT_OBJ)
+ $(CC) -o $@ $^
+
+.PHONY: clean
+clean:
+ rm -rf $(CLIENT_NAME) $(SERVER_NAME) *.o