#
#  Makefile for wp2x as a component to the Harvest Gatherer
#
#  $Id: Makefile.in,v 1.10 1995/08/21 21:27:12 duane Exp $
#
prefix = @prefix@
INSTALL_BINDIR  = $(prefix)/bin
INSTALL_LIBDIR  = $(prefix)/lib
INSTALL_UTILDIR = $(prefix)/lib/gatherer
INSTALL_MANDIR  = $(prefix)/man

CC              = @CC@
INSTALL         = @INSTALL@
INSTALL_BIN     = @INSTALL_PROGRAM@
INSTALL_FILE    = @INSTALL_DATA@

DEBUG           = $(DEBUG_TOP) #-O #-g #-DDEBUG
DEBUG_LIBS      =

WP2X_DIR	= $(INSTALL_UTILDIR)/wp2x-lib
CFGDIR		= cfgs
SRCS		= wp2x.c dopen.c tokens.c charsets.c getopt.c

# Include getopt.o if you don't have getopt(3)
#OBJS=wp2x.o dopen.o tokens.o charsets.o getopt.o
OBJS		= wp2x.o dopen.o tokens.o charsets.o

VERSION		= 2.3
CFLAGS 		= -g -O -ansi -funsigned-char -DUNIX -DVERSION=\"$(VERSION)\"

all:	wp2x wp2x.sh WordPerfect.sum

wp2x:	$(OBJS)
	$(CC) $(CFLAGS) -o wp2x $(OBJS)

install:	all
	@if test ! -d $(WP2X_DIR); then \
		mkdir $(WP2X_DIR); \
	fi
	$(INSTALL_BIN) wp2x $(INSTALL_UTILDIR)
	$(INSTALL_BIN) wp2x.sh $(INSTALL_UTILDIR)
	$(INSTALL_BIN) WordPerfect.sum $(INSTALL_UTILDIR)
	(cd $(CFGDIR); make install)

clean:
	-rm -f a.out core $(OBJS) wp2x

realclean:	clean
	-rm -f Makefile
