#-----------------------------------------------------------------------------
#		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/snmp	# 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
				# -g:	debug purpose
CFLAGS	= ${ARCH} -I${IDIR} ${DSWITCH} ${OPT} -mstrict-align
AS	= gas960
ASFLAGS	= ${ARCH}
LD	= gld960
DSWITCH = 
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	= snmp.o		# target output

TARG_OBJS= setpdu.o mibutils.o rcv_pkt.o snmp_e.o \
	snmp_d.o encode.o decode.o getpdu.o localio.o objectid.o \
	buffer.o proc_snm.o 

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

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


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------

setpdu.o:	Makefile ${IDIR}/types.h ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/mib.h ${IDIR}/syteksnm.h
mibutils.o:	Makefile ${IDIR}/types.h ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/mib.h ${IDIR}/syteksnm.h \
		${IDIR}/objectid.h
rcv_pkt.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/syteksnm.h
snmp_e.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/encode.h ${IDIR}/snmp.h \
		${IDIR}/syteksnm.h
snmp_d.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/syteksnm.h
encode.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/encode.h ${IDIR}/snmp.h \
		${IDIR}/syteksnm.h
decode.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/syteksnm.h
getpdu.o:	Makefile ${IDIR}/types.h ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/mib.h ${IDIR}/syteksnm.h \
		${IDIR}/objectid.h
localio.o:	Makefile ${IDIR}/libfuncs.h ${IDIR}/localio.h 
objectid.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/snmp.h ${IDIR}/objectid.h ${IDIR}/syteksnm.h
buffer.o:	Makefile ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h
proc_snm.o:	Makefile ${IDIR}/types.h ${IDIR}/libfuncs.h \
		${IDIR}/asn1.h ${IDIR}/localio.h ${IDIR}/buffer.h \
		${IDIR}/decode.h ${IDIR}/snmp.h \
		${IDIR}/mib.h ${IDIR}/syteksnm.h \
		${IDIR}/krnl.h ${IDIR}/dbd.h ${IDIR}/tcpip.h  \
		${IDIR}/lme.h ${IDIR}/buildpkt.h ${IDIR}/telnet.h

