\r
\r
# MCU name\r
+ifneq ($(USE_USB),)\r
MCU = at90usb1287\r
-\r
+else\r
+MCU = atmega2560\r
+endif\r
\r
# Target architecture (see library "Board Types" documentation).\r
ARCH = AVR8\r
# Create the LUFA source path variables by including the LUFA root makefile\r
include $(LUFA_PATH)/LUFA/makefile\r
\r
-\r
-# List C source files here. (C dependencies are automatically generated.)\r
+ifneq ($(USE_USB),)\r
SRC = \\r
$(TARGET).c \\r
Descriptors.c \\r
$(LUFA_SRC_USB) \\r
$(LUFA_SRC_USBCLASS) \\r
+ DualVirtualSerial.c\r
+endif\r
+\r
+# List C source files here. (C dependencies are automatically generated.)\r
+SRC += \\r
cirbuf_add_buf_head.c \\r
cirbuf_add_buf_tail.c \\r
cirbuf_add_head.c \\r
cirbuf_get_buf_tail.c \\r
cirbuf_get_head.c \\r
cirbuf_get_tail.c \\r
- cmdline.c \\r
commands.c \\r
commands_gen.c \\r
- Descriptors.c \\r
- DualVirtualSerial.c \\r
main.c \\r
rc_proto.c \\r
parse.c \\r
parse_neighbor.c \\r
parse_atcmd.c \\r
parse_monitor.c \\r
- time.c\r
+ time.c \\r
+ cmdline.c\r
\r
# List C++ source files here. (C dependencies are automatically generated.)\r
CPPSRC =\r
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))\r
CFLAGS += $(CSTANDARD)\r
CFLAGS += -std=gnu99\r
+ifneq ($(USE_USB),)\r
+CFLAGS += -DUSE_USB\r
+endif\r
\r
\r
#---------------- Compiler Options C++ ----------------\r
LDFLAGS += $(EXTMEMOPTS)\r
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))\r
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)\r
-#LDFLAGS += -T linker_script.x\r
-\r
+ifeq ($(USE_USB),)\r
+LDFLAGS = -T avr6.x\r
+endif\r
\r
\r
#---------------- Programming Options (avrdude) ----------------\r
%.hex: %.elf\r
@echo\r
@echo $(MSG_FLASH) $@\r
+ $(OBJCOPY) -O binary -R .eeprom -R .fuse -R .lock $< $(TARGET).bin\r
$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@\r
\r
%.eep: %.elf\r