forked from vogelchr/avr_cobalt_panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (31 loc) · 946 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
DEVICE_CC = atmega328p
DEVICE_DUDE = ATMEGA328P
# PROGRAMMER_DUDE = -Pusb -c dragon_isp
PROGRAMMER_DUDE = -P /dev/ttyACM0 -c arduino -b 115200
AVRDUDE=avrdude
OBJCOPY=avr-objcopy
OBJDUMP=avr-objdump
CC=avr-gcc
LD=avr-gcc
LDFLAGS=-Wall -g -mmcu=$(DEVICE_CC)
CPPFLAGS=
CFLAGS=-mmcu=$(DEVICE_CC) -Os -Wall -g -DF_CPU=16000000UL -Wno-deprecated-declarations -D__PROG_TYPES_COMPAT__
MYNAME=avr-cobalt-panel
OBJS=$(MYNAME).o hd44780.o cobalt_buttons.o cobalt_leds.o \
serial.o menu.o protocol.o
all : $(MYNAME).hex $(MYNAME).lst
$(MYNAME).bin : $(OBJS)
%.hex : %.bin
$(OBJCOPY) -j .text -j .data -O ihex $^ $@ || (rm -f $@ ; false )
%.lst : %.bin
$(OBJDUMP) -S $^ >$@ || (rm -f $@ ; false )
%.bin : %.o
$(LD) $(LDFLAGS) -o $@ $^
include $(OBJS:.o=.d)
%.d : %.c
$(CC) -o $@ -MM $^
.PHONY : clean burn
burn : $(MYNAME).hex
$(AVRDUDE) $(PROGRAMMER_DUDE) -p $(DEVICE_DUDE) -U flash:w:$^
clean :
rm -f *.bak *~ *.bin *.hex *.lst *.o *.d