This brings in an implementation of some general matrix manipulation routines, not all of which are used at teh moment. Output the DCM on the UART at 50Hz for the host to display it usefully.
48 lines
1010 B
Makefile
48 lines
1010 B
Makefile
# Makefile
|
|
|
|
NAME=quad
|
|
|
|
SSRCS=crt0.s
|
|
CSRCS=main.c i2c.c wmp.c timer.c interrupt.c uart.c event.c matrix.c dcm.c
|
|
|
|
COPTIM?=-O1
|
|
CFLAGS=-march=armv4t -msoft-float $(COPTIM) -Wall -Werror -Wextra
|
|
|
|
LDSCRIPT=lpc2103_flash.ld
|
|
CC=arm-elf-gcc
|
|
OBJCOPY=arm-elf-objcopy
|
|
|
|
CLEANOBJS=$(OBJS) $(NAME).hex $(NAME).elf $(NAME).bin $(NAME).map .depend
|
|
|
|
all: $(NAME).bin
|
|
|
|
|
|
# In theory, nothing below here needs touching for as long as all of the
|
|
# sources are in a single directory.
|
|
|
|
COBJS=$(CSRCS:.c=.o)
|
|
SOBJS=$(SSRCS:.s=.o)
|
|
OBJS=$(SOBJS) $(COBJS)
|
|
|
|
.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)
|
|
|
|
depend:
|
|
$(CC) -MM $(CFLAGS) -nostdlib -nostartfiles $(CSRCS) >.depend
|
|
|
|
.sinclude ".depend"
|