HW12/Makefile

35 lines
1.0 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-04 13:39:58 +09:00
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-04 08:06:26 +09:00
client: socket_wrapper.o client.c
$(CC) -o client client.c socket_wrapper.o $(CFLAGS)
2020-12-08 02:59:11 +09:00
server: socket_wrapper.o server.c display_bar.o
$(CC) -o server server.c socket_wrapper.o display_bar.o $(CFLAGS)
2020-12-04 16:48:03 +09:00
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)
2020-12-05 11:13:13 +09:00
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
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