#
# makefile for rs485.device
#

INCLUDE	= -isana2:include
CFLAGS  = -rr -v $(INCLUDE) -O -ml -Hram:syms
OBJS 	= libent.o libinit.o global.o dispatch.o devicequery.o type.o stat.o  	\
	  event.o stub.o rdwr.o offline.o task.o config.o board.o getstation.o	\
	  interrupts.o devinit.o startxmit.o recv.o getlibbase.o

#	  interrupts.o devinit.o startxmit.o checktype.o recv.o getlibbase.o

all:	rs485.device


# make rules for rs485.device.  Should blink with no absolute references
rs485.device: ram:syms $(OBJS) rs485.device.lnk #debug.lib
	@echo "BLINK must complete with no absolute references!"
	blink batch with rs485.device.lnk
	-delete \#?.info

libent.o: libent.a
	asm -iINCLUDE: -u libent.a

stub.o: stub.a
	asm -iINCLUDE: stub.a

# build netbuff pragma
#netbuff_pragma.h: netbuff.fd
#	fd2pragma netbuff.fd netbuff_pragma.h
#	copy netbuff_pragma.h include:pragmas/netbuff.h

# build symbol table file - saves on compile time for other files
syms:	rs485.h functions.h
	lc -rr $(ML) $(INCLUDE) -ph -osyms sym.c

ram:syms: syms
	copy syms ram: clone

# debug printf stub that works with "debug" program; separate compilation due to SAS
# separate rule because optimizer fails with CXERR 99 with -O
#dprintf.o: dprintf.c
#	lc -rr -v $(INCLUDE) dprintf

#debug.lib: dprintf.o
#	oml debug.lib r dprintf.o

# cleanup
clean:
	-delete \#?.o
	-delete \#?.info

spotless: clean
	-delete rs485.device ram:syms syms debug.lib

bump:
	bumprev 1 rs485.device_rev
