X-Git-Url: http://git.asbjorn.biz/?p=rapper.git;a=blobdiff_plain;f=bitbucket_lpc1768%2FMakefile;fp=bitbucket_lpc1768%2FMakefile;h=348e0bec6a023fd428e74d0d8c661fb1655b6d93;hp=0000000000000000000000000000000000000000;hb=4c765357d3685985fea2c360e681025c772e0472;hpb=81d357a0d5a52c468daa3b088028b04eb8b25db5 diff --git a/bitbucket_lpc1768/Makefile b/bitbucket_lpc1768/Makefile new file mode 100644 index 0000000..348e0be --- /dev/null +++ b/bitbucket_lpc1768/Makefile @@ -0,0 +1,76 @@ +# Copyright (c) 2008-2010 Jakub Piotr Cłapa +# This program is released under the new BSD license. +ARCH = /home/asbjorn/dev/armchain/arm-none-eabi/bin/arm-none-eabi +MBED_VOLUME = /Volumes/MBED + +# Tool definitions +CC = $(ARCH)-gcc +LD = $(ARCH)-ld +AR = $(ARCH)-ar +AS = $(ARCH)-as +CP = $(ARCH)-objcopy +OD = $(ARCH)-objdump +SIZE = $(ARCH)-size +RM = rm +Q = @./quiet "$@" + +# Flags +CFLAGS = -W -Wall -Os --std=gnu99 -fgnu89-inline -mcpu=cortex-m3 -mthumb +CFLAGS += -ffunction-sections -fdata-sections +ASFLAGS = +LDFLAGS = --gc-sections +CPFLAGS = +ODFLAGS = -x --syms +PRFLAGS ?= + +# Source files +LINKER_SCRIPT = LPC1768-flash.ld +CSRCS = startup.c $(wildcard CMSIS/*.c) +CSRCS += main.c +ASRCS = + + +OBJS = $(CSRCS:.c=.o) $(ASRCS:.s=.o) + +.PHONY: all size clean nuke + +all: main.bin main.hex + +isp: main.bin + @./quiet $< cp $^ $(MBED_VOLUME)/ + +size: main.elf + @$(SIZE) $< + +%.hex: %.elf + $Q $(CP) $(CPFLAGS) -O ihex $< $*.hex + +%.bin: %.elf + $Q $(CP) $(CPFLAGS) -O binary $< $*.bin + +main.elf: $(LINKER_SCRIPT) $(OBJS) + $Q $(LD) -Map $(@:.elf=.map) $(LDFLAGS) -T $^ -o $@ + $Q $(OD) $(ODFLAGS) $@ > $(@:.elf=.dump) + @$(SIZE) $@ + +%.o: %.c + @$(CC) -MM $< -MF $*.d -MP + $Q $(CC) -c $(CFLAGS) $< -o $@ + +%.o: %.S + $Q $(AS) $(ASFLAGS) $< -o $@ + +io-pin.h: io-pin.ss + $Q mzscheme $< > $@ + +clean: + @-rm -f *.elf quiet.log + @-\ +for D in "." "**"; do \ + rm -f $$D/*.o $$D/*.d $$D/*.lst $$D/*.dump $$D/*.map; \ +done + +nuke: clean + -rm -f *.hex *.bin + +-include $(CSRCS:.c=.d)