# Makefile for testing communication # 3/9/17 by Huan Chen # if HOST and PORT are not provided when typing "make", use laguna.eecs.uci.edu:2001 by default # to specify host and port, type: make c HOST=bondi PORT=2002 # to avoid conflicts, replace port number with 2000 + your team number # i.e team 16 can use port 2016 HOST = laguna PORT = 2001 LOG = test.log # output log CC = gcc CFLAGS = -Wall -g -DDEBUG all: t server r # start server s: ./server $(PORT) # Your server module should pass all tests, no core dump # start the testing client and save output to log file c: ./t $(HOST) $(PORT) | tee $(LOG) # start client without saving logs c2: ./t $(HOST) $(PORT) # check memory leaks v: valgrind --leak-check=full ./t $(HOST) $(PORT) >/dev/null %: %.c $(CC) $(CFLAGS) $< -o $@ t: comm_test.c $(CC) $(CFLAGS) $< -o $@ -lpthread tar: tar czf test_comm.tar.gz server.c comm_test.c re.c Makefile untar: mkdir -p test_comm; tar xzf test_comm.tar.gz -C test_comm # regular expression test r: re.c $(CC) $(CFLAGS) $< -o $@ clean: rm -rf t r server $(LOG)