b1200ccd6bfdd46cb6c6fcce6a3edb2c160def37
[pub/USBaspLoader.git] / Makefile.inc
1 # Name: Makefile.inc
2 # Project: USBaspLoader (updater)
3 # Author: Stephan Bärwolf
4 # Creation Date: 2012-09-01
5 # Tabsize: 4
6 # License: GNU GPL v2 (see License.txt)
7
8 F_CPU = 16000000
9 DEVICE = atmega8
10
11 # BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k.
12 BOOTLOADER_ADDRESS = 0x1800
13 NEW_BOOTLOADER_ADDRESS = $(BOOTLOADER_ADDRESS)
14
15 # where the updating firmware should be located (starting address)
16 FLASHADDRESS = 0x0000
17
18
19 # PROGRAMMER contains AVRDUDE options to address your programmer
20 # PROGRAMMER = -c pony-stk200
21 PROGRAMMER = -c usbasp
22
23 # since USBaspLoader supports HAVE_BLB11_SOFTW_LOCKBIT...
24 LOCKOPT = -U lock:w:0x3f:m
25
26 # standard atmega8 needs BODLEVEL to be programed, since it is a 5V device
27 # you may also want to UNprogram SUT1 to get a SLOWER bootup (lfuse then would be 0x3f)
28 FUSEOPT_8 = -U hfuse:w:0xc0:m -U lfuse:w:0x1f:m
29
30 #untested (WARNING: may destroy ISP ability!)
31 #device always should select maximum bootloader-section size
32 #please mail tests-reports to matrixstorm@gmx.de:
33 FUSEOPT_32 = unknown
34 FUSEOPT_88 = -U hfuse:w:0xd6:m -U lfuse:w:0xdf:m -U efuse:w:0x00:m
35 FUSEOPT_164 = unknown
36 FUSEOPT_168 = -U hfuse:w:0xd6:m -U lfuse:w:0xdf:m -U efuse:w:0x00:m
37 FUSEOPT_324 = unknown
38 FUSEOPT_328 = -U lfuse:w:0xf7:m -U hfuse:w:0xda:m -U efuse:w:0x03:m
39 FUSEOPT_644 = unknown
40 FUSEOPT_128 = unknown
41 FUSEOPT_1284 = unknown
42
43 ifeq ($(DEVICE), atmega8)
44 FUSEOPT = $(FUSEOPT_8)
45 else ifeq ($(DEVICE), atmega32)
46 FUSEOPT = $(FUSEOPT_32)
47 else ifeq ($(DEVICE), atmega88)
48 FUSEOPT = $(FUSEOPT_88)
49 else ifeq ($(DEVICE), atmega88a)
50 FUSEOPT = $(FUSEOPT_88)
51 else ifeq ($(DEVICE), atmega88p)
52 FUSEOPT = $(FUSEOPT_88)
53 else ifeq ($(DEVICE), atmega88pa)
54 FUSEOPT = $(FUSEOPT_88)
55 else ifeq ($(DEVICE), atmega164a)
56 FUSEOPT = $(FUSEOPT_164)
57 else ifeq ($(DEVICE), atmega164p)
58 FUSEOPT = $(FUSEOPT_164)
59 else ifeq ($(DEVICE), atmega164pa)
60 FUSEOPT = $(FUSEOPT_164)
61 else ifeq ($(DEVICE), atmega168)
62 FUSEOPT = $(FUSEOPT_168)
63 else ifeq ($(DEVICE), atmega168a)
64 FUSEOPT = $(FUSEOPT_168)
65 else ifeq ($(DEVICE), atmega168p)
66 FUSEOPT = $(FUSEOPT_168)
67 else ifeq ($(DEVICE), atmega168pa)
68 FUSEOPT = $(FUSEOPT_168)
69 else ifeq ($(DEVICE), atmega324a)
70 FUSEOPT = $(FUSEOPT_324)
71 else ifeq ($(DEVICE), atmega324p)
72 FUSEOPT = $(FUSEOPT_324)
73 else ifeq ($(DEVICE), atmega324pa)
74 FUSEOPT = $(FUSEOPT_324)
75 else ifeq ($(DEVICE), atmega328)
76 FUSEOPT = $(FUSEOPT_328)
77 else ifeq ($(DEVICE), atmega328p)
78 FUSEOPT = $(FUSEOPT_328)
79 else ifeq ($(DEVICE), atmega644)
80 FUSEOPT = $(FUSEOPT_644)
81 else ifeq ($(DEVICE), atmega644a)
82 FUSEOPT = $(FUSEOPT_644)
83 else ifeq ($(DEVICE), atmega644p)
84 FUSEOPT = $(FUSEOPT_644)
85 else ifeq ($(DEVICE), atmega644pa)
86 FUSEOPT = $(FUSEOPT_644)
87 else ifeq ($(DEVICE), atmega128)
88 FUSEOPT = $(FUSEOPT_128)
89 else ifeq ($(DEVICE), atmega1284)
90 FUSEOPT = $(FUSEOPT_1284)
91 else ifeq ($(DEVICE), atmega1284p)
92 FUSEOPT = $(FUSEOPT_1284)
93 else
94 FUSEOPT = unknown
95 endif
96
97
98 # Tools:
99 AVRPATH = $(AVR8TOOLCHAINBINDIR)
100 AVRDUDE = @echo avrdude $(PROGRAMMER) -p $(DEVICE)
101
102 ECHO=@echo
103 GCC=@gcc
104 MAKE=@make
105 RM=@rm -f
106
107 CC=@$(AVRPATH)avr-gcc
108 OBC=@$(AVRPATH)avr-objcopy
109 OBD=@$(AVRPATH)avr-objdump
110 SIZ=@$(AVRPATH)avr-size
111