-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
42 lines (33 loc) · 809 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
CC = gcc
CFLAGS = -Wall -Wextra -Werror -std=c99 -pedantic -O3 \
$(shell pkg-config --cflags gtk+-3.0) \
$(shell pkg-config --cflags sdl2)
LDFLAGS =
LDLIBS = -lm $(shell pkg-config --libs gtk+-3.0) \
$(shell pkg-config --libs sdl2) -lSDL2_image
VALGRIND = valgrind
SRC = $(shell find src -name '*.c')
OBJ = ${SRC:.c=.o}
DEP = ${SRC:.c=.d}
all: ocr
mkdir -p output
mkdir -p output/image_chars
ocr: ${OBJ}
@echo "Linking ocr binary..."
@$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
%.o: %.c
@echo "Building $@..."
@$(CC) -MMD -o $@ -c $< $(CFLAGS)
-include ${DEP}
.PHONY: clean check-valgrind
clean:
${RM} ${OBJ}
${RM} ${DEP}
${RM} ocr
check-valgrind: ocr
${VALGRIND} \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--suppressions=.glib.suppression \
./ocr --test xor