From f3866a6b89c1de71e394f0eb8ae5bb331cfee860 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Fri, 3 May 2019 21:16:38 +0100 Subject: [PATCH] Makefile: support unix builds --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9724f46..c0ff095 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,16 @@ F_CPU := 16000000UL 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) @@ -26,10 +32,10 @@ all: $(PROJECT).hex %.hex: %.elf $(QUIET_OBJCOPY) -j .text -j .data -O ihex $< $@ - + %.elf: %.o $(QUIET_LD) $(LDFLAGS) $< -o $@ - + %.o: %.c $(QUIET_CC) $(CFLAGS) $(INC) -c $< -- 2.23.0