#
# Package	: TRS
# Module	: (Makefile)
# Programmer	: R. Stolfa
# SCCS id	: @(#) Makefile 1.2 89/12/19
#
# Purpose :	To maintain a Trouble Report System for an
#		university environment
#
# Modification History:
#   04/11/88	Created
#   10/25/88	Updated for distribution outside of OSU
#
#   10/16/89	Rewrote for release 2
#
ROOT =		/u/rjs/lib/Trs
BIN =		/u/rjs/bin
CFLAGS =	-O -DSYS5		# For System 5 Un*x
#CFLAGS =	-O -DULTRIX		# For VAX Ultr*x
MANDIR =	/u/rjs/lib/man/l_man/man1
MANPAGES =	followup.1 opentr.1 report.1 rmthread.1 trouble.1 P.1 V.1

DuMb:
	@echo Make what?

followup:	$(BIN)/followup
$(BIN)/followup:	followup.sh
	cp followup.sh $(BIN)/followup
	chmod 755 $(BIN)/followup

opentr:	$(BIN)/opentr
$(BIN)/opentr:	opentr.sh
	cp opentr.sh $(BIN)/opentr
	chmod 755 $(BIN)/opentr

print:	$(BIN)/print
$(BIN)/print:	print.c
	cc print.c -o $(BIN)/print
	chmod 755 $(BIN)/print

report:	$(BIN)/report
$(BIN)/report:	report.sh
	cp report.sh $(BIN)/report
	chmod 755 $(BIN)/report

rmthread:	$(BIN)/rmthread
$(BIN)/rmthread:	rmthread.sh
	cp rmthread.sh $(BIN)/rmthread
	chmod 755 $(BIN)/rmthread

soundex:	$(BIN)/soundex
$(BIN)/soundex:	soundex.c
	cc soundex.c -o $(BIN)/soundex
	chmod 755 $(BIN)/soundex

trouble:	$(BIN)/trouble
$(BIN)/trouble:	trouble.sh
	cp trouble.sh $(BIN)/trouble
	chmod 755 $(BIN)/trouble

P:	$(BIN)/P
$(BIN)/P:	P.c lockp.c
	cc P.c lockp.c -o $(BIN)/P
	chmod 755 $(BIN)/P

V:	$(BIN)/V
$(BIN)/V:	V.c lockp.c
	cc V.c lockp.c -o $(BIN)/V
	chmod 755 $(BIN)/V

#
# Housekeeping
#

all:	followup opentr print report rmthread soundex trouble P V
	@echo "Don't forget 'make install' to setup sequence file"

backout:	clean
	rm -rf $(ROOT)
	rm -if $(BIN)/followup $(BIN)/opentr $(BIN)/report $(BIN)/rmthread \
		$(BIN)/trouble $(BIN)/print $(BIN)/soundex $(BIN)/P $(BIN)/V
	cd $(MANDIR) ; rm -f $(MANPAGES)

clean:
	rm -f *.o a.out core

install:
	-mkdir $(ROOT) $(ROOT)/Entry $(ROOT)/Xref
	chmod 777 $(ROOT) $(ROOT)/Entry $(ROOT)/Xref
	echo "0" > $(ROOT)/sequence
	cp $(MANPAGES) $(MANDIR)

rub:
	rm -f $(ROOT)/Entry/* $(ROOT)/Xref/*
	echo "0" > $(ROOT)/sequence

shar:
	shar README Localize Makefile [PVa-z]* > Trs.shar
