##************************************************************************
##**
##**
##**  makefile
##**
##**
##************************************************************************


NAME	=pidbwc
ADSP    =2181
EXT     =exe
GOALS   =$(NAME).$(EXT) 

OBJS	= pidbwc.obj fldsiz.obj curve.obj sport0.obj servo.obj log.obj

AINCS = adsp2181.h stdsym.h makefile
CINCS = $(AINCS)



.SUFFIXES:
.SUFFIXES: .obj  .dsp



ASM     =asm21

# -$(ADSP) selects the brand of 21xx DSP (2105,2181 etc)
#DEBUG_SIM !0 assembles for running in the simulator
#DEBUG_EMU !0 assembles for running in EZKIT without the 601

# For real
AFLAGS  =-$(ADSP) -dDEBUG_SIM=0 -dDEBUG_EMU=0
# For software simulator
#AFLAGS  =-$(ADSP) -dDEBUG_SIM=1 -dDEBUG_EMU=0
# For EZ kit without the ADV601
#AFLAGS  =-$(ADSP) -dDEBUG_SIM=0 -dDEBUG_EMU=1


LINK	=ld21
LINKFLAGS = -x -g -a ezkit.ach
RC      =rc -r $(ROPT) $(INCLUDES)
RCLINK  =rc $(ROPT) $(INCLUDES)
BLD     = bld21

# DEFAULT RULES
#
#	ASM -> OBJ (Actually DSP -> OBJ) using ADI 21xx assembler.
.dsp.obj:
    $(ASM) $< $(AFLAGS)


goal: $(GOALS) makefile max.dat min.dat $(OBJS)

$(OBJS) : $(AINCS) makefile
 
ezkit.ach:	ezkit.sys
	$(BLD)  $*

pidbwc.obj: pidbwc.dsp  $(AINCS)




$(NAME).$(EXT) : $(OBJS) ezkit.ach max.dat min.dat 
        $(LINK) $(OBJS) $(LINKFLAGS) -e $(NAME)


clean:
        -@del *.obj
        -@del *.map
        -@del *.sym
        -@del *.res

listing:
    copy pidbwc.dsp lpt1:
    copy sport0.dsp lpt1:
    copy fldsiz.dsp lpt1:
    copy servo.dsp lpt1:
    copy curve.dsp lpt1:
    