#
# Copyright (c) 1992 MCNC, CONCERT Network
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and 
# its documentation for any purpose and without fee is hereby granted, 
# provided that the above copyright notice appears in all copies and 
# that both the copyright notice and this permission notice appear in 
# supporting documentation.  MCNC makes no representations about the 
# suitability of this software for any purpose. It is provided "as is" 
# without express or implied warranty.
#
#

CFLAGS=		-O
DBACCESSSRC=	dbaccess.c 
DBACCESS_TCLSRC=	dbaccess_tcl.c 
DBALARMSRC=	dbalarm.c
CVTTIMESRC=	cvt_time.c
SHLOCKSRC=	shlock.c
INCS=		-I/usr/postgres/src/lib/H -I/usr/postgres/src/lib/H/tmp
OBJS=		dbaccess.o dbaccess_tcl.o dbalarm.o
LIBS=		-lpq
MAN=
DESTDIR=	/usr/local/bin
DBDESTDIR=	/usr/postgres/bin
HELPDESTDIR=	/usr/postgres/data/CONCERT
TICKETGROUP=	ticket

all: dbaccess dbaccess_tcl dbalarm cvt_time shlock

dbaccess: ${DBACCESSSRC}
	${CC} -o $@ ${CFLAGS} ${INCS}  $@.c ${LIBS} 

dbaccess_tcl: ${DBACCESS_TCLSRC}
	${CC} -o $@ ${CFLAGS} ${INCS}  $@.c ${LIBS} 

dbalarm: ${DBALARMSRC}
	${CC} -o $@ ${CFLAGS} ${INCS}  $@.c ${LIBS} 

shlock: ${SHLOCKSRC}
	${CC} -o $@ ${CFLAGS} $@.c 

cvt_time: ${CVTTIMESRC}
	${CC} -o $@ ${CFLAGS} $@.c 

clean:
	rm -f ${OBJS} core dbaccess dbaccess_tcl dbalarm shlock cvt_time

install:
	install -s -o postgres -g ${TICKETGROUP} -m 755 dbaccess ${DBDESTDIR}/dbaccess
	install -s -o postgres -g ${TICKETGROUP} -m 755 dbaccess_tcl ${DBDESTDIR}/dbaccess_tcl
	install -s -o postgres -g ${TICKETGROUP} -m 755 dbalarm ${DBDESTDIR}/dbalarm
	install -s -o postgres -g ${TICKETGROUP} -m 755 shlock ${DBDESTDIR}/shlock
	install -s -o postgres -g ${TICKETGROUP} -m 755 cvt_time ${DBDESTDIR}/cvt_time
	install  -o bin -g ${TICKETGROUP} -m 755 tt ${DESTDIR}/tt
	install  -o bin -g ${TICKETGROUP} -m 755 ttalarm ${DESTDIR}/ttalarm
	install  -o bin -g ${TICKETGROUP} -m 755 xticket ${DESTDIR}/xticket
	install  -o postgres -g ${TICKETGROUP} -m 644 ../xticket.helpfile \
			${HELPDESTDIR}/xticket.helpfile
