-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.config
48 lines (33 loc) · 1.25 KB
/
Makefile.config
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
45
46
#Common Makefile configuration bits
PORT=/dev/tty.usbmodem5d11
PROGRAMMER=avrisp
MCU=atmega8
BAUD=115200
INCLUDES = -I/opt/local/avr #-I/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include/avr
CFLAGS = $(INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_INCLUDES) -Wall -pedantic -gstabs -std=gnu99 -Os -DF_CPU=16000000UL -mmcu=$(MCU) -fno-exceptions -ffunction-sections -fdata-sections
CPPFLAGS = $(INCLUDES) $(LOCAL_CPPFLAGS) $(LOCAL_INCLUDES) -Wall -pedantic -gstabs -Os -DF_CPU=16000000UL -mmcu=$(MCU)
LDFLAGS = -Wl,--gc-sections -lm
COMPILER_DIRECTORY=/opt/local/bin
CC=$(COMPILER_DIRECTORY)/avr-gcc
CPP=$(COMPILER_DIRECTORY)/avr-g++
AR=$(COMPILER_DIRECTORY)/avr-ar
OBJCOPY=$(COMPILER_DIRECTORY)/avr-objcopy
OBJDUMP=$(COMPILER_DIRECTORY)/avr-objdump
AVRDUDE=$(COMPILER_DIRECTORY)/avrdude
AVRDUDE_CONF=$(COMPILER_DIRECTORY)/../etc/avrdude.conf
%.o: %.c $(HEADERS)
$(CC) -c $(CFLAGS) $< -o $@
%.o: %.cpp
$(CPP) -c $(CPPFLAGS) $< -o $@
%.cpp: %.pde
cp $< $@
%.eep : %.elf
$(OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --o-change-warnings --change-section-lma .eeprom=0 $< $@
%.hex : %.elf
$(OBJCOPY) -O ihex -R .eeprom $< $@
dump.txt : %.elf
$(OBJDUMP) -D $< > $@
force_look :
true
clean:
@rm -f $(OBJECTS) *.hex *.elf *.dis