#-----------------------------------------------------------------------------
# Copyright (c) 1990, 1992 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#	ud makefile
#
#	Use -DUOFM for University of Michigan specifics like:
#		if ud should know about noBatchUpdates
#	Use -DDOS if building for a DOS machine
#	Use -DNOTERMCAP if there is no termcap library
#		also need to redefine/undefine the Makefile TERMLIB variable
#-----------------------------------------------------------------------------
SRCS=	main.c find.c mod.c print.c auth.c util.c help.c
OBJS=	main.o find.o mod.o print.o auth.o util.o help.o
HDRS=	ud.h
INCLUDES= -I../include
DEFINES= -DUOFM
TERMLIB= -ltermcap
CFLAGS= -g ${INCLUDES} ${DEFINES} $(ADDCFLAGS)
LDFLAGS= -L../lib -ldixie ${TERMLIB}
BINDIR= /usr/local/bin

all: ud

ud : ${OBJS} version.c
	${CC} -g -o $@ version.c ${OBJS} ${LDFLAGS}

version.c: Version.c
	(u=$${USER-root} d=`pwd` h=`hostname` t=`date`; \
	sed -e "s|%WHEN%|$${t}|" \
	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	    < Version.c > version.c)
	chmod 666 version.c

update: FRC
	rcp ud e:/usr/local/bin/ud

install: ${BINDIR}/ud

${BINDIR}/ud : ud
	install -s ud ${BINDIR}

depend: FRC
	../mkdep ${CFLAGS} ${SRCS}

clean: FRC
	rm -f ${OBJS} core ud tags version.o version.c

tags: FRC
	ctags ${SRCS} ${HDRS}

lint: FRC
	/usr/bin/lint -Dlint ${INCLUDES} ${DEFINES} ${SRCS} version.c

FRC:
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
