CC = gcc
CFLAGS = -Wall -Wextra -O3 -D_GNU_SOURCE -pthread
LDFLAGS = -lpthread
TARGETS = fastsync_server fastsync_client

all: $(TARGETS)

fastsync_server: src/server.o src/utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

fastsync_client: src/client.o src/utils.o
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

src/%.o: src/%.c src/common.h
	$(CC) $(CFLAGS) -c -o $@ $<

clean:
	rm -f src/*.o $(TARGETS)

.PHONY: all clean
