2 PLATFORM ?= arm-none-eabi
5 LDFLAGS=--gc-sections -g -T $(BPATH)/flash.ld
6 CFLAGS=-W -Wall --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -I$(BPATH) -I. -g
9 # objects are separated by space
10 USB_OBJS=usb/serial.o usb/core.o usb/desc.o usb/hw.o usb/user.o usb/vcom.o usb/cdcuser.o
11 BOARD_OBJS=$(BPATH)/startup.o $(BPATH)/system.o boards/cortex_m3/core_cm3.o
12 OBJECTS=main.o $(BOARD_OBJS) $(USB_OBJS)
17 $(PROJECT).elf: $(OBJECTS)
18 $(PLATFORM)-ld -Map $(PROJECT).map $(LDFLAGS) $(OBJECTS) -o $@
21 $(PLATFORM)-objcopy -O binary $< $*.bin
24 $(PLATFORM)-gcc -MM $< -MF $(patsubst %.o,%.d,$@) -MP
25 $(PLATFORM)-gcc $(CFLAGS) -c $< -o $@
30 rm -f $(PROJECT).elf $(OBJECTS) $(OBJECTS:.o=.d) $(PROJECT).map
33 $(PLATFORM)-gdb $(PROJECT).elf
36 ../tools/lpcrc/lpcrc.sh $(PROJECT).bin $(BPATH)/startup.c