#-----------------------------------------------------------------------------
#		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/mib2	# 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 -g 		# -O3: 	optimize 
				# -c:	compile only
				# -g:	debug purpose
CFLAGS	= ${ARCH} -I${IDIR} ${OPT} -mstrict-align
AS	= gas960
ASFLAGS	= ${ARCH}
LD	= gld960
LFLAGS	= ${ARCH} -o $(TARG) -r 

#
# 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	= mib2.o		# target output

TARG_OBJS= attable.o iptable.o iftable.o systable.o snmptable.o \
		tcptable.o udptable.o icmptabl.o

$(TARG): ${TARG_OBJS}
	${LD} $(LFLAGS) ${TARG_OBJS}
	cp $(TARG) ../../lib

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


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------
attable.o:	Makefile ${IDIR}/types.h ${IDIR}/netbuf.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h ${IDIR}/ip.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/arp.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/dbd.h
iptable.o: 	Makefile ${IDIR}/types.h ${IDIR}/netbuf.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h ${IDIR}/ip.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/arp.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/krnl.h ${IDIR}/dbd.h \
		${IDIR}/frag.h 
iftable.o: 	Makefile ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h  \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/krnl.h
systable.o: 	Makefile ${IDIR}/types.h ${IDIR}/krnl.h  \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/localio.h \
		${IDIR}/buffer.h
snmptable.o: 	Makefile ${IDIR}/types.h ${IDIR}/netbuf.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/arp.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/dbd.h ${IDIR}/krnl.h
tcptable.o: 	Makefile ${IDIR}/types.h ${IDIR}/netbuf.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h ${IDIR}/ip.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/dbd.h ${IDIR}/mtcp.h \
		${IDIR}/mtcpblk.h ${IDIR}/krnl.h
udptable.o:	Makefile ${IDIR}/types.h ${IDIR}/netbuf.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h ${IDIR}/ip.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/dbd.h ${IDIR}/udp.h \
		${IDIR}/sockets.h
icmptabl.o:	Makefile ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h ${IDIR}/ip.h \
		${IDIR}/asn1.h ${IDIR}/snmp.h ${IDIR}/mib.h \
		${IDIR}/syteksnm.h ${IDIR}/localio.h \
		${IDIR}/buffer.h ${IDIR}/krnl.h ${IDIR}/icmp.h

