projects
/
avr
/
timer-demo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5cbb2c
)
Makefile: support unix builds
master
author
Pat Thoyts
<patthoyts@users.sourceforge.net>
Fri, 3 May 2019 20:16:38 +0000
(21:16 +0100)
committer
Pat Thoyts
<patthoyts@users.sourceforge.net>
Fri, 3 May 2019 20:16:38 +0000
(21:16 +0100)
Makefile
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index 9724f4600fb0b19a656f6a342f006e2d8a6bc952..c0ff095a13e56d67a9117f75b4d88b257a396c74 100644
(file)
--- 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
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
CC := avr-gcc
LD := avr-gcc
OBJCOPY := avr-objcopy
+ifeq ($(uname_S),Windows)
RM := del >NUL
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)
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 $< $@
%.hex: %.elf
$(QUIET_OBJCOPY) -j .text -j .data -O ihex $< $@
-
+
%.elf: %.o
$(QUIET_LD) $(LDFLAGS) $< -o $@
%.elf: %.o
$(QUIET_LD) $(LDFLAGS) $< -o $@
-
+
%.o: %.c
$(QUIET_CC) $(CFLAGS) $(INC) -c $<
%.o: %.c
$(QUIET_CC) $(CFLAGS) $(INC) -c $<