bcssocket/Makefile

37 lines
1.1 KiB
Makefile

CC = gcc
CCFLAGS = -Wall -std=c99 -pedantic -g
SERVER_SOURCES=src/server.c src/errors.c src/challenges.c src/math.c src/sockets.c
CLIENT_SOURCES=src/client.c src/errors.c src/sockets.c
SERVER_LIBS=include/errors.h include/challenges.h include/server.h include/challengesLib.h include/sockets.h include/math.h
CLIENT_LIBS=include/errors.h include/client.h include/sockets.h
SERVER_OBJ=server
CLIENT_OBJ=client
TMP := $(shell mktemp)
all: $(CLIENT_OBJ) $(SERVER_OBJ)
$(SERVER_OBJ): $(SERVER_SOURCES) $(SERVER_LIBS)
$(CC) $(CCFLAGS) -o $(SERVER_OBJ) $(SERVER_SOURCES) -lm
objcopy --add-section .RUN_ME="$(TMP)" --set-section-flags .mydata=noload,readonly $(SERVER_OBJ)
strip --strip-debug $(SERVER_OBJ)
rm "$(TMP)"
$(CLIENT_OBJ): $(CLIENT_SOURCES) $(CLIENT_LIBS)
$(CC) $(CCFLAGS) -o $(CLIENT_OBJ) $(CLIENT_SOURCES)
clean:
rm -f $(CLIENT_OBJ) $(SERVER_OBJ)
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 -f PVS-Studio.log report.tasks strace_out
.PHONY: all clean test cleanTest