# Simple Makefile
# Volker Oth (c) 1999


include $(AVR)/include/make1

########### change this lines according to your project ##################

#put the name of the target mcu here (-2313, -8515, -8535, -mega103, -mega106)
        MCU     = -8515

#put the name of the target file here (without extension)
	TRG	= hmpeg_hd

#put your C sourcefiles here  
	SRC	=  serial.c tools.c vs1001.c ide.c fat.c rc5.c lcd.c debug.c $(TRG).c

#put additional assembler source file here
        ASRC    = 

#needed libraries and object files to link
        LIB	= 
        #$(LIBDIR)/crt1$(MCU).o

#needed includes to compile
        INC	= 

#compiler flags
	CPFLAGS	= -Os -save-temps -Wall -Wstrict-prototypes -fverbose-asm -ffunction-sections -mcall-prologues
#-ffast-math  -fstrength-reduce  -frerun-loop-opt -mno-interrupts -frerun-loop-opt -frerun-cse-after-loop 
#assembler flags
	ASFLAGS = -L 

#linker flags
	LDFLAGS = 
	#-v -l$(TRG).lnk

########### you should not need to change the following line #############
include $(AVR)/include/make2
		  
###### dependecies, add any dependencies you need here ###################

#tools.o	: tools.c
#	$(CC) -c $(CPFLAGS) -ffunction-sections -I$(INCDIR) $< -o $(@:.o=.o)
#tools.s : tools.o
#	$(AS) -I$(INCDIR) $(ASFLAGS) $< -o $@

#ide.o	: ide.c
#	$(CC) -c $(CPFLAGS) -ffunction-sections -I$(INCDIR) $< -o $(@:.o=.o)
#ide.s : ide.o
#	$(AS) -I$(INCDIR) $(ASFLAGS) $< -o $@


#iso9660.o : iso9660.c
#	$(CC) -c $(CPFLAGS) -ffunction-sections -I$(INCDIR) $< -o $(@:.o=.o)
#iso9660.s : iso9660.o
#	$(AS) -I$(INCDIR) $(ASFLAGS) $< -o $@


$(TRG).o : $(TRG).c lcd.h memory.h vs1001.h fat.h ide.h tools.h serial.h my_defs.h makefile
serial.o : serial.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
tools.o : tools.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
vs1001.o : vs1001.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
ide.o : ide.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
fat.o : fat.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
lcd.o : lcd.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
rc5.o : rc5.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile
debug.o : debug.c lcd.h memory.h fat.h ide.h vs1001.h tools.h serial.h my_defs.h makefile