diff options
Diffstat (limited to 'tmk_core/rules.mk')
| -rw-r--r-- | tmk_core/rules.mk | 220 |
1 files changed, 11 insertions, 209 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index f8f77e892..96eba24d6 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk | |||
| @@ -20,26 +20,11 @@ | |||
| 20 | # Output format. (can be srec, ihex, binary) | 20 | # Output format. (can be srec, ihex, binary) |
| 21 | FORMAT = ihex | 21 | FORMAT = ihex |
| 22 | 22 | ||
| 23 | BUILD_DIR = .build | ||
| 24 | |||
| 25 | # Object files directory | ||
| 26 | # To put object files in current directory, use a dot (.), do NOT make | ||
| 27 | # this an empty or blank macro! | ||
| 28 | OBJDIR = $(BUILD_DIR)/obj_$(TARGET) | ||
| 29 | |||
| 30 | |||
| 31 | # Optimization level, can be [0, 1, 2, 3, s]. | 23 | # Optimization level, can be [0, 1, 2, 3, s]. |
| 32 | # 0 = turn off optimization. s = optimize for size. | 24 | # 0 = turn off optimization. s = optimize for size. |
| 33 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) | 25 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
| 34 | OPT = s | 26 | OPT = s |
| 35 | 27 | ||
| 36 | |||
| 37 | # Debugging format. | ||
| 38 | # Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. | ||
| 39 | # AVR Studio 4.10 requires dwarf-2. | ||
| 40 | # AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. | ||
| 41 | DEBUG = dwarf-2 | ||
| 42 | |||
| 43 | COLOR ?= true | 28 | COLOR ?= true |
| 44 | 29 | ||
| 45 | ifeq ($(COLOR),true) | 30 | ifeq ($(COLOR),true) |
| @@ -87,7 +72,7 @@ BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ | |||
| 87 | # Each directory must be seperated by a space. | 72 | # Each directory must be seperated by a space. |
| 88 | # Use forward slashes for directory separators. | 73 | # Use forward slashes for directory separators. |
| 89 | # For a directory that has spaces, enclose it in quotes. | 74 | # For a directory that has spaces, enclose it in quotes. |
| 90 | EXTRAINCDIRS = $(subst :, ,$(VPATH)) | 75 | EXTRAINCDIRS += $(subst :, ,$(VPATH)) |
| 91 | 76 | ||
| 92 | 77 | ||
| 93 | # Compiler flag to set the C Standard level. | 78 | # Compiler flag to set the C Standard level. |
| @@ -99,17 +84,14 @@ CSTANDARD = -std=gnu99 | |||
| 99 | 84 | ||
| 100 | 85 | ||
| 101 | # Place -D or -U options here for C sources | 86 | # Place -D or -U options here for C sources |
| 102 | CDEFS = -DF_CPU=$(F_CPU)UL | ||
| 103 | CDEFS += $(OPT_DEFS) | 87 | CDEFS += $(OPT_DEFS) |
| 104 | 88 | ||
| 105 | 89 | ||
| 106 | # Place -D or -U options here for ASM sources | 90 | # Place -D or -U options here for ASM sources |
| 107 | ADEFS = -DF_CPU=$(F_CPU) | ||
| 108 | ADEFS += $(OPT_DEFS) | 91 | ADEFS += $(OPT_DEFS) |
| 109 | 92 | ||
| 110 | 93 | ||
| 111 | # Place -D or -U options here for C++ sources | 94 | # Place -D or -U options here for C++ sources |
| 112 | CPPDEFS = -DF_CPU=$(F_CPU)UL | ||
| 113 | #CPPDEFS += -D__STDC_LIMIT_MACROS | 95 | #CPPDEFS += -D__STDC_LIMIT_MACROS |
| 114 | #CPPDEFS += -D__STDC_CONSTANT_MACROS | 96 | #CPPDEFS += -D__STDC_CONSTANT_MACROS |
| 115 | CPPDEFS += $(OPT_DEFS) | 97 | CPPDEFS += $(OPT_DEFS) |
| @@ -123,17 +105,9 @@ CPPDEFS += $(OPT_DEFS) | |||
| 123 | # -Wall...: warning level | 105 | # -Wall...: warning level |
| 124 | # -Wa,...: tell GCC to pass this to the assembler. | 106 | # -Wa,...: tell GCC to pass this to the assembler. |
| 125 | # -adhlns...: create assembler listing | 107 | # -adhlns...: create assembler listing |
| 126 | CFLAGS = -g$(DEBUG) | 108 | CFLAGS += -g$(DEBUG) |
| 127 | CFLAGS += $(CDEFS) | 109 | CFLAGS += $(CDEFS) |
| 128 | CFLAGS += -O$(OPT) | 110 | CFLAGS += -O$(OPT) |
| 129 | CFLAGS += -funsigned-char | ||
| 130 | CFLAGS += -funsigned-bitfields | ||
| 131 | CFLAGS += -ffunction-sections | ||
| 132 | CFLAGS += -fdata-sections | ||
| 133 | CFLAGS += -fno-inline-small-functions | ||
| 134 | CFLAGS += -fpack-struct | ||
| 135 | CFLAGS += -fshort-enums | ||
| 136 | CFLAGS += -fno-strict-aliasing | ||
| 137 | # add color | 111 | # add color |
| 138 | ifeq ($(COLOR),true) | 112 | ifeq ($(COLOR),true) |
| 139 | ifeq ("$(shell echo "int main(){}" | $(CC) -fdiagnostics-color -x c - -o /dev/null 2>&1)", "") | 113 | ifeq ("$(shell echo "int main(){}" | $(CC) -fdiagnostics-color -x c - -o /dev/null 2>&1)", "") |
| @@ -162,16 +136,9 @@ endif | |||
| 162 | # -Wall...: warning level | 136 | # -Wall...: warning level |
| 163 | # -Wa,...: tell GCC to pass this to the assembler. | 137 | # -Wa,...: tell GCC to pass this to the assembler. |
| 164 | # -adhlns...: create assembler listing | 138 | # -adhlns...: create assembler listing |
| 165 | CPPFLAGS = -g$(DEBUG) | 139 | CPPFLAGS += -g$(DEBUG) |
| 166 | CPPFLAGS += $(CPPDEFS) | 140 | CPPFLAGS += $(CPPDEFS) |
| 167 | CPPFLAGS += -O$(OPT) | 141 | CPPFLAGS += -O$(OPT) |
| 168 | CPPFLAGS += -funsigned-char | ||
| 169 | CPPFLAGS += -funsigned-bitfields | ||
| 170 | CPPFLAGS += -fpack-struct | ||
| 171 | CPPFLAGS += -fshort-enums | ||
| 172 | CPPFLAGS += -fno-exceptions | ||
| 173 | CPPFLAGS += -ffunction-sections | ||
| 174 | CPPFLAGS += -fdata-sections | ||
| 175 | # to supress "warning: only initialized variables can be placed into program memory area" | 142 | # to supress "warning: only initialized variables can be placed into program memory area" |
| 176 | CPPFLAGS += -w | 143 | CPPFLAGS += -w |
| 177 | CPPFLAGS += -Wall | 144 | CPPFLAGS += -Wall |
| @@ -198,7 +165,7 @@ endif | |||
| 198 | # files -- see avr-libc docs [FIXME: not yet described there] | 165 | # files -- see avr-libc docs [FIXME: not yet described there] |
| 199 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex | 166 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex |
| 200 | # dump that will be displayed for a given single line of source input. | 167 | # dump that will be displayed for a given single line of source input. |
| 201 | ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 | 168 | ASFLAGS += $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 |
| 202 | ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) | 169 | ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) |
| 203 | ifdef CONFIG_H | 170 | ifdef CONFIG_H |
| 204 | ASFLAGS += -include $(CONFIG_H) | 171 | ASFLAGS += -include $(CONFIG_H) |
| @@ -232,28 +199,6 @@ SCANF_LIB = | |||
| 232 | MATH_LIB = -lm | 199 | MATH_LIB = -lm |
| 233 | 200 | ||
| 234 | 201 | ||
| 235 | # List any extra directories to look for libraries here. | ||
| 236 | # Each directory must be seperated by a space. | ||
| 237 | # Use forward slashes for directory separators. | ||
| 238 | # For a directory that has spaces, enclose it in quotes. | ||
| 239 | EXTRALIBDIRS = | ||
| 240 | |||
| 241 | |||
| 242 | |||
| 243 | #---------------- External Memory Options ---------------- | ||
| 244 | |||
| 245 | # 64 KB of external RAM, starting after internal RAM (ATmega128!), | ||
| 246 | # used for variables (.data/.bss) and heap (malloc()). | ||
| 247 | #EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff | ||
| 248 | |||
| 249 | # 64 KB of external RAM, starting after internal RAM (ATmega128!), | ||
| 250 | # only used for heap (malloc()). | ||
| 251 | #EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff | ||
| 252 | |||
| 253 | EXTMEMOPTS = | ||
| 254 | |||
| 255 | |||
| 256 | |||
| 257 | #---------------- Linker Options ---------------- | 202 | #---------------- Linker Options ---------------- |
| 258 | # -Wl,...: tell GCC to pass this to linker. | 203 | # -Wl,...: tell GCC to pass this to linker. |
| 259 | # -Map: create map file | 204 | # -Map: create map file |
| @@ -262,9 +207,8 @@ EXTMEMOPTS = | |||
| 262 | # Comennt out "--relax" option to avoid a error such: | 207 | # Comennt out "--relax" option to avoid a error such: |
| 263 | # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' | 208 | # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' |
| 264 | # | 209 | # |
| 265 | LDFLAGS = -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref | 210 | LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref |
| 266 | #LDFLAGS += -Wl,--relax | 211 | #LDFLAGS += -Wl,--relax |
| 267 | LDFLAGS += -Wl,--gc-sections | ||
| 268 | LDFLAGS += $(EXTMEMOPTS) | 212 | LDFLAGS += $(EXTMEMOPTS) |
| 269 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | 213 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) |
| 270 | LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | 214 | LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) |
| @@ -272,59 +216,13 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) | |||
| 272 | # You can give EXTRALDFLAGS at 'make' command line. | 216 | # You can give EXTRALDFLAGS at 'make' command line. |
| 273 | LDFLAGS += $(EXTRALDFLAGS) | 217 | LDFLAGS += $(EXTRALDFLAGS) |
| 274 | 218 | ||
| 275 | |||
| 276 | |||
| 277 | #---------------- Debugging Options ---------------- | ||
| 278 | |||
| 279 | # For simulavr only - target MCU frequency. | ||
| 280 | DEBUG_MFREQ = $(F_CPU) | ||
| 281 | |||
| 282 | # Set the DEBUG_UI to either gdb or insight. | ||
| 283 | # DEBUG_UI = gdb | ||
| 284 | DEBUG_UI = insight | ||
| 285 | |||
| 286 | # Set the debugging back-end to either avarice, simulavr. | ||
| 287 | DEBUG_BACKEND = avarice | ||
| 288 | #DEBUG_BACKEND = simulavr | ||
| 289 | |||
| 290 | # GDB Init Filename. | ||
| 291 | GDBINIT_FILE = __avr_gdbinit | ||
| 292 | |||
| 293 | # When using avarice settings for the JTAG | ||
| 294 | JTAG_DEV = /dev/com1 | ||
| 295 | |||
| 296 | # Debugging port used to communicate between GDB / avarice / simulavr. | ||
| 297 | DEBUG_PORT = 4242 | ||
| 298 | |||
| 299 | # Debugging host used to communicate between GDB / avarice / simulavr, normally | ||
| 300 | # just set to localhost unless doing some sort of crazy debugging when | ||
| 301 | # avarice is running on a different computer. | ||
| 302 | DEBUG_HOST = localhost | ||
| 303 | |||
| 304 | |||
| 305 | |||
| 306 | #============================================================================ | ||
| 307 | |||
| 308 | |||
| 309 | # Define programs and commands. | 219 | # Define programs and commands. |
| 310 | SHELL = sh | 220 | SHELL = sh |
| 311 | CC = avr-gcc | ||
| 312 | OBJCOPY = avr-objcopy | ||
| 313 | OBJDUMP = avr-objdump | ||
| 314 | SIZE = avr-size | ||
| 315 | AR = avr-ar rcs | ||
| 316 | NM = avr-nm | ||
| 317 | REMOVE = rm -f | 221 | REMOVE = rm -f |
| 318 | REMOVEDIR = rmdir | 222 | REMOVEDIR = rmdir |
| 319 | COPY = cp | 223 | COPY = cp |
| 320 | WINSHELL = cmd | 224 | WINSHELL = cmd |
| 321 | SECHO = $(SILENT) || echo | 225 | SECHO = $(SILENT) || echo |
| 322 | # Autodecct teensy loader | ||
| 323 | ifneq (, $(shell which teensy-loader-cli 2>/dev/null)) | ||
| 324 | TEENSY_LOADER_CLI = teensy-loader-cli | ||
| 325 | else | ||
| 326 | TEENSY_LOADER_CLI = teensy_loader_cli | ||
| 327 | endif | ||
| 328 | 226 | ||
| 329 | # Define Messages | 227 | # Define Messages |
| 330 | # English | 228 | # English |
| @@ -347,8 +245,6 @@ MSG_CLEANING = Cleaning project: | |||
| 347 | MSG_CREATING_LIBRARY = Creating library: | 245 | MSG_CREATING_LIBRARY = Creating library: |
| 348 | 246 | ||
| 349 | 247 | ||
| 350 | |||
| 351 | |||
| 352 | # Define all object files. | 248 | # Define all object files. |
| 353 | OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) | 249 | OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) |
| 354 | 250 | ||
| @@ -364,9 +260,9 @@ GENDEPFLAGS = -MMD -MP -MF $(BUILD_DIR)/.dep/$(subst /,_,$@).d | |||
| 364 | # Combine all necessary flags and optional flags. | 260 | # Combine all necessary flags and optional flags. |
| 365 | # Add target processor to flags. | 261 | # Add target processor to flags. |
| 366 | # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar | 262 | # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar |
| 367 | ALL_CFLAGS = -mmcu=$(MCU) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) | 263 | ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) |
| 368 | ALL_CPPFLAGS = -mmcu=$(MCU) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) | 264 | ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) |
| 369 | ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) | 265 | ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) |
| 370 | 266 | ||
| 371 | # Default target. | 267 | # Default target. |
| 372 | all: | 268 | all: |
| @@ -432,104 +328,10 @@ sizeafter: | |||
| 432 | gccversion : | 328 | gccversion : |
| 433 | @$(SILENT) || $(CC) --version | 329 | @$(SILENT) || $(CC) --version |
| 434 | 330 | ||
| 435 | |||
| 436 | |||
| 437 | # Program the device. | ||
| 438 | program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep | ||
| 439 | $(PROGRAM_CMD) | ||
| 440 | |||
| 441 | teensy: $(BUILD_DIR)/$(TARGET).hex | ||
| 442 | $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex | ||
| 443 | |||
| 444 | flip: $(BUILD_DIR)/$(TARGET).hex | ||
| 445 | batchisp -hardware usb -device $(MCU) -operation erase f | ||
| 446 | batchisp -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program | ||
| 447 | batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||
| 448 | |||
| 449 | dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter | ||
| 450 | ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) | ||
| 451 | dfu-programmer $(MCU) erase --force | ||
| 452 | else | ||
| 453 | dfu-programmer $(MCU) erase | ||
| 454 | endif | ||
| 455 | dfu-programmer $(MCU) flash $(BUILD_DIR)/$(TARGET).hex | ||
| 456 | dfu-programmer $(MCU) reset | ||
| 457 | |||
| 458 | dfu-start: | ||
| 459 | dfu-programmer $(MCU) reset | ||
| 460 | dfu-programmer $(MCU) start | ||
| 461 | |||
| 462 | flip-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep | ||
| 463 | $(COPY) $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET)eep.hex | ||
| 464 | batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase | ||
| 465 | batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(BUILD_DIR)/$(TARGET)eep.hex program | ||
| 466 | batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||
| 467 | $(REMOVE) $(BUILD_DIR)/$(TARGET)eep.hex | ||
| 468 | |||
| 469 | dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep | ||
| 470 | ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) | ||
| 471 | dfu-programmer $(MCU) flash --eeprom $(BUILD_DIR)/$(TARGET).eep | ||
| 472 | else | ||
| 473 | dfu-programmer $(MCU) flash-eeprom $(BUILD_DIR)/$(TARGET).eep | ||
| 474 | endif | ||
| 475 | dfu-programmer $(MCU) reset | ||
| 476 | |||
| 477 | |||
| 478 | # Generate avr-gdb config/init file which does the following: | ||
| 479 | # define the reset signal, load the target file, connect to target, and set | ||
| 480 | # a breakpoint at main(). | ||
| 481 | gdb-config: | ||
| 482 | @$(REMOVE) $(GDBINIT_FILE) | ||
| 483 | @echo define reset >> $(GDBINIT_FILE) | ||
| 484 | @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) | ||
| 485 | @echo end >> $(GDBINIT_FILE) | ||
| 486 | @echo file $(BUILD_DIR)/$(TARGET).elf >> $(GDBINIT_FILE) | ||
| 487 | @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) | ||
| 488 | ifeq ($(DEBUG_BACKEND),simulavr) | ||
| 489 | @echo load >> $(GDBINIT_FILE) | ||
| 490 | endif | ||
| 491 | @echo break main >> $(GDBINIT_FILE) | ||
| 492 | |||
| 493 | debug: gdb-config $(BUILD_DIR)/$(TARGET).elf | ||
| 494 | ifeq ($(DEBUG_BACKEND), avarice) | ||
| 495 | @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. | ||
| 496 | @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ | ||
| 497 | $(BUILD_DIR)/$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) | ||
| 498 | @$(WINSHELL) /c pause | ||
| 499 | |||
| 500 | else | ||
| 501 | @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ | ||
| 502 | $(DEBUG_MFREQ) --port $(DEBUG_PORT) | ||
| 503 | endif | ||
| 504 | @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) | ||
| 505 | |||
| 506 | |||
| 507 | |||
| 508 | |||
| 509 | # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. | ||
| 510 | COFFCONVERT = $(OBJCOPY) --debugging | ||
| 511 | COFFCONVERT += --change-section-address .data-0x800000 | ||
| 512 | COFFCONVERT += --change-section-address .bss-0x800000 | ||
| 513 | COFFCONVERT += --change-section-address .noinit-0x800000 | ||
| 514 | COFFCONVERT += --change-section-address .eeprom-0x810000 | ||
| 515 | |||
| 516 | |||
| 517 | |||
| 518 | coff: $(BUILD_DIR)/$(TARGET).elf | ||
| 519 | @$(SECHO) $(MSG_COFF) $(BUILD_DIR)/$(TARGET).cof | ||
| 520 | $(COFFCONVERT) -O coff-avr $< $(BUILD_DIR)/$(TARGET).cof | ||
| 521 | |||
| 522 | |||
| 523 | extcoff: $(BUILD_DIR)/$(TARGET).elf | ||
| 524 | @$(SECHO) $(MSG_EXTENDED_COFF) $(BUILD_DIR)/$(TARGET).cof | ||
| 525 | $(COFFCONVERT) -O coff-ext-avr $< $(BUILD_DIR)/$(TARGET).cof | ||
| 526 | |||
| 527 | |||
| 528 | |||
| 529 | # Create final output files (.hex, .eep) from ELF output file. | 331 | # Create final output files (.hex, .eep) from ELF output file. |
| 530 | %.hex: %.elf | 332 | %.hex: %.elf |
| 531 | @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) | 333 | @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) |
| 532 | $(eval CMD=$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@) | 334 | $(eval CMD=$(HEX) $< $@) |
| 533 | @$(BUILD_CMD) | 335 | @$(BUILD_CMD) |
| 534 | @if $(AUTOGEN); then \ | 336 | @if $(AUTOGEN); then \ |
| 535 | $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(KEYBOARD)_$(KEYMAP).hex\n"; \ | 337 | $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(KEYBOARD)_$(KEYMAP).hex\n"; \ |
| @@ -540,7 +342,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf | |||
| 540 | 342 | ||
| 541 | %.eep: %.elf | 343 | %.eep: %.elf |
| 542 | @$(SILENT) || printf "$(MSG_EEPROM) $@" | $(AWK_CMD) | 344 | @$(SILENT) || printf "$(MSG_EEPROM) $@" | $(AWK_CMD) |
| 543 | $(eval CMD=$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0) | 345 | $(eval CMD=$(EEP) $< $@ || exit 0) |
| 544 | @$(BUILD_CMD) | 346 | @$(BUILD_CMD) |
| 545 | 347 | ||
| 546 | # Create extended listing file from ELF output file. | 348 | # Create extended listing file from ELF output file. |
| @@ -622,7 +424,7 @@ show_path: | |||
| 622 | @echo VPATH=$(VPATH) | 424 | @echo VPATH=$(VPATH) |
| 623 | @echo SRC=$(SRC) | 425 | @echo SRC=$(SRC) |
| 624 | 426 | ||
| 625 | SUBDIRS := $(filter-out %/util/ %/doc/ %/keymaps/ %/old_keymap_files/,$(dir $(wildcard $(TOP_DIR)/keyboards/**/*/.))) | 427 | SUBDIRS := $(filter-out %/util/ %/doc/ %/keymaps/ %/old_keymap_files/,$(dir $(wildcard $(TOP_DIR)/keyboards/**/*/Makefile))) |
| 626 | SUBDIRS := $(SUBDIRS) $(dir $(wildcard $(TOP_DIR)/keyboards/*/.)) | 428 | SUBDIRS := $(SUBDIRS) $(dir $(wildcard $(TOP_DIR)/keyboards/*/.)) |
| 627 | SUBDIRS := $(sort $(SUBDIRS)) | 429 | SUBDIRS := $(sort $(SUBDIRS)) |
| 628 | # $(error $(SUBDIRS)) | 430 | # $(error $(SUBDIRS)) |
