Rev 239 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 239 | Rev 255 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | # Hey Emacs, this is a -*- makefile -*- |
1 | # Hey Emacs, this is a -*- makefile -*- |
| 2 | # |
2 | # |
| 3 | # WinAVR makefile written by Eric B. Weddington, |
3 | # WinAVR makefile written by Eric B. Weddington, Jörg Wunsch, et al. |
| 4 | # Released to the Public Domain |
4 | # Released to the Public Domain |
| 5 | # Please read the make user manual! |
5 | # Please read the make user manual! |
| 6 | # |
6 | # |
| 7 | # Additional material for this makefile was submitted by: |
7 | # Additional material for this makefile was submitted by: |
| 8 | # Tim Henigan |
8 | # Tim Henigan |
| Line 48... | Line 48... | ||
| 48 | ##F_OSC = 1843200 |
48 | ##F_OSC = 1843200 |
| 49 | ##F_OSC = 2000000 |
49 | ##F_OSC = 2000000 |
| 50 | ##F_OSC = 3686400 |
50 | ##F_OSC = 3686400 |
| 51 | ##F_OSC = 4000000 |
51 | ##F_OSC = 4000000 |
| 52 | F_OSC = 8000000 |
52 | F_OSC = 8000000 |
| 53 |
|
53 | #F_OSC = 11059200 |
| 54 | ##F_OSC = 16000000 |
54 | ##F_OSC = 16000000 |
| 55 | 55 | ||
| 56 | # Output format. (can be srec, ihex, binary) |
56 | # Output format. (can be srec, ihex, binary) |
| 57 | FORMAT = ihex |
57 | FORMAT = ihex |
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | # Target file name (without extension). |
60 | # Target file name (without extension). |
| 61 | TARGET = main |
61 | TARGET = main |
| 62 | 62 | ||
| 63 | LIBDIR = ../lib/src/ |
63 | LIBDIR = ../lib/src/ |
| 64 | - | ||
| 65 | 64 | ||
| 66 | # List C source files here. (C dependencies are automatically generated.) |
65 | # List C source files here. (C dependencies are automatically generated.) |
| 67 | SRC = $(TARGET).c\ |
66 | SRC = $(TARGET).c\ |
| 68 | $(LIBDIR)mcu/mcu.c\ |
67 | $(LIBDIR)mcu/mcu.c\ |
| 69 | $(LIBDIR)mcu/serial.c\ |
68 | $(LIBDIR)mcu/serial.c\ |
| 70 | $(LIBDIR)mcu/uart.c\ |
69 | $(LIBDIR)mcu/uart.c\ |
| 71 | $(LIBDIR)mcu/timebase.c\ |
70 | $(LIBDIR)mcu/timebase.c\ |
| 72 | $(LIBDIR)can/can.c\ |
71 | $(LIBDIR)can/can.c\ |
| 73 | $(LIBDIR)can/mcp2515/mcp2515.c\ |
72 | $(LIBDIR)can/mcp2515/mcp2515.c\ |
| 74 | $(LIBDIR)sensor/ds18s20/onewire.c\ |
- | |
| 75 | $(LIBDIR)sensor/ds18s20/delay.c\ |
- | |
| 76 | $(LIBDIR)sensor/ds18s20/ds18x20.c\ |
73 | $(LIBDIR)sensor/ds18s20/ds18x20.c\ |
| 77 | $(LIBDIR)sensor/ds18s20/crc8.c\ |
74 | $(LIBDIR)sensor/ds18s20/crc8.c\ |
| - | 75 | $(LIBDIR)sensor/ds18s20/delay.c\ |
|
| - | 76 | $(LIBDIR)sensor/ds18s20/onewire.c\ |
|
| 78 | $(LIBDIR)sensor/tc1047/tc1047.c\ |
77 | $(LIBDIR)sensor/tc1047/tc1047.c\ |
| 79 | $(LIBDIR)sensor/sht7x/sht7x.c |
- | |
| 80 | 78 | ||
| 81 | # List Assembler source files here. |
79 | # List Assembler source files here. |
| 82 | # Make them always end in a capital .S. Files ending in a lowercase .s |
80 | # Make them always end in a capital .S. Files ending in a lowercase .s |
| 83 | # will not be considered source files but generated files (assembler |
81 | # will not be considered source files but generated files (assembler |
| 84 | # output from the compiler), and will be deleted upon "make clean"! |
82 | # output from the compiler), and will be deleted upon "make clean"! |
| Line 96... | Line 94... | ||
| 96 | 94 | ||
| 97 | # Debugging format. |
95 | # Debugging format. |
| 98 | # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. |
96 | # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. |
| 99 | # AVR (extended) COFF requires stabs, plus an avr-objcopy run. |
97 | # AVR (extended) COFF requires stabs, plus an avr-objcopy run. |
| 100 | #DEBUG = stabs |
98 | #DEBUG = stabs |
| 101 | DEBUG = |
99 | DEBUG = dwarf-2 |
| 102 | 100 | ||
| 103 | # List any extra directories to look for include files here. |
101 | # List any extra directories to look for include files here. |
| 104 | # Each directory must be seperated by a space. |
102 | # Each directory must be seperated by a space. |
| 105 | EXTRAINCDIRS = $(LIBDIR)/ |
103 | EXTRAINCDIRS = $(LIBDIR)/can\ |
| - | 104 | $(LIBDIR)/can/mcp2515\ |
|
| - | 105 | $(LIBDIR)/mcu\ |
|
| - | 106 | $(LIBDIR)/../funcdefs\ |
|
| - | 107 | $(LIBDIR)/sensor/ds18s20 \ |
|
| - | 108 | $(LIBDIR)/sensor/tc1047 \ |
|
| 106 | 109 | ||
| 107 | # Compiler flag to set the C Standard level. |
110 | # Compiler flag to set the C Standard level. |
| 108 | # c89 - "ANSI" C |
111 | # c89 - "ANSI" C |
| 109 | # gnu89 - c89 plus GCC extensions |
112 | # gnu89 - c89 plus GCC extensions |
| 110 | # c99 - ISO C99 standard (not yet fully implemented) |
113 | # c99 - ISO C99 standard (not yet fully implemented) |
| Line 121... | Line 124... | ||
| 121 | # Compiler flags. |
124 | # Compiler flags. |
| 122 | # -g*: generate debugging information |
125 | # -g*: generate debugging information |
| 123 | # -O*: optimization level |
126 | # -O*: optimization level |
| 124 | # -f...: tuning, see GCC manual and avr-libc documentation |
127 | # -f...: tuning, see GCC manual and avr-libc documentation |
| 125 | # -Wall...: warning level |
128 | # -Wall...: warning level |
| 126 | # -Wa,...: tell GCC to pass this to the assembler. |
129 | # -Wa,...: tell GCC to pass this to the assembler. |
| 127 | # -adhlns...: create assembler listing |
130 | # -adhlns...: create assembler listing |
| - | 131 | CFLAGS = |
|
| 128 |
|
132 | #CFLAGS += -g$(DEBUG) |
| 129 | CFLAGS += $(CDEFS) $(CINCS) |
133 | CFLAGS += $(CDEFS) $(CINCS) |
| 130 | CFLAGS += -O$(OPT) |
134 | CFLAGS += -O$(OPT) |
| 131 | CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums |
135 | CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums |
| 132 | CFLAGS += -Wall -Wstrict-prototypes |
136 | CFLAGS += -Wall -Wstrict-prototypes |
| 133 | CFLAGS += -Wa,-adhlns=$(<:.c=.lst) |
137 | CFLAGS += -Wa,-adhlns=$(<:.c=.lst) |
| 134 | CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) |
138 | CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) |
| 135 | CFLAGS += $(CSTANDARD) |
139 | CFLAGS += $(CSTANDARD) |
| 136 | CFLAGS += -DF_OSC=$(F_OSC) |
140 | CFLAGS += -DF_OSC=$(F_OSC) |
| 137 | - | ||
| 138 | 141 | ||
| 139 | 142 | ||
| 140 | # Assembler flags. |
143 | # Assembler flags. |
| 141 | # -Wa,...: tell GCC to pass this to the assembler. |
144 | # -Wa,...: tell GCC to pass this to the assembler. |
| 142 | # -ahlms: create listing |
145 | # -ahlms: create listing |
| Line 155... | Line 158... | ||
| 155 | PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min |
158 | PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min |
| 156 | 159 | ||
| 157 | # Floating point printf version (requires MATH_LIB = -lm below) |
160 | # Floating point printf version (requires MATH_LIB = -lm below) |
| 158 | PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt |
161 | PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt |
| 159 | 162 | ||
| 160 | PRINTF_LIB = |
163 | PRINTF_LIB = $(PRINTF_LIB_MIN) |
| 161 | 164 | ||
| 162 | # Minimalistic scanf version |
165 | # Minimalistic scanf version |
| 163 | SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min |
166 | SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min |
| 164 | 167 | ||
| 165 | # Floating point + %[ scanf version (requires MATH_LIB = -lm below) |
168 | # Floating point + %[ scanf version (requires MATH_LIB = -lm below) |
| Line 202... | Line 205... | ||
| 202 | # |
205 | # |
| 203 | AVRDUDE_PROGRAMMER = avrispv2 |
206 | AVRDUDE_PROGRAMMER = avrispv2 |
| 204 | 207 | ||
| 205 | # com1 = serial port. Use lpt1 to connect to parallel port. |
208 | # com1 = serial port. Use lpt1 to connect to parallel port. |
| 206 | AVRDUDE_PORT = /dev/ttyUSB0 # programmer connected to serial device |
209 | AVRDUDE_PORT = /dev/ttyUSB0 # programmer connected to serial device |
| - | 210 | AVRDUDE_BAUD = 115200 |
|
| 207 | 211 | ||
| 208 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
212 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex |
| 209 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
213 | #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep |
| 210 | 214 | ||
| 211 | 215 | ||
| Line 220... | Line 224... | ||
| 220 | 224 | ||
| 221 | # Increase verbosity level. Please use this when submitting bug |
225 | # Increase verbosity level. Please use this when submitting bug |
| 222 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
226 | # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> |
| 223 | # to submit bug reports. |
227 | # to submit bug reports. |
| 224 | #AVRDUDE_VERBOSE = -v -v |
228 | #AVRDUDE_VERBOSE = -v -v |
| 225 | #-b $(AVRDUDE_BAUD) |
- | |
| - | 229 | ||
| 226 | AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) |
230 | AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -b $(AVRDUDE_BAUD) |
| 227 |
|
231 | AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) |
| 228 | AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) |
232 | AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) |
| 229 | AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) |
233 | AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) |
| 230 | 234 | ||
| 231 | 235 | ||
| 232 | 236 | ||