projet-multitaches/Makefile

32 lines
946 B
Makefile
Raw Normal View History

2022-11-05 12:43:50 +01:00
all: client server rapport cdb
2022-09-13 15:43:49 +02:00
2022-10-24 22:47:10 +02:00
client: src/client.c src/client.h src/common.c src/common.h
@if command -v clang >/dev/null 2>&1; then \
clang -MJ client.o.json -o client src/client.c src/common.c -pthread; \
else \
cc -o client src/client.c src/common.c -pthread; \
fi
2022-09-13 15:43:49 +02:00
2022-10-24 22:47:10 +02:00
server: src/server.c src/server.h src/common.c src/common.h
@if command -v clang >/dev/null 2>&1; then \
clang -MJ server.o.json -o server src/server.c src/common.c -lpthread; \
else \
cc -o server src/server.c src/common.c -lpthread; \
fi
2022-09-13 15:43:49 +02:00
2022-11-05 12:43:50 +01:00
cdb: client server
@if command -v clang >/dev/null 2>&1; then \
sed -e '1s/^/[\'$$'\n''/' -e '$$s/,$$/\'$$'\n'']/' *.o.json > compile_commands.json; \
fi
2022-11-05 12:43:50 +01:00
rapport: rapport.tex rapport.sty
@latexmk -pdf rapport.tex
@if ! cmp --silent build/rapport.pdf rapport.pdf; then \
cp build/rapport.pdf rapport.pdf; \
echo "Updated"; \
fi
2022-09-13 15:43:49 +02:00
clean:
2022-11-05 12:43:50 +01:00
@rm -rf server client *.o.json compile_commands.json build 2>/dev/null