#
# 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 
LINTFLAGS=-hbpvxac
LIBC=	/lib/libc.a
SRCDS=	acksend.c correct.c networkdelta.c readmsg.c master.c \
	slave.c timed.c
OBJDS=	acksend.o correct.o networkdelta.o readmsg.o master.o \
	slave.o timed.o
SRCCS=	cmds.c cmdtab.c timedc.c measure.c cksum.c
OBJCS=	cmds.o cmdtab.o timedc.o measure.o cksum.o
COMMS=	byteorder.c ${MACHCOMMS}
COMMO=	byteorder.o ${MACHCOMMO}
MAKEDEPEND=/usr/athena/makedepend

#
# Uncomment the next two lines if you're running on a DECstation 3100 running
# ultrix.
#MACHCOMMS=in_checksum.s
#MACHCOMMO=in_checksum.o

#
# Uncomment the next two lines if you're running a 68000 based machine.
# i.e., Sun 3, etc.
#MACHCOMMS=ocsum.s
#MACHCOMMO=ocsum.o

MAN8=	timed.8 timedc.8

all:: timed

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; $(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} $(LINTFLAGS) ${SRCDS} ${COMMS}
	lint ${CFLAGS} $(LINTFLAGS) ${SRCCS} ${COMMS}

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

FRC::

