aboutsummaryrefslogtreecommitdiff
path: root/rules.mk
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-06-26 15:55:45 +0900
committertmk <nobody@nowhere>2012-06-26 15:55:45 +0900
commitdd93d2915f79d0b825fc6bbc4edb556a69eac406 (patch)
tree2a2980c5069385562ba017261cc43d861d882f7b /rules.mk
parent76033dcd892a115240c5a990e5643cd53acbca87 (diff)
downloadqmk_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.mk31
1 files changed, 29 insertions, 2 deletions
diff --git a/rules.mk b/rules.mk
index 104031fbb..060f660c9 100644
--- a/rules.mk
+++ b/rules.mk
@@ -109,8 +109,10 @@ CFLAGS += -O$(OPT)
109CFLAGS += -funsigned-char 109CFLAGS += -funsigned-char
110CFLAGS += -funsigned-bitfields 110CFLAGS += -funsigned-bitfields
111CFLAGS += -ffunction-sections 111CFLAGS += -ffunction-sections
112CFLAGS += -fno-inline-small-functions
112CFLAGS += -fpack-struct 113CFLAGS += -fpack-struct
113CFLAGS += -fshort-enums 114CFLAGS += -fshort-enums
115CFLAGS += -fno-strict-aliasing
114CFLAGS += -Wall 116CFLAGS += -Wall
115CFLAGS += -Wstrict-prototypes 117CFLAGS += -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#
232LDFLAGS = -Wl,-Map=$(TARGET).map,--cref 234LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
233#LDFLAGS += -Wl,--relax 235LDFLAGS += -Wl,--relax
234LDFLAGS += -Wl,--gc-sections 236LDFLAGS += -Wl,--gc-sections
235LDFLAGS += $(EXTMEMOPTS) 237LDFLAGS += $(EXTMEMOPTS)
236LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) 238LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -387,6 +389,30 @@ gccversion :
387program: $(TARGET).hex $(TARGET).eep 389program: $(TARGET).hex $(TARGET).eep
388 $(PROGRAM_CMD) 390 $(PROGRAM_CMD)
389 391
392teensy: $(TARGET).hex
393 teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
394
395flip: $(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
400dfu: $(TARGET).hex
401 dfu-programmer $(MCU) erase
402 dfu-programmer $(MCU) flash $(TARGET).hex
403 dfu-programmer $(MCU) reset
404
405flip-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
412dfu-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