support lolo's board
[protos/xbee-avr.git] / makefile
index 5360008..51feddd 100644 (file)
--- a/makefile
+++ b/makefile
 \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
@@ -131,13 +134,17 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
 # 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
@@ -152,11 +159,8 @@ SRC = \
        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
@@ -231,7 +235,8 @@ SRC = \
        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
@@ -327,6 +332,9 @@ CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
 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
@@ -428,8 +436,9 @@ LDFLAGS += -Wl,--gc-sections
 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
@@ -694,6 +703,7 @@ extcoff: $(TARGET).elf
 %.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