# (c) Copyright 1993 by Panagiotis Tsirigotis
# All rights reserved.  The file named COPYRIGHT specifies the terms 
# and conditions for redistribution.

#
# Makefile.in,v 1.11 1995/08/24 18:12:29 duane Exp
#

#
# Available entries:
#     $(NAME)     --> create the program (this is the default target)
#     install     --> install the program
#     clean       --> cleanup
#

NAME              = pstext
VERSION           = 1.0.9

DEFS              =
LIBDIR            = ../libs/lib
LDFLAGS           = -L$(LIBDIR)
LIBS              = -lsio -lstr

OPT               = options.opt
OPT_HEADER        = options.h
OPT_SOURCE        = options.c
OPT_OBJECT        = options.o

SRCS              = dvi.c main.c common.c dit.c wp.c groff.c
HDRS              = defs.h
OBJS              = dvi.o main.o common.o dit.o wp.o groff.o

SOURCES           = $(SRCS) $(OPT_SOURCE)
HEADERS           = $(HDRS) $(OPT_HEADER)
OBJECTS           = $(OBJS) $(OPT_OBJECT)


INCLUDEDIR        = -I../libs/include
INSTALLDIR        = $(BINDIR)


#
# You may modify the following variables but you probably don't need to.
#

PROGRAM           = $(NAME)
MANSECTION        = 1
MANSUBSECTION     =                 # like V,X,l
MANFILE           = $(PROGRAM).man
MANPAGE           = $(PROGRAM).$(MANSECTION)$(MANSUBSECTION)

CC_FLAGS          = -DREMOVE_DVI_PLOTS

XMODE             = -m 755          # mode for executables
FMODE             = -m 644          # mode for anything but executables
INSTALL           = install  -c

LINT_FLAGS        = -hbux
PAGER             = less

CPP_DEFS          = $(VERSION_DEF) $(DEFS)

#
# The following variables do not need to be changed
#

VERSION_DEF       = -DVERSION=\"$(PROGRAM)_Version_$(VERSION)\"
CPP_FLAGS         = $(CPP_DEFS) $(INCLUDEDIR)
CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)

prefix = @prefix@
INSTALL_BINDIR	= $(prefix)/bin
INSTALL_LIBDIR	= $(prefix)/lib
INSTALL_MANDIR 	= $(prefix)/man

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

all:  pstext

pstext:  $(OBJECTS)
	$(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS)

install:	all
	$(INSTALL_BIN) pstext $(INSTALL_LIBDIR)/gatherer

clean:   
	-rm -f $(OBJECTS) $(PROGRAM) core
