# Generated automatically from Makefile.in by configure.
#
# Makefile for ./src path, used by configure
#

PROGRAM = gocr
PGMASCLIB = Pgm2asc
LIBPGMASCLIB = lib$(PGMASCLIB).a
INCLUDEFILES = gocr.h

LIBOBJS=pgm2asc.o \
	box.o \
	database.o \
	detect.o \
	lines.o \
	list.o \
	ocr0.o \
	ocr0n.o \
	ocr1.o \
	otsu.o \
	output.o \
	pixel.o \
	unicode.o \
	remove.o \
	pnm.o \
	pcx.o

# these two lines are for cross-compiling, not tested
#srcdir = .
#VPATH = .
bindir = /usr/local${exec_prefix}/bin
libdir = /usr/local${exec_prefix}/lib
includedir = /usr/local${prefix}/include

CC=gcc
RANLIB=ranlib
INSTALL=/usr/bin/install -c

DEFS=-DHAVE_CONFIG_H
CPPFLAGS=-I/usr/X11R6/include
# to see the config.h
CFLAGS=-g -O2 $(CPPFLAGS) -I../include $(DEFS)
LDFLAGS=-L/usr/X11R6/lib -L/usr/local/netpbm/lib -lpnm  -L.

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $<

default: all

all: $(PROGRAM) $(LIBPGMASCLIB)

$(PROGRAM): $(LIBPGMASCLIB) gocr.o
	$(CC) -o $@ gocr.o $(LDFLAGS) -l$(PGMASCLIB)
	if test -r $(PROGRAM); then cp $@ ../bin; fi


$(LIBPGMASCLIB): $(LIBOBJS)
	-rm -f $@
	$(AR) cru $@ $(LIBOBJS)
	$(RANLIB) $@

# PHONY = don't look at file clean, -rm = start rm and ignore errors
.PHONY : clean proper install
install: all
	$(INSTALL) ../bin/$(PROGRAM) $(bindir)
	$(INSTALL) $(LIBPGMASCLIB) $(libdir)
	$(INSTALL) $(INCLUDEFILES) $(includedir)
clean:
	-rm -f *.o *~

proper: clean
	-rm -f gocr libPgm2asc.a
	
