#***************************************************************************/
# Copyright (c) 2000 MBARI                                                 */
# MBARI Proprietary Information. All rights reserved.                      */
#***************************************************************************/
# Summary  : MBARI Tailcone Application - Makefile                         */
# Filename : makefil                                                       */
# Author   : Andrew Pearce                                                 */
# Project  : Dorado AUV Tailcone                                           */
# Version  : 1.0                                                           */
# Created  : 01/19/00                                                      */
# Modified : 01/19/00                                                      */
# Archived :                                                               */
#***************************************************************************/
# Modification History:                                                    */
#***************************************************************************/

LIB         = $(MICRO)\LIB
INCLUDE     = $(MICRO)\H
IBC	    = $(MICRO)\IBC
BOARDS	    = $(MICRO)\IBC\BOARDS
HARDWARE    = $(MICRO)\HARDWARE\IBC

INCLUDES    = $(INCLUDE), $(HARDWARE), $(IBC), $(BOARDS)

CC          = C:\C96\BIN\IC96
CFLAGS      = debug searchinclude ($(INCLUDES)) registers(20) optimize(3) \
		REGCONSERVE(FSCOPE)

AS          = C:\ASM96\ASM96
ASFLAGS     = debug

LINKER      = RL96
LDFLAGS     =

PROGRAM     = TAILCONE


OBJS        = TAILCONE.OBJ \
	      STP100.OBJ \
	      SV203.OBJ

LIBS	    = $(HARDWARE)\SYSLIB.OBJ \
	      $(IBC)\IBC\IBC.OBJ \
	      $(IBC)\IBC\IBC_CMD.OBJ \
	      $(IBC)\FILTER\FILTER.OBJ

$(LIB)\MICRO.LIB  $(BOARDS)\IBCCARD.LIB

HRDS        = C:/C96/INCLUDE/string.h const.h types.h microasm.h  \
	      applic.h malloc.h microlib.h applay.h serial.h proto.h \
	      microCmd.h timer.h ring.h syslib.h \
              $(IBC)/ibc/ibc_card.h   $(IBC)/ibc/ibc_cmd.h   $(IBC)/ibc/ibc \
	      $(BOARDS)/cpu196/cpu196.h     $(BOARDS)/cpu196/pic.h \
	      $(IBC)/filter/filter.h        $(BOARDS)/gf_5v/gf_board.h \
	      $(BOARDS)/low_pwr/low_pwr.h   $(BOARDS)/high_pwr/high_pwr.h \
	      $(BOARDS)/vicor/vicor.h       $(BOARDS)/AtoD/AtoD.h \
	      $(BOARDS)/quad_ser/quad_ser.h $(BOARDS)/quad_ser/scc2698.h

.SUFFIXES : .obj .c .s .h

.c.obj :
        $(CC)   $*.c  $(CFLAGS)

.s.obj:
        $(AS)  $*.s $(ASFLAGS)

build:	
		(CHDIR $(HARDWARE); ${make})
		(CHDIR $(LIB); ${make})
		(CHDIR $(IBC)\IBC; ${make})
		(CHDIR $(BOARDS); ${make})
		(CHDIR $(IBC)\FILTER; ${make})
		make $(PROGRAM)

$(PROGRAM) :    $(OBJS) $(HDRS) $(LIBS)
	        $(LINKER) &< build.lnk
                COPY C:\TEMP\$(PROGRAM)

TAILCONE.OBJ :	TAILCONE.C TAILCONE.H

STP100.OBJ   :  STP100.c STP100.H

SV203.OBJ    :  SV203.c SV203.H

hex:		TAILCONE.HEX

TAILCONE.HEX:	TAILCONE
		OH TAILCONE to TAILCONE.HEX


