HW12/Makefile

40 lines
1.2 KiB
Makefile
Raw Normal View History

2020-12-03 23:06:26 +00:00
CC = gcc
2020-12-06 09:50:13 +00:00
CFLAGS = -lm -Wall -O2 -pthread
2020-12-04 09:13:56 +00:00
ServerBin = server p-server
ClientBin = client p-client
Bin = $(ServerBin) $(ClientBin)
2020-12-08 15:14:42 +00:00
ClientObject = display_bar.o socket_wrapper.o
ServerObject = display_bar.o socket_wrapper.o
2020-12-03 23:06:26 +00:00
all:
2020-12-04 04:39:58 +00:00
make $(Bin)
2020-12-03 23:06:26 +00:00
socket_wrapper.o: socket_wrapper.c socket_wrapper.h
2020-12-04 04:39:58 +00:00
$(CC) -c socket_wrapper.c -o socket_wrapper.o $(CFLAGS)
2020-12-07 17:59:11 +00:00
display_bar.o: display_bar.c display_bar.h
$(CC) -c display_bar.c -o display_bar.o $(CFLAGS)
2020-12-08 15:14:42 +00:00
#client
client: client.c $(ClientObject)
$(CC) -o client client.c $(ClientObject) $(CFLAGS)
p-client: p-client.c $(ClientObject)
2020-12-14 11:09:12 +00:00
$(CC) -o p-client p-client.c $(ClientObject) $(CFLAGS)
2020-12-08 15:14:42 +00:00
p-mulclient: p-client.c $(ClientObject)
$(CC) -o p-slowclient p-client.c $(ClientObject) $(CFLAGS) -D MUL_CLIENT=10
slowclient: client.c $(ClientObject)
$(CC) -o slowclient client.c $(ClientObject) $(CFLAGS) -D SLOW_CLIENT=1000
#server
server: server.c $(ServerObject)
$(CC) -o server server.c $(ServerObject) $(CFLAGS)
p-server: p-server.c $(ServerObject)
$(CC) -o p-server p-server.c $(ServerObject) $(CFLAGS)
slowserver: server.c $(ServerObject)
$(CC) -o slowserver server.c $(ServerObject) $(CFLAGS) -D SLOW_SERVER=100000
2020-12-03 23:06:26 +00:00
2020-12-06 06:22:56 +00:00
.PHONY: clean test
2020-12-03 23:06:26 +00:00
clean:
2020-12-04 04:39:58 +00:00
rm *.o $(Bin)
2020-12-04 09:13:56 +00:00
2020-12-06 06:22:56 +00:00
test:
make all
make slowclient
./test.sh