CC = gcc CFLAGS = -lm -Wall -O2 -pthread ServerBin = server p-server ClientBin = client p-client Bin = $(ServerBin) $(ClientBin) all: make $(Bin) socket_wrapper.o: socket_wrapper.c socket_wrapper.h $(CC) -c socket_wrapper.c -o socket_wrapper.o $(CFLAGS) display_bar.o: display_bar.c display_bar.h $(CC) -c display_bar.c -o display_bar.o $(CFLAGS) client: socket_wrapper.o client.c $(CC) -o client client.c socket_wrapper.o $(CFLAGS) server: socket_wrapper.o server.c display_bar.o $(CC) -o server server.c socket_wrapper.o display_bar.o $(CFLAGS) p-server: socket_wrapper.o p-server.c $(CC) -o p-server p-server.c socket_wrapper.o $(CFLAGS) p-client: socket_wrapper.o p-client.c $(CC) -o p-client p-client.c socket_wrapper.o $(CFLAGS) p-mulclient: socket_wrapper.o p-client.c $(CC) -o p-slowclient p-client.c socket_wrapper.o $(CFLAGS) -D MUL_CLIENT=10 slowclient: socket_wrapper.o client.c $(CC) -o slowclient client.c socket_wrapper.o $(CFLAGS) -D SLOW_CLIENT=1000 .PHONY: clean test clean: rm *.o $(Bin) test: make all make slowclient ./test.sh