diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -12,25 +12,28 @@ DUDEFLAGS += -c $(PROGRAMMER) -p $(MCU) -P $(MCUPATH) # timer.s file TARGET ?= timer -.PHONY: flash dump-timer clean all - all: $(TARGET).hex +.PHONY: flash dump clean all +.SUFFIXES: + +.PRECIOUS: $(TARGET).o $(TARGET).elf + flash: $(TARGET).hex test $(shell id -u) = 0 $(DUDE) $(DUDEFLAGS) -U flash:w:$< -%.hex: % - $(OBJ)copy -O ihex $< $@ +%.o: %.s + $(AS) -mmcu=$(MCU) -o $@ $< -%: %.o +%.elf: %.o $(LD) $(LDFLAGS) -o $@ $< -%.o: %.s - $(AS) -mmcu=$(MCU) -o $@ $< +%.hex: %.elf + $(OBJ)copy -O ihex $< $@ -dump-%: % - $(OBJ)dump -d timer +dump: $(TARGET).elf + $(OBJ)dump -d clean: - rm *.o *.hex *.elf *.bin timer + $(RM) *.o *.hex *.elf *.bin timer |