source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/bootloaders/atmega8/Makefile @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 1.8 KB
Line 
1# Makefile for ATmegaBOOT
2# E.Lins, 2004-10-14
3
4# program name should not be changed...
5PROGRAM    = ATmegaBOOT
6
7PRODUCT=atmega8
8
9# enter the parameters for the UISP isp tool
10ISPPARAMS  = -dprog=stk500 -dserial=$(SERIAL) -dspeed=115200
11
12
13#DIRAVR = /usr/local/avr
14DIRAVRBIN = $(DIRAVR)/bin
15DIRAVRUTILS = $(DIRAVR)/utils/bin
16DIRINC = $(DIRAVR)/include
17DIRLIB = $(DIRAVR)/avr/lib
18
19
20MCU_TARGET = atmega8
21LDSECTION  = --section-start=.text=0x1c00
22FUSE_L     = 0xdf
23FUSE_H     = 0xca
24ISPFUSES   = $(DIRAVRBIN)/uisp -dpart=ATmega8 $(ISPPARAMS) --wr_fuse_l=$(FUSE_L) --wr_fuse_h=$(FUSE_H)
25ISPFLASH   = $(DIRAVRBIN)/uisp -dpart=ATmega8 $(ISPPARAMS) --erase --upload if=$(PROGRAM).hex -v
26
27
28OBJ        = $(PROGRAM).o
29OPTIMIZE   = -Os -funsigned-char -funsigned-bitfields -fno-inline-small-functions
30
31DEFS       = -DF_CPU=16000000 -DBAUD_RATE=19200
32LIBS       =
33
34CC         = $(DIRAVRBIN)/avr-gcc
35
36
37# Override is only needed by avr-lib build system.
38
39override CFLAGS        = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -D$(PRODUCT) $(DEFS) -I$(DIRINC)
40override LDFLAGS       = -Wl,-Map,$(PROGRAM).map,$(LDSECTION)
41
42OBJCOPY        = $(DIRAVRBIN)/avr-objcopy
43OBJDUMP        = $(DIRAVRBIN)/avr-objdump
44SIZE           = $(DIRAVRBIN)/avr-size
45
46all: $(PROGRAM).elf lst text asm size
47
48isp: $(PROGRAM).hex
49        $(ISPFUSES)
50        $(ISPFLASH)
51
52$(PROGRAM).elf: $(OBJ)
53        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
54
55clean:
56        rm -rf *.s
57        rm -rf *.o *.elf
58        rm -rf *.lst *.map
59
60asm: $(PROGRAM).s
61
62%.s: %.c
63        $(CC) -S $(CFLAGS) -g1 $^
64
65lst:  $(PROGRAM).lst
66
67%.lst: %.elf
68        $(OBJDUMP) -h -S $< > $@
69
70size: $(PROGRAM).hex
71        $(SIZE) $^
72
73# Rules for building the .text rom images
74
75text: hex bin srec
76
77hex:  $(PROGRAM).hex
78bin:  $(PROGRAM).bin
79srec: $(PROGRAM).srec
80
81%.hex: %.elf
82        $(OBJCOPY) -j .text -j .data -O ihex $< $@
83
84%.srec: %.elf
85        $(OBJCOPY) -j .text -j .data -O srec $< $@
86
87%.bin: %.elf
88        $(OBJCOPY) -j .text -j .data -O binary $< $@
Note: See TracBrowser for help on using the repository browser.