diff --git a/Makefile b/Makefile index 96d11de6..0eaa8cf2 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/lib/lpc43xx_m0/Makefile b/lib/lpc43xx/m0/Makefile similarity index 63% rename from lib/lpc43xx_m0/Makefile rename to lib/lpc43xx/m0/Makefile index 9104f559..2995c96f 100644 --- a/lib/lpc43xx_m0/Makefile +++ b/lib/lpc43xx/m0/Makefile @@ -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 diff --git a/lib/lpc43xx/m0/libopencm3_lpc43xx_m0.ld b/lib/lpc43xx/m0/libopencm3_lpc43xx_m0.ld new file mode 100644 index 00000000..e69de29b diff --git a/lib/lpc43xx_m0/libopencm3_lpc43xx_ram_only_m0.ld b/lib/lpc43xx/m0/libopencm3_lpc43xx_ram_only_m0.ld similarity index 100% rename from lib/lpc43xx_m0/libopencm3_lpc43xx_ram_only_m0.ld rename to lib/lpc43xx/m0/libopencm3_lpc43xx_ram_only_m0.ld diff --git a/lib/lpc43xx/Makefile b/lib/lpc43xx/m4/Makefile similarity index 83% rename from lib/lpc43xx/Makefile rename to lib/lpc43xx/m4/Makefile index 92aa2d2e..c396d67a 100644 --- a/lib/lpc43xx/Makefile +++ b/lib/lpc43xx/m4/Makefile @@ -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 diff --git a/lib/lpc43xx/libopencm3_lpc43xx.ld b/lib/lpc43xx/m4/libopencm3_lpc43xx.ld similarity index 100% rename from lib/lpc43xx/libopencm3_lpc43xx.ld rename to lib/lpc43xx/m4/libopencm3_lpc43xx.ld diff --git a/lib/lpc43xx/libopencm3_lpc43xx_ram_only.ld b/lib/lpc43xx/m4/libopencm3_lpc43xx_ram_only.ld similarity index 100% rename from lib/lpc43xx/libopencm3_lpc43xx_ram_only.ld rename to lib/lpc43xx/m4/libopencm3_lpc43xx_ram_only.ld diff --git a/lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld b/lib/lpc43xx/m4/libopencm3_lpc43xx_rom_to_ram.ld similarity index 100% rename from lib/lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld rename to lib/lpc43xx/m4/libopencm3_lpc43xx_rom_to_ram.ld