# Name of target machine
target	= mega340

# Size of flash memory (29F010: 010, 29F040: 040)
size	= 010

CFLAGS	= -T ../${target}/flash${size}.ld -O -Wall -target ${target} -s
CC      = ecoc
B	= ../bin

all: hello
hello: hello.c
	ecoc ${CFLAGS} -o $@ $@.c
	mkrom $@ $@.rom
	cp $@.rom ${target}.rom
ll: all
	flashing -i ${target}.rom
clean:
	rm -f hello hello.rom *.o core core.* a.out freak340.rom
veryclean: clean
	rm -f *.rom
install:
	@echo "Did you remember to make linker scripts for any target you want to use?"
	$(MAKE) clean
	$(MAKE) target=scotty08 all
	$(MAKE) clean
	$(MAKE) target=mega301 all
	$(MAKE) clean
	$(MAKE) target=mega332 all
	$(MAKE) clean
	$(MAKE) target=mega340 all
	$(MAKE) clean
	$(MAKE) target=freak340 all

