X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=makefile;h=51feddd9b32a399bef7d3588b3c1273ec352f671;hp=5360008fdf10ffa1098721df5964b332e3ce5435;hb=0e1c93804369af27043c82ccc778c42bf54a9bd4;hpb=1a0d8b2d8fb17cf4b2c845c52b22dc932efa080b diff --git a/makefile b/makefile index 5360008..51feddd 100644 --- a/makefile +++ b/makefile @@ -61,8 +61,11 @@ # MCU name +ifneq ($(USE_USB),) MCU = at90usb1287 - +else +MCU = atmega2560 +endif # Target architecture (see library "Board Types" documentation). ARCH = AVR8 @@ -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 include $(LUFA_PATH)/LUFA/makefile - -# List C source files here. (C dependencies are automatically generated.) +ifneq ($(USE_USB),) SRC = \ $(TARGET).c \ Descriptors.c \ $(LUFA_SRC_USB) \ $(LUFA_SRC_USBCLASS) \ + DualVirtualSerial.c +endif + +# List C source files here. (C dependencies are automatically generated.) +SRC += \ cirbuf_add_buf_head.c \ cirbuf_add_buf_tail.c \ cirbuf_add_head.c \ @@ -152,11 +159,8 @@ SRC = \ cirbuf_get_buf_tail.c \ cirbuf_get_head.c \ cirbuf_get_tail.c \ - cmdline.c \ commands.c \ commands_gen.c \ - Descriptors.c \ - DualVirtualSerial.c \ main.c \ rc_proto.c \ parse.c \ @@ -231,7 +235,8 @@ SRC = \ parse_neighbor.c \ parse_atcmd.c \ parse_monitor.c \ - time.c + time.c \ + cmdline.c # List C++ source files here. (C dependencies are automatically generated.) CPPSRC = @@ -327,6 +332,9 @@ CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) CFLAGS += $(CSTANDARD) CFLAGS += -std=gnu99 +ifneq ($(USE_USB),) +CFLAGS += -DUSE_USB +endif #---------------- Compiler Options C++ ---------------- @@ -428,8 +436,9 @@ LDFLAGS += -Wl,--gc-sections LDFLAGS += $(EXTMEMOPTS) LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) -#LDFLAGS += -T linker_script.x - +ifeq ($(USE_USB),) +LDFLAGS = -T avr6.x +endif #---------------- Programming Options (avrdude) ---------------- @@ -694,6 +703,7 @@ extcoff: $(TARGET).elf %.hex: %.elf @echo @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O binary -R .eeprom -R .fuse -R .lock $< $(TARGET).bin $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ %.eep: %.elf