summaryrefslogtreecommitdiff
path: root/Makefile
blob: c06d92d494654d17ce8dca5a8e56ff64ecd2847c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
LIBRARIES = `pkg-config --libs zlib libsodium` -Iinclude
SOURCES = ./src/* ./cmd/pspng.c
OUTPUT_DIR = ./bin
OUTPUT = -o ${OUTPUT_DIR}/PROG
INSTALL_OUTPUT = ${OUTPUT_DIR}/PROG

build: output_dir
	gcc -Wall -pthread ${LIBRARIES} ${SOURCES} ${OUTPUT:PROG=pspng}

debug: output_dir
	gcc -Wall -g -pthread ${LIBRARIES} ${SOURCES} ${OUTPUT:PROG=pspng}

install:
	mv ${INSTALL_OUTPUT:PROG=pspng} /usr/bin/

output_dir:
	mkdir -p ${OUTPUT_DIR}

clean:
	rm -rf $(OUTPUT_DIR) **.h.gch

memcheck: debug
	valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes -s ${OUTPUT_DIR}/pspng