Subversion Repositories HomeAutomation

Rev

Rev 658 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 658 Rev 667
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, Jörg Wunsch, et al.
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 40... Line 40...
40
# MCU name
40
# MCU name
41
#MCU = atmega32
41
#MCU = atmega32
42
MCU = atmega168
42
MCU = atmega168
43
#MCU = atmega16
43
#MCU = atmega16
44
 
44
 
45
 
-
 
46
# Main Oscillator Frequency
-
 
47
##F_CPU = 1000000
-
 
48
##F_CPU = 1843200
-
 
49
##F_CPU = 2000000
-
 
50
##F_CPU = 3686400
-
 
51
##F_CPU = 4000000
-
 
52
#F_CPU = 8000000
-
 
53
##F_CPU = 11059200
-
 
54
##F_CPU = 16000000
-
 
55
F_CPU = 20000000
-
 
56
 
45
 
57
# Output format. (can be srec, ihex, binary)
46
# Output format. (can be srec, ihex, binary)
58
FORMAT = ihex
47
FORMAT = ihex
59
 
48
 
60
 
49
 
61
# Target file name (without extension).
50
# Target file name (without extension).
62
TARGET = main
51
TARGET = main
63
 
52
 
64
LIBDIR = ../../lib/src/
53
LIBDIR = ../../avr-lib/
65
 
54
 
66
 
55
 
67
# List C source files here. (C dependencies are automatically generated.)
56
# List C source files here. (C dependencies are automatically generated.)
68
SRC =	$(TARGET).c\
57
SRC =	$(TARGET).c\
69
		$(LIBDIR)mcu/mcu.c\
-
 
70
		$(LIBDIR)mcu/serial.c\
58
		$(LIBDIR)drivers/uart/serial.c\
71
		$(LIBDIR)mcu/uart.c\
59
		$(LIBDIR)drivers/uart/uart.c\
72
		$(LIBDIR)mcu/timebase.c\
60
		$(LIBDIR)drivers/timer/timebase.c\
73
		$(LIBDIR)can/can.c\
61
		$(LIBDIR)drivers/mcu/mcu.c\
74
		$(LIBDIR)can/mcp2515/mcp2515.c
62
		$(LIBDIR)drivers/can/mcp2515/mcp2515.c
75
 
63
 
76
# List Assembler source files here.
64
# List Assembler source files here.
77
# 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
78
# will not be considered source files but generated files (assembler
66
# will not be considered source files but generated files (assembler
79
# output from the compiler), and will be deleted upon "make clean"!
67
# output from the compiler), and will be deleted upon "make clean"!
Line 95... Line 83...
95
#DEBUG = stabs
83
#DEBUG = stabs
96
DEBUG = dwarf-2
84
DEBUG = dwarf-2
97
 
85
 
98
# List any extra directories to look for include files here.
86
# List any extra directories to look for include files here.
99
#     Each directory must be seperated by a space.
87
#     Each directory must be seperated by a space.
100
EXTRAINCDIRS = $(LIBDIR)/can $(LIBDIR)/can/mcp2515 $(LIBDIR)/mcu
88
EXTRAINCDIRS = $(LIBDIR)drivers/uart $(LIBDIR)drivers/timer $(LIBDIR)drivers/mcu $(LIBDIR)drivers/can/mcp2515/ $(LIBDIR) 
101
 
89
 
102
# Compiler flag to set the C Standard level.
90
# Compiler flag to set the C Standard level.
103
# c89   - "ANSI" C
91
# c89   - "ANSI" C
104
# gnu89 - c89 plus GCC extensions
92
# gnu89 - c89 plus GCC extensions
105
# c99   - ISO C99 standard (not yet fully implemented)
93
# c99   - ISO C99 standard (not yet fully implemented)
Line 127... Line 115...
127
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
115
CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
128
CFLAGS += -Wall -Wstrict-prototypes
116
CFLAGS += -Wall -Wstrict-prototypes
129
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
117
CFLAGS += -Wa,-adhlns=$(<:.c=.lst)
130
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
118
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
131
CFLAGS += $(CSTANDARD)
119
CFLAGS += $(CSTANDARD)
132
CFLAGS += -DF_CPU=$(F_CPU)
120
#CFLAGS += -DF_CPU=$(F_CPU)
133
 
121
 
134
 
122
 
135
 
123
 
136
# Assembler flags.
124
# Assembler flags.
137
#  -Wa,...:   tell GCC to pass this to the assembler.
125
#  -Wa,...:   tell GCC to pass this to the assembler.
Line 140... Line 128...
140
#             for use in COFF files, additional information about filenames
128
#             for use in COFF files, additional information about filenames
141
#             and function names needs to be present in the assembler source
129
#             and function names needs to be present in the assembler source
142
#             files -- see avr-libc docs [FIXME: not yet described there]
130
#             files -- see avr-libc docs [FIXME: not yet described there]
143
##ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
131
##ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
144
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-g$(DEBUG)
132
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-g$(DEBUG)
145
ASFLAGS += -DF_OSC=$(F_OSC)
133
#ASFLAGS += -DF_OSC=$(F_OSC)
146
 
134
 
147
 
135
 
148
#Additional libraries.
136
#Additional libraries.
149
 
137
 
150
# Minimalistic printf version
138
# Minimalistic printf version
Line 194... Line 182...
194
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
182
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
195
#
183
#
196
# Type: avrdude -c ?
184
# Type: avrdude -c ?
197
# to get a full listing.
185
# to get a full listing.
198
#
186
#
199
AVRDUDE_PROGRAMMER = avrispv2
187
AVRDUDE_PROGRAMMER = dragon_isp
200
 
188
 
201
# com1 = serial port. Use lpt1 to connect to parallel port.
189
# com1 = serial port. Use lpt1 to connect to parallel port.
202
AVRDUDE_PORT = /dev/ttyUSB1    # programmer connected to serial device
190
AVRDUDE_PORT = usb    # programmer connected to serial device
203
AVRDUDE_BAUD = 115200
191
AVRDUDE_BAUD = 115200
204
 
192
 
205
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
193
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
206
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
194
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
207
 
195
 
Line 218... Line 206...
218
# Increase verbosity level.  Please use this when submitting bug
206
# Increase verbosity level.  Please use this when submitting bug
219
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> 
207
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> 
220
# to submit bug reports.
208
# to submit bug reports.
221
#AVRDUDE_VERBOSE = -v -v
209
#AVRDUDE_VERBOSE = -v -v
222
 
210
 
223
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -b $(AVRDUDE_BAUD)
211
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
224
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
212
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
225
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
213
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
226
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
214
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
227
 
215
 
228
 
216