HW12/Makefile

36 lines
1.1 KiB
Makefile
Raw Normal View History

2020-12-04 08:06:26 +09:00
CC = gcc
CFLAGS = -lm -Wall -O2
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-04 08:06:26 +09:00
client: socket_wrapper.o client.c
$(CC) -o client client.c socket_wrapper.o $(CFLAGS)
2020-12-04 16:48:03 +09:00
server: socket_wrapper.o server.c
2020-12-05 10:25:54 +09:00
$(CC) -o server server.c socket_wrapper.o $(CFLAGS) -pthread
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-04 18:13:56 +09:00
.PHONY: clean moveall
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
rm $(addprefix client_test/,$(ClientBin))
rm $(addprefix server_test/,$(ServerBin))
moveall:
mv client client_test/client
mv p-client client_test/p-client
mv server server_test/server
mv p-server server_test/p-server