bcssocket/Makefile

40 lines
1.2 KiB
Makefile

CC = gcc
CCFLAGS = -Wall -std=c99 -pedantic -g
CLIENT=client
SERVER=server
ERRORS=errors.o
CHALLENGES=challenges.o
RANDOM=random.o
SOCKETS=sockets.o
TMP := $(shell mktemp)
all: $(ERRORS) $(CHALLENGES) $(RANDOM) $(SOCKETS) $(CLIENT) $(SERVER)
$(SERVER): src/server.c src/challenges.c src/errors.c src/sockets.c include/errors.h include/challenges.h include/server.h include/challengesLib.h include/sockets.h
$(CC) $(CCFLAGS) src/server.c -o server $(CHALLENGES) $(ERRORS) $(RANDOM) $(SOCKETS) -lm
objcopy --add-section .RUN_ME="$(TMP)" --set-section-flags .mydata=noload,readonly server
strip --strip-debug server
rm "$(TMP)"
$(CLIENT): src/client.c src/errors.c src/sockets.c include/errors.h include/client.h include/sockets.h
$(CC) $(CCFLAGS) src/client.c -o client $(ERRORS) $(SOCKETS)
%.o: src/%.c
$(CC) $(CCFLAGS) -I./include -c $<
clean:
rm -f $(ERRORS) $(CHALLENGES) $(CLIENT) $(SERVER) $(RANDOM) $(SOCKETS)
test:
pvs-studio-analyzer trace -- make
pvs-studio-analyzer analyze
plog-converter -a '64:1,2,3;GA:1,2,3;OP:1,2,3' -t tasklist -o report.tasks PVS-Studio.log
cppcheck --quiet --enable=all --force --inconclusive .
cleanTest:
rm -rf PVS-Studio.log report.tasks strace_out
.PHONY: all clean test cleanTest