aboutsummaryrefslogtreecommitdiff
path: root/example/Makefile
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-12-17 21:24:04 +0800
committerGuangxiong Lin <[email protected]>2022-12-17 21:53:40 +0800
commite339f2d269fcaffed7beed67c3995fe3b67393eb (patch)
treef1a94f746808d2e90023b0d0cdbc8307b5648f88 /example/Makefile
parent7bb3515bc303a2a35fe859bcdba2795fbe06643d (diff)
downloadtinyserver-e339f2d269fcaffed7beed67c3995fe3b67393eb.tar.gz
tinyserver-e339f2d269fcaffed7beed67c3995fe3b67393eb.tar.bz2
tinyserver-e339f2d269fcaffed7beed67c3995fe3b67393eb.zip
Support on_connect function in server libHEADmaster
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