#
#  Makefile for mp, the PostScript pretty printer.
#
#  @(#)Makefile 1.2 88/12/28
#
#  Original written in the Icon language by Steve Holden.
#
#  Converted to C, modified and maintained
#  by Rich Burridge - Sun Microsystems Australia.
#
#  Further modifications to handle news articles and MH mail,
#  by Bruno Pillard  - Chorus Systemes, St Quentin en Yvelines, France
#
#  Addition of digest printing by Dave Glowacki of Public
#  Works Computer Services, St Paul, MN.
#
#  Ordinary text file pretty printing by Rich Burridge.
#
#  Copyright (c) Steve Holden and Rich Burridge.
#                All rights reserved.
#
#  Permission is given to distribute these sources, as long as the
#  copyright messages are not removed, and no monies are exchanged.
#
#  No responsibility is taken for any errors inherent either
#  to the comments or the code of this program, but if reported
#  to me then an attempt will be made to fix them.
#
#------------------------------------------------------------------
#  It is possible to change the location of the mp prologue file
#  with the -p command line option. It can also be defined at compile
#  time. If it's not present, then a sensible default value is used.
#
#
#  Prologue file used with mp.
#
PROLOGUE = -DPROLOGUE=\"$(LIBDIR)/mp.pro.ps\"
#---------------------------------------------------------------------

BINARIES = mp
BINDIR   = /usr/local/bin
LIBDIR   = /usr/local/lib
MANDIR   = /usr/man/man$(MANSECT)
MANSECT  = l
CFLAGS   = -g $(PROLOGUE)
OBJS     = mp.o
SRCS     = mp.c
OTHERS   = README Makefile mailp mp.pro.ps mp.1

all:       $(BINARIES)

mp:        $(OBJS)
	   cc $(CFLAGS) -o mp $(OBJS)

install:   $(BINARIES)
	   install -s -m 751 mp $(BINDIR)
	   install -c -m 644 mp.1 $(MANDIR)/mp.$(MANSECT)
	   install -c -m 644 mp.pro.ps $(LIBDIR)

backup:;   cp $(SRCS) $(OTHERS) backdir

clean:;    rm -rf mp *.o core

create:    SCCS
	   -sccs create $(SRCS) $(OTHERS)

lint:;     lint $(SRCS)

shar:;     shar.script $(OTHERS) $(SRCS) > archive

SCCS:
	   mkdir SCCS
	   chmod 755 SCCS

mp.o:      mp.c
