###############################################################################
# Makefile for project 
###############################################################################

## General options
PROJECT = 
MCU = ATmega8
COMPILER = "WinAVR"
TARGET = Debug
CLOCK = 8000000
SHELL = C:\WINDOWS\system32\cmd.exe

## Tools general options
CCFLAGS=-Wall -gdwarf-2 -fsigned-char -MD -MP -DF_CPU=8000000 -O1 -mmcu=atmega8
LDFLAGS=-mmcu=atmega8

## Processing Tools
CC=avr-gcc.exe
ASM=avr-gcc.exe
LD=avr-gcc.exe
#  K:/Program Files/VsmStudio/Atmega8_RGB/Debug/Debug.elf: TOOL=LD
#  Post: $(OBJ) avr-objcopy -O ihex -R .eeprom "Debug/Debug.elf" "Debug/Debug.hex"
#  Post: $(OBJ) avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex "Debug/Debug.elf" "Debug/Debug.eep" || exit 0 
#     Debug/mega8_RGB.o: TOOL=CC
#        K:/Program Files/VsmStudio/Atmega8_RGB/mega8_RGB.c

# Build tree:
all:	Debug

Debug:	Debug/Debug.elf

Debug/Debug.elf:	Debug/mega8_RGB.o 
	$(LD) $(LDFLAGS)  -o "Debug/Debug.elf" "Debug/mega8_RGB.o"
	$(OBJ) avr-objcopy -O ihex -R .eeprom "Debug/Debug.elf" "Debug/Debug.hex"
	$(OBJ) avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O ihex "Debug/Debug.elf" "Debug/Debug.eep" || exit 0 

Debug/mega8_RGB.o:	MEGA8_~1.C 
	$(CC) $(CCFLAGS)  -o "Debug/mega8_RGB.o" -c "mega8_RGB.c"

# tidy - delete all temporary files which are not involved in the target generation
tidy:
	rm -rf Debug/mega8_RGB.d

# cleanup - delete all generated files
clean:	tidy
	rm -rf Debug/Debug.elf
	rm -rf Debug/mega8_RGB.o
