diff options
| author | tmk <nobody@nowhere> | 2012-06-26 15:55:45 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2012-06-26 15:55:45 +0900 |
| commit | dd93d2915f79d0b825fc6bbc4edb556a69eac406 (patch) | |
| tree | 2a2980c5069385562ba017261cc43d861d882f7b /rules.mk | |
| parent | 76033dcd892a115240c5a990e5643cd53acbca87 (diff) | |
| download | qmk_firmware-dd93d2915f79d0b825fc6bbc4edb556a69eac406.tar.gz qmk_firmware-dd93d2915f79d0b825fc6bbc4edb556a69eac406.zip | |
initial attempt for LUFA.
Add keyboard/lufa macway keyobard with LUFA.
Add new program target to rule.mk; flip, dfu and teensy
Diffstat (limited to 'rules.mk')
| -rw-r--r-- | rules.mk | 31 |
1 files changed, 29 insertions, 2 deletions
| @@ -109,8 +109,10 @@ CFLAGS += -O$(OPT) | |||
| 109 | CFLAGS += -funsigned-char | 109 | CFLAGS += -funsigned-char |
| 110 | CFLAGS += -funsigned-bitfields | 110 | CFLAGS += -funsigned-bitfields |
| 111 | CFLAGS += -ffunction-sections | 111 | CFLAGS += -ffunction-sections |
| 112 | CFLAGS += -fno-inline-small-functions | ||
| 112 | CFLAGS += -fpack-struct | 113 | CFLAGS += -fpack-struct |
| 113 | CFLAGS += -fshort-enums | 114 | CFLAGS += -fshort-enums |
| 115 | CFLAGS += -fno-strict-aliasing | ||
| 114 | CFLAGS += -Wall | 116 | CFLAGS += -Wall |
| 115 | CFLAGS += -Wstrict-prototypes | 117 | CFLAGS += -Wstrict-prototypes |
| 116 | #CFLAGS += -mshort-calls | 118 | #CFLAGS += -mshort-calls |
| @@ -230,7 +232,7 @@ EXTMEMOPTS = | |||
| 230 | # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' | 232 | # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12' |
| 231 | # | 233 | # |
| 232 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref | 234 | LDFLAGS = -Wl,-Map=$(TARGET).map,--cref |
| 233 | #LDFLAGS += -Wl,--relax | 235 | LDFLAGS += -Wl,--relax |
| 234 | LDFLAGS += -Wl,--gc-sections | 236 | LDFLAGS += -Wl,--gc-sections |
| 235 | LDFLAGS += $(EXTMEMOPTS) | 237 | LDFLAGS += $(EXTMEMOPTS) |
| 236 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) | 238 | LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) |
| @@ -387,6 +389,30 @@ gccversion : | |||
| 387 | program: $(TARGET).hex $(TARGET).eep | 389 | program: $(TARGET).hex $(TARGET).eep |
| 388 | $(PROGRAM_CMD) | 390 | $(PROGRAM_CMD) |
| 389 | 391 | ||
| 392 | teensy: $(TARGET).hex | ||
| 393 | teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex | ||
| 394 | |||
| 395 | flip: $(TARGET).hex | ||
| 396 | batchisp -hardware usb -device $(MCU) -operation erase f | ||
| 397 | batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program | ||
| 398 | batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||
| 399 | |||
| 400 | dfu: $(TARGET).hex | ||
| 401 | dfu-programmer $(MCU) erase | ||
| 402 | dfu-programmer $(MCU) flash $(TARGET).hex | ||
| 403 | dfu-programmer $(MCU) reset | ||
| 404 | |||
| 405 | flip-ee: $(TARGET).hex $(TARGET).eep | ||
| 406 | $(COPY) $(TARGET).eep $(TARGET)eep.hex | ||
| 407 | batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase | ||
| 408 | batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program | ||
| 409 | batchisp -hardware usb -device $(MCU) -operation start reset 0 | ||
| 410 | $(REMOVE) $(TARGET)eep.hex | ||
| 411 | |||
| 412 | dfu-ee: $(TARGET).hex $(TARGET).eep | ||
| 413 | dfu-programmer $(MCU) eeprom-flash $(TARGET).eep | ||
| 414 | dfu-programmer $(MCU) reset | ||
| 415 | |||
| 390 | 416 | ||
| 391 | # Generate avr-gdb config/init file which does the following: | 417 | # Generate avr-gdb config/init file which does the following: |
| 392 | # define the reset signal, load the target file, connect to target, and set | 418 | # define the reset signal, load the target file, connect to target, and set |
| @@ -488,6 +514,7 @@ extcoff: $(TARGET).elf | |||
| 488 | # Compile: create object files from C source files. | 514 | # Compile: create object files from C source files. |
| 489 | $(OBJDIR)/%.o : %.c | 515 | $(OBJDIR)/%.o : %.c |
| 490 | @echo | 516 | @echo |
| 517 | mkdir -p $(@D) | ||
| 491 | @echo $(MSG_COMPILING) $< | 518 | @echo $(MSG_COMPILING) $< |
| 492 | $(CC) -c $(ALL_CFLAGS) $< -o $@ | 519 | $(CC) -c $(ALL_CFLAGS) $< -o $@ |
| 493 | 520 | ||
| @@ -538,7 +565,7 @@ clean_list : | |||
| 538 | $(REMOVE) $(OBJ:.o=.s) | 565 | $(REMOVE) $(OBJ:.o=.s) |
| 539 | $(REMOVE) $(OBJ:.o=.i) | 566 | $(REMOVE) $(OBJ:.o=.i) |
| 540 | $(REMOVE) -r .dep | 567 | $(REMOVE) -r .dep |
| 541 | $(REMOVEDIR) $(OBJDIR) | 568 | $(REMOVE) -r $(OBJDIR) |
| 542 | 569 | ||
| 543 | 570 | ||
| 544 | # Create object files directory | 571 | # Create object files directory |
