MLDFLAGS=$(LDFLAGS) -mmcu=$(PART)
MCFLAGS=$(CFLAGS) -DF_CPU=$(FREQ)UL -mmcu=$(PART)
+.SUFFIXES: .hex .elf
+
default: kokare.hex # kokare.ehex
program: kokare.hex
avrdude -q -p m88 -U flash:w:kokare.hex
-%.hex: %.elf
- avr-objcopy -O ihex -R .eeprom $< $@
+.elf.hex:
+ avr-objcopy -O ihex -R .eeprom $> $@
-%.ehex: %.elf
- avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 $< $@
+#%.ehex: %.elf
+# avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 $< $@
kokare.elf: kokare.o
- avr-gcc $< -o $@ $(MLDFLAGS)
+ avr-gcc $> -o $@ $(MLDFLAGS)
-%.o: %.c
+.c.o:
avr-gcc -c $(MCFLAGS) $< -o $@
clean: