From e339f2d269fcaffed7beed67c3995fe3b67393eb Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sat, 17 Dec 2022 21:24:04 +0800 Subject: Support on_connect function in server lib --- src/Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index bceb62e..a478ecf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,22 +1,17 @@ CC ?= gcc CFLAGS ?= -lpthread +SOURCES := $(wildcard *.c) +OBJECTS := $(patsubst %.c, %.o, $(SOURCES)) .PHONY: all -all: client server +all: $(OBJECTS) .PHONY: debug debug: CFLAGS += -g -DDEBUG=1 -debug: server client .PHONY: clean clean: - rm -rf client server *.o + rm -rf *.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