aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 13 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 6b8f6b4..9bba455 100644
--- a/Makefile
+++ b/Makefile
@@ -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