Initial checkin. Basic build and runtime environment, prior to first
test on actual hardware.
This commit is contained in:
38
Makefile
Normal file
38
Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
# Makefile
|
||||
|
||||
NAME=quad
|
||||
|
||||
OBJS=crt0.o main.o
|
||||
|
||||
CFLAGS=-march=armv4t -msoft-float
|
||||
|
||||
LDSCRIPT=lpc2103_flash.ld
|
||||
CC=arm-elf-gcc
|
||||
OBJCOPY=arm-elf-objcopy
|
||||
|
||||
CLEANOBJS=$(OBJS) $(NAME).hex $(NAME).elf $(NAME).bin $(NAME).map
|
||||
|
||||
all: $(NAME).bin
|
||||
|
||||
|
||||
# In theory, nothing below here needs touching for as long as all of the
|
||||
# sources are in a single directory.
|
||||
|
||||
|
||||
.SUFFIXES: .elf .hex .bin
|
||||
|
||||
$(NAME).elf: $(OBJS)
|
||||
$(CC) $(CFLAGS) -nostdlib -nostartfiles -T $(LDSCRIPT) -Wl,-Map -Wl,$(NAME).map -o $(NAME).elf $(OBJS) -lgcc
|
||||
|
||||
run: $(NAME).hex
|
||||
$(FLASHER) -hex -term -control $(NAME).hex $(PORT) $(SPEED) $(OSC)
|
||||
|
||||
.elf.hex:
|
||||
$(OBJCOPY) -O ihex ${.IMPSRC} ${.TARGET}
|
||||
|
||||
.hex.bin:
|
||||
$(OBJCOPY) -I ihex -O binary ${.IMPSRC} ${.TARGET}
|
||||
|
||||
clean:
|
||||
rm -rf $(CLEANOBJS)
|
||||
|
||||
Reference in New Issue
Block a user