INC := -I.
AVRDUDE := avrdude -c usbasp -p $(DEVICE) -C $(AVR_DIR)\etc\avrdude.conf
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
CC := avr-gcc
LD := avr-gcc
OBJCOPY := avr-objcopy
+ifeq ($(uname_S),Windows)
RM := del >NUL
+else
+RM := rm -f
+endif
CFLAGS :=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wshadow \
-std=gnu99 -fshort-enums -pedantic-errors -Os -mcall-prologues \
-mmcu=$(DEVICE) -DF_CPU=$(F_CPU)
%.hex: %.elf
$(QUIET_OBJCOPY) -j .text -j .data -O ihex $< $@
-
+
%.elf: %.o
$(QUIET_LD) $(LDFLAGS) $< -o $@
-
+
%.o: %.c
$(QUIET_CC) $(CFLAGS) $(INC) -c $<