#**************************************************************************
#* FILE NAME: $RCSfile: makefile,v $         COPYRIGHT (c) FREESCALE 2006 *
#* DESCRIPTION:                                     All Rights Reserved   *
#* This is the makefile for example Decimator project.                    *
#*========================================================================*
#* MAKE: GNU make        VERSION: 3.80                                    *
#* ORIGINAL AUTHOR: Geoff Emerson [r47354]                                *
#* $Log: makefile,v $
#* Revision 1.2  2006/06/14 12:06:39  r47354
#* Remove references to gpio API. Not used.
#*
#* Revision 1.1  2006/06/14 10:45:32  r47354
#* Initial revision.
#*
#*........................................................................*
#*************************************************************************/
VPATH = ..\etpu_decimate_function ..\..\utils ..\..\mpc5500 ..\etpu_decimate_function\cpu

DEL = del
CC = dcc												# use diab compiler
AS = das												# use diab assembler
LD = dld                        # use diab linker
DUMP = ddump												

CFLAGS = -tPPC5554ES -c -g -Xnested-interrupts -Xdebug-dwarf2 -I..\etpu_decimate_function -I..\..\mpc5500 -I..\..\utils -I..\etpu_decimate_function\cpu -I..
ASFLAGS = -tPPC5554ES:cross 
LDFLAGS = -tPPC555ES:cross MPC5534_intram.dld -m2					  
LIBS    = -li -lchar -lc -lcfp -lg

INC = mpc5534.h typedefs.h etpu_util.h decimator_project.h makefile
OBJS  =  ..\..\utils\etpu_util.o etpu_decimate.o crt0.o dma_init_for_eqadc_config.o eqadc_init.o

all: decimate_etpu_example.elf

decimate_etpu_example.elf : decimate_etpu_example.o $(OBJS) $(INC) MPC5534_intram.dld etpu_util.o
	cd ..\..\utils && $(MAKE)
	$(LD) $(LDFLAGS) decimate_etpu_example.o $(OBJS) $(LIBS) -o ${@F} > decimate_etpu_example.map
#	ddump -R decimate_etpu_example.elf -o decimate_etpu_example.s19

decimate_etpu_example.o : decimate_etpu_example.c etpu_decimate.h etpu_decimate_function.h $(INC)
	$(CC) $(CFLAGS) $<

etpu_decimate.o : etpu_decimate.c etpu_decimate.h etpu_decimate_auto.h $(INC) etpu_util.o
	cd ..\..\utils && $(MAKE)
	$(CC) $(CFLAGS) $<

dma_init_for_eqadc_config.o : dma_init_for_eqadc_config.c $(INC) makefile
	$(CC) $(CFLAGS) $< -o $@

eqadc_init.o : eqadc_init.c $(INC) makefile
	$(CC) $(CFLAGS) $< -o $@

crt0.o : crt0.s makefile
	$(AS) $(ASFLAGS) -o $@ $< 
	
clean:
	$(DEL) -f *.o *.elf *.map
	$(DEL) -f *.s19
	$(DEL) -f *.ou1 *.db *.db2 *.blk
	$(DEL) -f *.?~ m_*.*
	
clean_all:
	$(DEL) *.db *.ou1 *.blk *.db2 *.map *.hex *lst *.err *.elf __*.* *.o
	cd ..\..\utils && $(MAKE) clean
	


