# Copyright (c) 1988, The Regents of the University of California.
# Edward Moy, Workstation Software Support Group, Workstation Support Serices,
# Information Systems and Technology.
#
# Permission is granted to any individual or institution to use, copy,
# or redistribute this software so long as it is not sold for profit,
# provided that this notice and the original copyright notices are
# retained.  The University of California makes no representations about the
# suitability of this software for any purpose.  It is provided "as is"
# without express or implied warranty.
#
# SCCSid = "@(#)Makefile	2.2 10/24/89"
# RCSid = "$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/src/macps/RCS/Makefile,v 1.2 90/03/11 17:55:26 jik Exp $"
#
# For System V, include -DSYSV in CFLAGS below.
# To specify a fixed path for macps.config, include -DCONFIGDIR=\"path\"
# in CFLAGS below (path is the full pathname of the directory).
# To do save/restore context, include -DSAVE in CFLAGS below.
#
DESTDIR=
BINDIR= 	/usr/sipb/$(MACHINE)bin
MANSECT= 	1
MANDIR= 	/usr/sipb/man/man$(MANSECT)
INSTALL= 	install
CP= 		cp
CONFIG= 	/usr/sipb/lib/macps
CFLAGS= 	-O -DCONFIGDIR=\"$(CONFIG)\"
MACPS= 		macps.o macaux.o ucbwhich.o
PREPFIX= 	prepfix.o macaux.o
PREPFILES= 	LaserPrep5.1 LaserPrep5.2 LaserPrep6.0

all : macps prepfix

install: all
	$(INSTALL) -c -s macps $(DESTDIR)$(BINDIR)/macps
	$(INSTALL) -c -s prepfix $(DESTDIR)$(BINDIR)/prepfix
	$(CP) macps.1 $(DESTDIR)$(MANDIR)/macps.$(MANSECT)
	$(CP) prepfix.1 $(DESTDIR)$(MANDIR)/prepfix.$(MANSECT)
	-if [ ! -d ${DESTDIR}${CONFIG} ]; then \
		rm -f ${DESTDIR}${CONFIG}; \
		mkdir ${DESTDIR}${CONFIG}; fi
	$(CP) macps.config $(DESTDIR)$(CONFIG)/macps.config
	$(CP) $(PREPFILES) $(DESTDIR)$(CONFIG)

macps : $(MACPS)
	cc -o macps $(CFLAGS) $(MACPS)

prepfix : $(PREPFIX)
	cc -o prepfix $(CFLAGS) $(PREPFIX)

clean :
	/bin/rm -f *.o macps prepfix
