Rev 361 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 361 | Rev 362 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | # |
1 | # $Id: Makefile 362 2007-03-07 15:07:46Z andfri $ |
| 2 | PRG = bios |
2 | PRG = bios |
| 3 | ASRC = $(BIOSDIR)/vectors.S |
3 | ASRC = $(BIOSDIR)/vectors.S |
| 4 | CSRC = $(BIOSDIR)/bios_export.c $(BIOSDIR)/bios.c $(BIOSDIR)/flash.c |
4 | CSRC = $(BIOSDIR)/bios_export.c $(BIOSDIR)/bios.c $(BIOSDIR)/flash.c |
| 5 | BIOS_VERSION = 0x1337 |
5 | BIOS_VERSION = 0x1337 |
| 6 | OPTIMIZE = -Os -mcall-prologues |
6 | OPTIMIZE = -Os -mcall-prologues |
| Line 56... | Line 56... | ||
| 56 | .PHONY: clean cleanintermediate cleantemplate |
56 | .PHONY: clean cleanintermediate cleantemplate |
| 57 | clean: cleanintermediate cleantemplate |
57 | clean: cleanintermediate cleantemplate |
| 58 | -rm -f $(PRG).elf $(PRG).lst $(PRG).map *.hex |
58 | -rm -f $(PRG).elf $(PRG).lst $(PRG).map *.hex |
| 59 | 59 | ||
| 60 | cleanintermediate: |
60 | cleanintermediate: |
| 61 | -rm -f $(OBJ) |
61 | -rm -f $(OBJ) $(LIBNAME).[So] *.d $(BIOSDIR)/config.h |
| 62 | 62 | ||
| 63 | cleantemplate: |
63 | cleantemplate: |
| 64 | -rm -f $(TEMPLATEDIR)/bios.* $(TEMPLATEDIR)/$(LIBNAME).a |
64 | -rm -f $(TEMPLATEDIR)/bios.* $(TEMPLATEDIR)/$(LIBNAME).a |
| 65 | 65 | ||
| 66 | .PHONY: lst |
66 | .PHONY: lst |
| Line 70... | Line 70... | ||
| 70 | $(OBJDUMP) -h -S $< > $@ |
70 | $(OBJDUMP) -h -S $< > $@ |
| 71 | 71 | ||
| 72 | $(PRG).elf: $(PRG)_pass1.elf |
72 | $(PRG).elf: $(PRG)_pass1.elf |
| 73 | @echo Linking pass 2: Optimizing flash usage |
73 | @echo Linking pass 2: Optimizing flash usage |
| 74 | @rm -f $(PRG)_pass1.elf |
74 | @rm -f $(PRG)_pass1.elf |
| 75 |
|
75 | @$(MAKE) BIOS_START=$(shell awk '/0x[0-9a-f]+.*__bios_optimal_start/ { print $$1 }' bios.map) $(PRG)_pass1.elf |
| 76 |
|
76 | @mv $(PRG)_pass1.elf $(PRG).elf |
| 77 | 77 | ||
| 78 | $(LIBNAME).S: $(PRG).elf |
78 | $(LIBNAME).S: $(PRG).elf |
| 79 | @echo Generating $@ |
79 | @echo Generating $@ |
| 80 | @awk '$$1 ~ /0x[0-9a-f]+/ && /BIOS_/ { print "\t.set "$$2","$$1"\n\t.global "$$2 }' $(PRG).map > $@ |
80 | @awk '$$1 ~ /0x[0-9a-f]+/ && /BIOS_/ { print "\t.set "$$2","$$1"\n\t.global "$$2 }' $(PRG).map > $@ |
| 81 | 81 | ||
| Line 115... | Line 115... | ||
| 115 | 115 | ||
| 116 | # Rules for uploading rom images to flash |
116 | # Rules for uploading rom images to flash |
| 117 | 117 | ||
| 118 | install: hex |
118 | install: hex |
| 119 | $(UPLOAD) $(ULFLAGS) |
119 | $(UPLOAD) $(ULFLAGS) |
| - | 120 | ||
| - | 121 | reinstall: hex |
|
| - | 122 | $(OBJCOPY) -I ihex -O ihex --change-addresses=-$(shell awk '/0x[0-9a-f]+.*__bios_optimal_start/ { print $$1 }' bios.map) bios.hex bios_offset.hex |
|
| - | 123 | $(CANMANAGER) $(CANMANFLAGS) -n $(NODE_ID) -u bios_offset.hex --flashcopy 0,$(shell awk '/0x[0-9a-f]+.*__bios_optimal_start/ { print $$1 }' bios.map),$(shell awk '/0x[0-9a-f]+.*__bios_size/ { print $$1 }' bios.map) |
|
| 120 | 124 | ||
| 121 | # Rules for building the eeprom images |
125 | # Rules for building the eeprom images |
| 122 | 126 | ||
| 123 | eeprom: ehex |
127 | eeprom: ehex |
| 124 | 128 | ||