CC=gcc
CPPFLAGS= -MMD `pkg-config --cflags gtk+-3.0`
CFLAGS= -Wall -Wextra -std=c99 -g -D_XOPEN_SOURCE=600
LDLIBS= `pkg-config --libs gtk+-3.0` -lSDL2 -lm -rdynamic -Isrc
EXEC= OCR

SRC= src/ocr.c \
	 src/image_treatment/segmentation/segmentation.c \
	 src/image_treatment/filter/cleanerimage.c \
	 src/image_treatment/tools/tools.c \
	 src/image_treatment/display.c \
	 src/image_treatment/extraction/extraction.c \
	 src/image_treatment/extraction/extractchar.c \
	 src/neural_network/structure.c \
	 src/neural_network/training.c \
	 src/neural_network/toolsnetworks.c \
	 src/neural_network/traitement.c \
	 src/neural_network/load.c \
	 src/tools/arg_parse.c \


all: $(EXEC)

test_train:
	./OCR --train --save-weight=test_train.txt

test_rec: OCR
	./OCR --input-file misc/test_images/test_image.bmp --load-weight misc/nnweight/nnweight.txt

OCR: $(SRC)
	$(CC) $(SRC) -o OCR $(CFLAGS) $(CPPFLAGS) $(LDLIBS)	

clean:
	rm -rf *.o *.d OCR


	
