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

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

IDIR	= ../../include
IDIR1	= ../../../bridge/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} -I${IDIR1} -I/b/gregs/fddi/i960/include -I/b/gregs/fddi/fddicon/include ${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= nim_init.o nim_xmt.o nim_rcv.o mpdstub.o



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

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


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------
nim_init.o:	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/netbuf.h ${IDIR}/ether.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h
nim_xmt.o:	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/netbuf.h ${IDIR}/ether.h ${IDIR}/error.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h
nim_rcv.o:	Makefile ${IDIR}/krnl.h ${IDIR}/types.h ${IDIR}/dbd.h \
		${IDIR}/netbuf.h ${IDIR}/ether.h \
		${IDIR}/tcpip.h ${IDIR}/lme.h
mpdstub.o:	Makefile ${IDIR}/types.h ${IDIR}/krnl.h \
		${IDIR}/dbd.h

fddi_xmt.o:	Makefile ${IDIR}/krnl.h ${IDIR}/types.h \
		${IDIR}/ether.h ${IDIR}/error.h ${IDIR}/tcpip.h ${IDIR}/lme.h \
		/b/gregs/fddi/i960/include/dbd.h
