#
# Copyright (c) 1987 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, Berkeley.  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'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	@(#)Makefile	2.7 (Berkeley) 6/18/88
#
# optional flags are: MEASURE TESTING DEBUG MNOADJUST GETTIME
#	MNOADJUST prevents the master timed from changing it's own time
#	GETTIME assumes that the time is reasonably close on startup of
#		timed and an ADJTIME is sent instead of SETTIME
CFLAGS=	-O -DMNOADJUST 
LIBC=	/lib/libc.a
SRCDS=	acksend.c candidate.c correct.c master.c networkdelta.c readmsg.c \
	slave.c timed.c
OBJDS=	acksend.o candidate.o correct.o master.o networkdelta.o readmsg.o \
	slave.o timed.o
SRCCS=	cmds.c cmdtab.c timedc.c
OBJCS=	cmds.o cmdtab.o timedc.o
COMMS=	byteorder.c measure.c cksum.c ${MACHCOMMS}
COMMO=	byteorder.o measure.o cksum.o ${MACHCOMMO}

#if defined(mips) && defined(ultrix)
MACHCOMMS=in_checksum.s
MACHCOMMO=in_checksum.o
#endif

MAN8=	timed.8 timedc.8

all:: timed timedc

timed::	${OBJDS} ${COMMO} ${LIBC}
	${CC} ${CFLAGS} ${OBJDS} ${COMMO} ${LIBS} -o $@

timedc:: ${OBJCS} ${COMMO} ${LIBC}
	${CC} ${CFLAGS} ${OBJCS} ${COMMO} ${LIBS} -o $@

clean:: FRC
	rm -f ${OBJDS} ${OBJCS} ${COMMO} core timed timedc

depend:: FRC
	touch Make.depend; /usr/athena/makedepend -fMake.depend ${CFLAGS} ${SRCDS} ${SRCCS} ${COMMS}

install:: FRC
	install -c -s timed ${DESTDIR}/etc/timed
	install -c -s -o root -m 4755 timedc ${DESTDIR}/etc/timedc
	-for i in $(MAN8); do \
		install -c -m 0444 $$i $(DESTDIR)/usr/man/man8/$$i; done

lint:: FRC
	lint ${CFLAGS} ${SRCDS} ${COMMS}
	lint ${CFLAGS} ${SRCCS} ${COMMS}

tags:: FRC
	ctags ${SRCDS} ${SRCCS} ${COMMS}

FRC::

