Rev 658 | Rev 693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 658 | Rev 665 | ||
|---|---|---|---|
| Line 38... | Line 38... | ||
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | # MCU name |
40 | # MCU name |
| 41 | #MCU = atmega32 |
41 | #MCU = atmega32 |
| 42 | #MCU = atmega8 |
42 | #MCU = atmega8 |
| 43 |
|
43 | MCU = atmega88 |
| 44 |
|
44 | #MCU = atmega168 |
| 45 | 45 | ||
| 46 | - | ||
| 47 | # Main Oscillator Frequency |
- | |
| 48 | #F_CPU = 1000000 |
- | |
| 49 | #F_CPU = 8000000 |
- | |
| 50 | #F_CPU = 9216000 |
- | |
| 51 | #F_CPU = 16000000 |
- | |
| 52 | F_CPU = 20000000 |
- | |
| 53 | 46 | ||
| 54 | # Output format. (can be srec, ihex, binary) |
47 | # Output format. (can be srec, ihex, binary) |
| 55 | FORMAT = ihex |
48 | FORMAT = ihex |
| 56 | 49 | ||
| 57 | 50 | ||
| 58 | # Target file name (without extension). |
51 | # Target file name (without extension). |
| 59 | TARGET = main |
52 | TARGET = main |
| 60 | 53 | ||
| 61 | LIBDIR = ../../lib |
54 | LIBDIR = ../../avr-lib/ |
| 62 | - | ||
| 63 | 55 | ||
| 64 | # List C source files here. (C dependencies are automatically generated.) |
56 | # List C source files here. (C dependencies are automatically generated.) |
| 65 | SRC = $(TARGET).c\ |
57 | SRC = $(TARGET).c\ |
| 66 | $(LIBDIR) |
58 | $(LIBDIR)drivers/uart/serial.c\ |
| 67 | $(LIBDIR) |
59 | $(LIBDIR)drivers/uart/uart.c\ |
| 68 | $(LIBDIR) |
60 | $(LIBDIR)drivers/timer/timebase.c\ |
| 69 | $(LIBDIR)mcu/mcu.c\ |
61 | $(LIBDIR)drivers/mcu/mcu.c\ |
| 70 | $(LIBDIR)can/can.c\ |
- | |
| 71 | $(LIBDIR)can/mcp2515/mcp2515.c |
62 | $(LIBDIR)drivers/can/mcp2515/mcp2515.c |
| 72 | 63 | ||
| 73 | # List Assembler source files here. |
64 | # List Assembler source files here. |
| 74 | # Make them always end in a capital .S. Files ending in a lowercase .s |
65 | # Make them always end in a capital .S. Files ending in a lowercase .s |
| 75 | # will not be considered source files but generated files (assembler |
66 | # will not be considered source files but generated files (assembler |
| 76 | # output from the compiler), and will be deleted upon "make clean"! |
67 | # output from the compiler), and will be deleted upon "make clean"! |
| Line 92... | Line 83... | ||
| 92 | #DEBUG = stabs |
83 | #DEBUG = stabs |
| 93 | DEBUG = dwarf-2 |
84 | DEBUG = dwarf-2 |
| 94 | 85 | ||
| 95 | # List any extra directories to look for include files here. |
86 | # List any extra directories to look for include files here. |
| 96 | # Each directory must be seperated by a space. |
87 | # Each directory must be seperated by a space. |
| 97 | EXTRAINCDIRS = $(LIBDIR)/ |
88 | EXTRAINCDIRS = $(LIBDIR)drivers/uart $(LIBDIR)drivers/timer $(LIBDIR)drivers/mcu $(LIBDIR)drivers/can/mcp2515/ $(LIBDIR) |
| 98 | 89 | ||
| 99 | # Compiler flag to set the C Standard level. |
90 | # Compiler flag to set the C Standard level. |
| 100 | # c89 - "ANSI" C |
91 | # c89 - "ANSI" C |
| 101 | # gnu89 - c89 plus GCC extensions |
92 | # gnu89 - c89 plus GCC extensions |
| 102 | # c99 - ISO C99 standard (not yet fully implemented) |
93 | # c99 - ISO C99 standard (not yet fully implemented) |
| Line 124... | Line 115... | ||
| 124 | CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums |
115 | CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums |
| 125 | CFLAGS += -Wall -Wstrict-prototypes |
116 | CFLAGS += -Wall -Wstrict-prototypes |
| 126 | CFLAGS += -Wa,-adhlns=$(<:.c=.lst) |
117 | CFLAGS += -Wa,-adhlns=$(<:.c=.lst) |
| 127 | CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) |
118 | CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) |
| 128 | CFLAGS += $(CSTANDARD) |
119 | CFLAGS += $(CSTANDARD) |
| 129 |
|
120 | #CFLAGS += -DF_CPU=$(F_CPU) |
| 130 | 121 | ||
| 131 | 122 | ||
| 132 | 123 | ||
| 133 | # Assembler flags. |
124 | # Assembler flags. |
| 134 | # -Wa,...: tell GCC to pass this to the assembler. |
125 | # -Wa,...: tell GCC to pass this to the assembler. |
| Line 137... | Line 128... | ||
| 137 | # for use in COFF files, additional information about filenames |
128 | # for use in COFF files, additional information about filenames |
| 138 | # and function names needs to be present in the assembler source |
129 | # and function names needs to be present in the assembler source |
| 139 | # files -- see avr-libc docs [FIXME: not yet described there] |
130 | # files -- see avr-libc docs [FIXME: not yet described there] |
| 140 | ##ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
131 | ##ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs |
| 141 | ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-g$(DEBUG) |
132 | ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-g$(DEBUG) |
| 142 |
|
133 | #ASFLAGS += -DF_OSC=$(F_OSC) |
| 143 | 134 | ||
| 144 | 135 | ||
| 145 | #Additional libraries. |
136 | #Additional libraries. |
| 146 | 137 | ||
| 147 | # Minimalistic printf version |
138 | # Minimalistic printf version |
| Line 191... | Line 182... | ||
| 191 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
182 | # dt006 pavr picoweb pony-stk200 sp12 stk200 stk500 |
| 192 | # |
183 | # |
| 193 | # Type: avrdude -c ? |
184 | # Type: avrdude -c ? |
| 194 | # to get a full listing. |
185 | # to get a full listing. |
| 195 | # |
186 | # |
| 196 | AVRDUDE_PROGRAMMER = |
187 | AVRDUDE_PROGRAMMER = dragon_isp |
| 197 | 188 | ||
| 198 | # com1 = serial port. Use lpt1 to connect to parallel port. |
189 | # com1 = serial port. Use lpt1 to connect to parallel port. |
| 199 | AVRDUDE_PORT = |
190 | AVRDUDE_PORT = usb # programmer connected to serial device |
| 200 | AVRDUDE_BAUD = 115200 |
191 | AVRDUDE_BAUD = 115200 |
| 201 | 192 | ||
| 202 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
193 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
| 203 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
194 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
| 204 | 195 | ||