aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: bceb62e5a26064b3e2cb5ac6ef1f0c73032f5833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 $@ $^