all: genfont chocr-IPA chocr-ALGOL_W chocr-hershey chocr-pop2 chocr-flexowriter chocr exemplar Makefile

# There is an optional THRESH= parameter when compiling genfont -
# values can be 0 to 254. Experimental and would need per-scan tweaking.
# Leave unset for now.  A grey pixel of any value will be considered a
# pixel to use in the (currently) bi-level B/W master font.
genfont: genfont.c
	cc -o genfont -g genfont.c
	# cc -o genfont -DTHRESH=224 genfont.c


chocr: chocr.c nchar.h
	cc -Ofast -o chocr chocr.c

chocr-flexowriter: chocr.c ../testdata/flexowriter/nchar.h
	cc -Ofast -o chocr-flexowriter -DCHARSET="\"../testdata/flexowriter/nchar.h\"" chocr.c

chocr-pop2: chocr.c ../testdata/pop2/nchar.h
	cc -Ofast -o chocr-pop2 -DCHARSET="\"../testdata/pop2/nchar.h\"" chocr.c

chocr-IPA: chocr.c ../testdata/IPA/nchar.h
	cc -Ofast -o chocr-IPA -DCHARSET="\"../testdata/IPA/nchar.h\"" chocr.c

chocr-hershey: chocr.c ../testdata/hershey/nchar.h
	cc -Ofast -o chocr-hershey -DCHARSET="\"../testdata/hershey/nchar.h\"" chocr.c

chocr-ALGOL_W: chocr.c ../testdata/ALGOL-W/nchar.h
	cc -Ofast -o chocr-ALGOL_W -DCHARSET="\"../testdata/ALGOL-W/nchar.h\"" chocr.c

exemplar: exemplar.c nchar.h
	cc -DTHRESH=120 -Ofast -o exemplar exemplar.c

nchar.h: genfont
	# # Don't want to overwrite current hand-tweaked nchar.h, so update below is disabled:
	#./genfont > nchar.h

clean:
	rm *~ genfont chocr chocr-IPA chocr-ALGOL_W chocr-hershey chocr-pop2 chocr-flexowriter exemplar # nchar.h

upload:
	pushd ../segmenter; make upload; popd
