HW12/Makefile

40 lines
1.2 KiB
Makefile
Raw Normal View History

2020-12-04 08:06:26 +09:00
CC = gcc
2020-12-06 18:50:13 +09:00
CFLAGS = -lm -Wall -O2 -pthread
2020-12-04 18:13:56 +09:00
ServerBin = server p-server
ClientBin = client p-client
Bin = $(ServerBin) $(ClientBin)
2020-12-09 00:14:42 +09:00
ClientObject = display_bar.o socket_wrapper.o
ServerObject = display_bar.o socket_wrapper.o
2020-12-04 08:06:26 +09:00
all:
2020-12-04 13:39:58 +09:00
make $(Bin)
2020-12-04 08:06:26 +09:00
socket_wrapper.o: socket_wrapper.c socket_wrapper.h
2020-12-04 13:39:58 +09:00
$(CC) -c socket_wrapper.c -o socket_wrapper.o $(CFLAGS)
2020-12-08 02:59:11 +09:00
display_bar.o: display_bar.c display_bar.h
$(CC) -c display_bar.c -o display_bar.o $(CFLAGS)
2020-12-09 00:14:42 +09:00
#client
client: client.c $(ClientObject)
$(CC) -o client client.c $(ClientObject) $(CFLAGS)
p-client: p-client.c $(ClientObject)
2020-12-04 16:48:03 +09:00
$(CC) -o p-client p-client.c socket_wrapper.o $(CFLAGS)
2020-12-09 00:14:42 +09: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-04 08:06:26 +09:00
2020-12-06 15:22:56 +09:00
.PHONY: clean test
2020-12-04 08:06:26 +09:00
clean:
2020-12-04 13:39:58 +09:00
rm *.o $(Bin)
2020-12-04 18:13:56 +09:00
2020-12-06 15:22:56 +09:00
test:
make all
make slowclient
./test.sh