#-----------------------------------------------------------------------------
#		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/ip	# where are the .c_v files

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

IDIR	= ../../include
.PATH.h_v = ${PSDIR} ;${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
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.s:
	${CC} ${CFLAGS} -S $*.c

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

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


#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
TARG	= ../../lib/libtcpip.a		# target output

TARG_OBJS= icmp.o indemux.o in_init.o in_alloc.o in_write.o infrag.o \
	inroute.o in_open.o #####in_slip.o


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

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


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------
icmp.o	:	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/icmp.h ${IDIR}/udp.h ${IDIR}/mtcp.h \
		${IDIR}/ip.h ${IDIR}/lme.h ${IDIR}/error.h \
		${IDIR}/task.h redirtab.h internal.h
indemux.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/icmp.h ${IDIR}/ip.h ${IDIR}/lme.h  \
		ipconn.h internal.h
in_init.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/ip.h ${IDIR}/lme.h  \
		${IDIR}/netbuf.h internal.h
in_alloc.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/ip.h ${IDIR}/lme.h internal.h
in_write.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/ip.h ${IDIR}/lme.h ${IDIR}/error.h \
		ipconn.h internal.h
infrag.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/icmp.h ${IDIR}/udp.h ${IDIR}/mtcp.h \
		${IDIR}/ip.h ${IDIR}/lme.h ${IDIR}/error.h \
		${IDIR}/frag.h redirtab.h internal.h
inroute.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/icmp.h ${IDIR}/ip.h ${IDIR}/lme.h  \
		ipconn.h ${IDIR}/frag.h internal.h
in_open.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/netbuf.h ${IDIR}/ip.h ${IDIR}/lme.h  \
		ipconn.h internal.h
in_slip.o :	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/netbuf.h ${IDIR}/ether.h  \
		${IDIR}/icmp.h ${IDIR}/udp.h ${IDIR}/mtcp.h \
		${IDIR}//ip.h ${IDIR}/lme.h ${IDIR}/error.h

