CC = gcc CFLAGS = -lm -Wall -O2 Bin = server client all: make $(Bin) socket_wrapper.o: socket_wrapper.c socket_wrapper.h $(CC) -c socket_wrapper.c -o socket_wrapper.o $(CFLAGS) client: socket_wrapper.o client.c $(CC) -o client client.c socket_wrapper.o $(CFLAGS) server: $(CC) -o server server.c socket_wrapper.o $(CFLAGS) .PHONY: clean clean: rm *.o $(Bin)