Move lpc43xx and lpc43xx_m0 code to lpc43xx/ hierarchy

Previously there were nasty dependency issues causing M4 objects to be
linked into the M0 library
This commit is contained in:
Ben Gamari 2013-06-12 11:21:24 -04:00 committed by Piotr Esden-Tempski
parent 16424d1c69
commit 17fd708f66
8 changed files with 15 additions and 37 deletions

View File

@ -35,7 +35,7 @@ SHAREDIR := $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
INSTALL := install
SRCLIBDIR:= $(realpath lib)
TARGETS:= stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx lpc43xx_m0 lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam/3x sam/3n
TARGETS:= stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx/m4 lpc43xx/m0 lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam/3x sam/3n
# Be silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)

View File

@ -25,45 +25,18 @@ PREFIX ?= arm-none-eabi
#PREFIX ?= arm-elf
CC = $(PREFIX)-gcc
AR = $(PREFIX)-ar
CFLAGS = -O2 -g3 -Wall -Wextra -I../../include -fno-common \
CFLAGS = -O2 -g3 -Wall -Wextra -I../../../include -fno-common \
-mcpu=cortex-m0 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD
# ARFLAGS = rcsv
ARFLAGS = rcs
# LPC43xx common files for M4 / M0
OBJ_LPC43XX = gpio.o scu.o i2c.o ssp.o nvic.o uart.o
OBJ_LPC43XX = gpio.o scu.o i2c.o ssp.o uart.o
#LPC43xx M0 specific file + Generic LPC43xx M4/M0 files
OBJS = vector.o $(OBJ_LPC43XX)
OBJS = $(OBJ_LPC43XX)
# VPATH += ../usb
# Be silent per default, but 'make V=1' will show all compiler calls.
ifneq ($(V),1)
Q := @
endif
all: $(LIBNAME).a
$(LIBNAME).a: $(OBJS)
@printf " AR $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(AR) $(ARFLAGS) $@ $^
%.o: %.c
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
%.o: ../lpc43xx/%.c
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
clean:
@printf " CLEAN lib/lpc43xx_m0\n"
$(Q)rm -f *.o *.d
$(Q)rm -f $(LIBNAME).a
.PHONY: clean
-include $(OBJS:.o=.d)
VPATH += ../:../../cm3
include ../../Makefile.include

View File

View File

@ -29,14 +29,19 @@ CFLAGS = -O2 -g3 \
-Wall -Wextra -Wimplicit-function-declaration \
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \
-Wundef -Wshadow \
-I../../include -fno-common \
-I../../../include -fno-common \
-mcpu=cortex-m4 -mthumb -Wstrict-prototypes \
-ffunction-sections -fdata-sections -MD \
-mfloat-abi=hard -mfpu=fpv4-sp-d16 -DLPC43XX
# ARFLAGS = rcsv
ARFLAGS = rcs
OBJS = gpio.o vector.o scu.o i2c.o ssp.o nvic.o systick.o uart.o ipc.o
VPATH += ../cm3
# LPC43xx common files for M4 / M0
OBJ_LPC43XX = gpio.o scu.o i2c.o ssp.o uart.o
include ../Makefile.include
#LPC43xx M4 specific file + Generic LPC43xx M4/M0 files
OBJS = $(OBJ_LPC43XX) ipc.o
VPATH += ../:../../cm3
include ../../Makefile.include