Rev 698 | Rev 1645 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 698 | Rev 859 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | ######## |
34 | ######## |
| 35 | # Differences from WinAVR 20040720 sample: |
35 | # Differences from WinAVR 20040720 sample: |
| 36 | # - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum) |
36 | # - DEPFLAGS according to Eric Weddingtion's fix (avrfreaks/gcc-forum) |
| 37 | # - F_OSC Define in CFLAGS and AFLAGS |
37 | # - F_OSC Define in CFLAGS and AFLAGS |
| 38 | 38 | ||
| - | 39 | ## HomeAutomation-users! Make sure you have a system.inc in your EmbeddedSoftware/AVR/personal folder ## |
|
| 39 | 40 | ||
| 40 | # MCU name |
- | |
| 41 |
|
41 | ## FUSES, will automatically be programmed ## |
| 42 | #MCU = atmega8 |
42 | #MCU = atmega8 |
| - | 43 | ||
| 43 |
|
44 | #MCU = atmega88 |
| - | 45 | #HIGHFUSE=0xdc |
|
| - | 46 | #LOWFUSE=0xe2 |
|
| - | 47 | #EXTFUSE=0x01 |
|
| - | 48 | ||
| 44 |
|
49 | MCU = atmega168 |
| - | 50 | HIGHFUSE=0xdc |
|
| - | 51 | LOWFUSE=0xe2 |
|
| - | 52 | EXTFUSE=0x01 |
|
| - | 53 | ||
| - | 54 | ||
| - | 55 | # for using the same system.inc we use BIOSDIR and BIOSTARGET for setting the correct file to flash |
|
| - | 56 | # flash:w:$(BIOSDIR)/$(BIOSTARGET).hex |
|
| - | 57 | BIOSDIR = . |
|
| - | 58 | BIOSTARGET = main |
|
| - | 59 | include ../../personal/system.inc |
|
| 45 | 60 | ||
| 46 | 61 | ||
| 47 | # Output format. (can be srec, ihex, binary) |
62 | # Output format. (can be srec, ihex, binary) |
| 48 | FORMAT = ihex |
63 | FORMAT = ihex |
| 49 | 64 | ||
| 50 | 65 | ||
| 51 | # Target file name (without extension). |
66 | # Target file name (without extension). |
| 52 | TARGET = main |
67 | TARGET = main |
| 53 | 68 | ||
| 54 | LIBDIR = ../../avr-lib/ |
69 | LIBDIR = ../../avr-lib/ |
| 55 | 70 | ||
| 56 | # List C source files here. (C dependencies are automatically generated.) |
71 | # List C source files here. (C dependencies are automatically generated.) |
| 57 | SRC = $(TARGET).c\ |
72 | SRC = $(TARGET).c\ |
| 58 | $(LIBDIR)drivers/uart/serial.c\ |
73 | $(LIBDIR)drivers/uart/serial.c\ |
| 59 | $(LIBDIR)drivers/uart/uart.c\ |
74 | $(LIBDIR)drivers/uart/uart.c\ |
| 60 | $(LIBDIR)drivers/timer/timebase.c\ |
75 | $(LIBDIR)drivers/timer/timebase.c\ |
| Line 75... | Line 90... | ||
| 75 | # Optimization level, can be [0, 1, 2, 3, s]. |
90 | # Optimization level, can be [0, 1, 2, 3, s]. |
| 76 | # 0 = turn off optimization. s = optimize for size. |
91 | # 0 = turn off optimization. s = optimize for size. |
| 77 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
92 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
| 78 | OPT = s |
93 | OPT = s |
| 79 | #OPT = 3 |
94 | #OPT = 3 |
| 80 | 95 | ||
| 81 | # Debugging format. |
96 | # Debugging format. |
| 82 | # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. |
97 | # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. |
| 83 | # AVR (extended) COFF requires stabs, plus an avr-objcopy run. |
98 | # AVR (extended) COFF requires stabs, plus an avr-objcopy run. |
| 84 | #DEBUG = stabs |
99 | #DEBUG = stabs |
| 85 | DEBUG = dwarf-2 |
100 | DEBUG = dwarf-2 |
| Line 173... | Line 188... | ||
| 173 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
188 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
| 174 | LDFLAGS += $(EXTMEMOPTS) |
189 | LDFLAGS += $(EXTMEMOPTS) |
| 175 | LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) |
190 | LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) |
| 176 | 191 | ||
| 177 | 192 | ||
| 178 | - | ||
| - | 193 | ## HomeAutomation-users: settings are moved to system.inc ## |
|
| 179 | 194 | ||
| 180 | # Programming support using avrdude. Settings and variables. |
195 | # Programming support using avrdude. Settings and variables. |
| 181 | 196 | ||
| 182 | # Programming hardware: alf avr910 avrisp bascom bsd |
197 | # Programming hardware: alf avr910 avrisp bascom bsd |
| 183 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
198 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
| 184 | # |
199 | # |
| 185 | # Type: avrdude -c ? |
200 | # Type: avrdude -c ? |
| 186 | # to get a full listing. |
201 | # to get a full listing. |
| 187 | # |
202 | # |
| 188 |
|
203 | #AVRDUDE_PROGRAMMER = avrispmkII |
| 189 | 204 | ||
| 190 | # com1 = serial port. Use lpt1 to connect to parallel port. |
205 | # com1 = serial port. Use lpt1 to connect to parallel port. |
| 191 |
|
206 | #AVRDUDE_PORT = usb # programmer connected to serial device |
| 192 |
|
207 | #AVRDUDE_BAUD = 115200 |
| 193 | 208 | ||
| 194 |
|
209 | #AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
| 195 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
210 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
| 196 | 211 | ||
| 197 | 212 | ||
| 198 | # Uncomment the following if you want avrdude's erase cycle counter. |
213 | # Uncomment the following if you want avrdude's erase cycle counter. |
| 199 | # Note that this counter needs to be initialized first using -Yn, |
214 | # Note that this counter needs to be initialized first using -Yn, |
| Line 207... | Line 222... | ||
| 207 | # Increase verbosity level. Please use this when submitting bug |
222 | # Increase verbosity level. Please use this when submitting bug |
| 208 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
223 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
| 209 | # to submit bug reports. |
224 | # to submit bug reports. |
| 210 | #AVRDUDE_VERBOSE = -v -v |
225 | #AVRDUDE_VERBOSE = -v -v |
| 211 | 226 | ||
| 212 |
|
227 | #AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -b $(AVRDUDE_BAUD) |
| 213 |
|
228 | #AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) |
| 214 |
|
229 | #AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) |
| 215 |
|
230 | #AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) |
| 216 | 231 | ||
| 217 | 232 | ||
| 218 | 233 | ||
| 219 | # --------------------------------------------------------------------------- |
234 | # --------------------------------------------------------------------------- |
| 220 | 235 | ||
| Line 231... | Line 246... | ||
| 231 | CC = avr-gcc |
246 | CC = avr-gcc |
| 232 | OBJCOPY = avr-objcopy |
247 | OBJCOPY = avr-objcopy |
| 233 | OBJDUMP = avr-objdump |
248 | OBJDUMP = avr-objdump |
| 234 | SIZE = avr-size |
249 | SIZE = avr-size |
| 235 | NM = avr-nm |
250 | NM = avr-nm |
| 236 |
|
251 | #AVRDUDE = avrdude |
| 237 | REMOVE = rm -f |
252 | REMOVE = rm -f |
| 238 | COPY = cp |
253 | COPY = cp |
| 239 | 254 | ||
| 240 | 255 | ||
| 241 | 256 | ||
| Line 323... | Line 338... | ||
| 323 | # Display compiler version information. |
338 | # Display compiler version information. |
| 324 | gccversion : |
339 | gccversion : |
| 325 | @$(CC) --version |
340 | @$(CC) --version |
| 326 | 341 | ||
| 327 | 342 | ||
| - | 343 | # Program the device. |
|
| - | 344 | install: $(TARGET).hex $(TARGET).eep |
|
| - | 345 | $(UPLOAD) $(ULFLAGS) |
|
| 328 | 346 | ||
| 329 | # Program the device. |
347 | # Program the device. |
| 330 | program: $(TARGET).hex $(TARGET).eep |
348 | program: $(TARGET).hex $(TARGET).eep |
| - | 349 | $(UPLOAD) $(ULFLAGS) |
|
| 331 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
350 | # $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) |
| 332 | 351 | ||
| 333 | #programlock: |
352 | #programlock: |
| 334 | # $(AVRDUDE) $(AVRDUDE_FLAGS) -U lock:w:0x00:m |
353 | # $(AVRDUDE) $(AVRDUDE_FLAGS) -U lock:w:0x00:m |
| 335 | 354 | ||
| 336 | #programinit: |
355 | #programinit: |