|
@@ -1,4 +1,6 @@
|
|
|
-CMSIS ?=../../cmsis
|
|
|
|
|
|
|
+CMSIS ?=../../CMSIS
|
|
|
|
|
+CMSISDEV = $(CMSIS)/Device/ST
|
|
|
|
|
+CMSISINC = $(CMSIS)/Include
|
|
|
FLASH ?= st-flash
|
|
FLASH ?= st-flash
|
|
|
TOOLSET ?= arm-none-eabi-
|
|
TOOLSET ?= arm-none-eabi-
|
|
|
CC = $(TOOLSET)gcc
|
|
CC = $(TOOLSET)gcc
|
|
@@ -7,17 +9,17 @@ AR = $(TOOLSET)gcc-ar
|
|
|
OBJCOPY = $(TOOLSET)objcopy
|
|
OBJCOPY = $(TOOLSET)objcopy
|
|
|
|
|
|
|
|
|
|
|
|
|
-STARTUP.stm32l052x8 = $(CMSIS)/device/ST/STM32L0xx/Source/Templates/gcc/startup_stm32l052xx.s
|
|
|
|
|
|
|
+STARTUP.stm32l052x8 = $(CMSISDEV)/STM32L0xx/Source/Templates/gcc/startup_stm32l052xx.s
|
|
|
CFLAGS.stm32l052x8 = -mcpu=cortex-m0plus -mfloat-abi=soft
|
|
CFLAGS.stm32l052x8 = -mcpu=cortex-m0plus -mfloat-abi=soft
|
|
|
DEFINES.stm32l052x8 = STM32L0 STM32L052xx
|
|
DEFINES.stm32l052x8 = STM32L0 STM32L052xx
|
|
|
LDSCRIPT.stm32l052x8 = demo/stm32l052x8.ld
|
|
LDSCRIPT.stm32l052x8 = demo/stm32l052x8.ld
|
|
|
|
|
|
|
|
-STARTUP.stm32l100xc = $(CMSIS)/device/ST/STM32L1xx/Source/Templates/gcc/startup_stm32l100xc.s
|
|
|
|
|
|
|
+STARTUP.stm32l100xc = $(CMSISDEV)/STM32L1xx/Source/Templates/gcc/startup_stm32l100xc.s
|
|
|
CFLAGS.stm32l100xc = -mcpu=cortex-m3 -mfloat-abi=soft
|
|
CFLAGS.stm32l100xc = -mcpu=cortex-m3 -mfloat-abi=soft
|
|
|
DEFINES.stm32l100xc = STM32L1 STM32L100xC
|
|
DEFINES.stm32l100xc = STM32L1 STM32L100xC
|
|
|
LDSCRIPT.stm32l100xc = demo/stm32l100xc.ld
|
|
LDSCRIPT.stm32l100xc = demo/stm32l100xc.ld
|
|
|
|
|
|
|
|
-STARTUP.stm32l476rg = $(CMSIS)/device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l476xx.s
|
|
|
|
|
|
|
+STARTUP.stm32l476rg = $(CMSISDEV)/STM32L4xx/Source/Templates/gcc/startup_stm32l476xx.s
|
|
|
CFLAGS.stm32l476rg = -mcpu=cortex-m4
|
|
CFLAGS.stm32l476rg = -mcpu=cortex-m4
|
|
|
DEFINES.stm32l476rg = STM32L4 STM32L476xx
|
|
DEFINES.stm32l476rg = STM32L4 STM32L476xx
|
|
|
LDSCRIPT.stm32l476rg = demo/stm32l476xg.ld
|
|
LDSCRIPT.stm32l476rg = demo/stm32l476xg.ld
|
|
@@ -35,7 +37,7 @@ MODULE ?= libusb_stm32.a
|
|
|
CFLAGS ?= $(CFLAGS.$(MCU))
|
|
CFLAGS ?= $(CFLAGS.$(MCU))
|
|
|
CFLAGS2 = -mthumb -Os -std=gnu99
|
|
CFLAGS2 = -mthumb -Os -std=gnu99
|
|
|
DEFINES ?= $(DEFINES.$(MCU)) FORCE_C_DRIVER
|
|
DEFINES ?= $(DEFINES.$(MCU)) FORCE_C_DRIVER
|
|
|
-INCLUDES ?= $(CMSIS)/device/ST $(CMSIS)/include .
|
|
|
|
|
|
|
+INCLUDES ?= $(CMSISDEV) $(CMSISINC) .
|
|
|
SOURCES = $(wildcard src/*.c) $(wildcard src/*.S)
|
|
SOURCES = $(wildcard src/*.c) $(wildcard src/*.S)
|
|
|
OBJECTS = $(addsuffix .o, $(basename $(SOURCES)))
|
|
OBJECTS = $(addsuffix .o, $(basename $(SOURCES)))
|
|
|
ARFLAGS ?= -cvq
|
|
ARFLAGS ?= -cvq
|
|
@@ -48,12 +50,10 @@ else
|
|
|
fixpath = $(strip $1)
|
|
fixpath = $(strip $1)
|
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
program: $(DOUT).hex
|
|
program: $(DOUT).hex
|
|
|
$(FLASH) --reset --format ihex write $(DOUT).hex
|
|
$(FLASH) --reset --format ihex write $(DOUT).hex
|
|
|
|
|
|
|
|
-demo: clean $(DOUT).hex
|
|
|
|
|
|
|
+demo: $(DOUT).hex
|
|
|
|
|
|
|
|
$(DOUT).hex : $(DOUT).elf
|
|
$(DOUT).hex : $(DOUT).elf
|
|
|
@echo building $@
|
|
@echo building $@
|
|
@@ -64,7 +64,7 @@ $(DOUT).elf : $(DOBJ) $(OBJECTS)
|
|
|
@$(LD) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -Wl,--script='$(LDSCRIPT)' -Wl,-Map=$(DOUT).map $(DOBJ) -lc $(OBJECTS) -o $@
|
|
@$(LD) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -Wl,--script='$(LDSCRIPT)' -Wl,-Map=$(DOUT).map $(DOBJ) -lc $(OBJECTS) -o $@
|
|
|
|
|
|
|
|
clean:
|
|
clean:
|
|
|
- $(RM) $(DOUT).*
|
|
|
|
|
|
|
+ $(RM) $(DOUT).* $(OBJECTS)
|
|
|
|
|
|
|
|
doc:
|
|
doc:
|
|
|
doxygen
|
|
doxygen
|