Rev 2285 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2285 | Rev 2286 | ||
|---|---|---|---|
| Line 121... | Line 121... | ||
| 121 | # only used for heap (malloc()). |
121 | # only used for heap (malloc()). |
| 122 | #EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff |
122 | #EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff |
| 123 | 123 | ||
| 124 | EXTMEMOPTS = |
124 | EXTMEMOPTS = |
| 125 | 125 | ||
| - | 126 | # GCC bug workaround: |
|
| - | 127 | # Note that due to a GCC bug we must use '--section-start .data=' here instead |
|
| - | 128 | # of the shorthand '-Tdata'. The GCC driver already adds '-Tdata 0x800100' to |
|
| - | 129 | # the ld command line for some AVRs and it seems impossible to override it with |
|
| - | 130 | # another -Tdata, however --section-start works. |
|
| 126 | BIOSOPTS = -Wl,-L$(BIOSDIR),- |
131 | BIOSOPTS = -Wl,-L$(BIOSDIR),--section-start,.data=$(BIOS_RAM_END) |
| 127 | 132 | ||
| 128 | # Linker flags. |
133 | # Linker flags. |
| 129 | # -Wl,...: tell GCC to pass this to linker. |
134 | # -Wl,...: tell GCC to pass this to linker. |
| 130 | # -Map: create map file |
135 | # -Map: create map file |
| 131 | # --cref: add cross reference to map file |
136 | # --cref: add cross reference to map file |
| Line 192... | Line 197... | ||
| 192 | 197 | ||
| 193 | # Default target. |
198 | # Default target. |
| 194 | all: sizebefore buildtree config.h build sizeafter |
199 | all: sizebefore buildtree config.h build sizeafter |
| 195 | 200 | ||
| 196 | build: elf hex eep lss sym |
201 | build: elf hex eep lss sym |
| 197 | 202 | ||
| 198 | elf: $(TARGET).elf |
203 | elf: $(TARGET).elf |
| 199 | hex: $(TARGET).hex |
204 | hex: $(TARGET).hex |
| 200 | eep: $(TARGET).eep |
205 | eep: $(TARGET).eep |
| 201 | lss: $(TARGET).lss |
206 | lss: $(TARGET).lss |
| 202 | sym: $(TARGET).sym |
207 | sym: $(TARGET).sym |
| Line 263... | Line 268... | ||
| 263 | @$(NM) -n $< > $@ |
268 | @$(NM) -n $< > $@ |
| 264 | 269 | ||
| 265 | # Link: create ELF output file from object files. |
270 | # Link: create ELF output file from object files. |
| 266 | .SECONDARY : $(TARGET).elf |
271 | .SECONDARY : $(TARGET).elf |
| 267 | .PRECIOUS : $(OBJ) |
272 | .PRECIOUS : $(OBJ) |
| 268 | # GCC bug workaround: |
- | |
| 269 | # The compiler driver adds '-Tdata 0x800100' to the ld command line for some |
- | |
| 270 | # AVRs, making it impossible to override the .data placement with a |
- | |
| 271 | # subsequent -Tdata option. Detect the broken case and re-run ld with the |
- | |
| 272 | # correct .data location substituted. |
- | |
| 273 | %.elf: $(OBJ) |
273 | %.elf: $(OBJ) |
| 274 | @echo $(MSG_LINKING) $@ |
274 | @echo $(MSG_LINKING) $@ |
| 275 |
|
275 | @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| 276 | 276 | ||
| 277 | #$(LDLIBS) |
277 | #$(LDLIBS) |
| 278 | 278 | ||
| 279 | # Compile: create object files from C source files. |
279 | # Compile: create object files from C source files. |
| 280 | %.o : %.c |
280 | %.o : %.c |