#-----------------------------------------------------------------------------
#		Makefile for tftp
#
#-----------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Where to find things (include files)
#------------------------------------------------------------------------------
ROOT	=/b/gregs		# where is the pvcs directory.

PIDIR	= ${ROOT}/i960/include	# where are the .h_v files
PSDIR	= ${ROOT}/i960/tcpip/tftp	# where are the .c_v files

.LOGFILE .c_v(.c)
.LOGFILE .s_v(.s)
.LOGFILE .h_v(.h)

IDIR	= ../../include
.PATH.h_v = ${PIDIR} 
.PATH.h   = ${IDIR} 
.PATH.c_v = ${PSDIR}

# Defaults to GNU/960 tool set:
#
CC	= gcc960
ARCH	= -ACA			# -ACA:	Generate CA instructions
OPT	= -O3 -c   		# -O3: 	optimize 
				# -c:	compile only
CFLAGS	= ${ARCH} -I${IDIR} ${OPT} -mstrict-align \
		#-DTFTP_SLIP #-DSTRESS_TEST #-DSLIP_REL
AS	= gas960
ASFLAGS	= ${ARCH}
LD	= gld960
LFLAGS	= ${ARCH} -o $(TARG) -r 
AR	= gar960
ARFLAGS = ruos

#
# Essential under System V, harmless elsewhere
SHELL = /bin/sh

GETOPTS	= -q

# Standard rules
#
.c_v.c:
	=get $(GETOPTS) $<\($@\)

.h_v.h:
	=get $(GETOPTS) $<\($@\)

.s_v.s:
	=get $(GETOPTS) $<\($@\)

.c.o:
	${CC} ${CFLAGS} $*.c

.s.o:
	${AS} ${ASFLAGS} -o $*.o $*.s


#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------

TARG	= ../../lib/libtcpip.a		# target output

TARG_OBJS=	tftpload.o tftp.o tftputil.o 


$(TARG): ${TARG_OBJS}
	 ${AR} $(ARFLAGS) ${TARG} ${TARG_OBJS}

#------------------------------------------------------------------------------
# SPECIAL CASES
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------
tftpload.o:	Makefile ${IDIR}/tftpboot.h ${IDIR}/tftp.h \
		${IDIR}/krnl.h ${IDIR}/task.h ${IDIR}/types.h \
		${IDIR}/netbuf.h ${IDIR}/dbd.h ${IDIR}/udp.h
tftputil.o:	Makefile ${IDIR}/tftpboot.h ${IDIR}/nim960h.h \
		${IDIR}/types.h \
		${IDIR}/netbuf.h ${IDIR}/dbd.h ${IDIR}/udp.h
tftp.o:		Makefile ${IDIR}/tftpboot.h ${IDIR}/tftp.h \
		${IDIR}/krnl.h ${IDIR}/task.h ${IDIR}/types.h \
		${IDIR}/netbuf.h ${IDIR}/dbd.h ${IDIR}/udp.h \
		${IDIR}/error.h ${IDIR}/tcpip.h ${IDIR}/lme.h
