mcu_base/libs/stm32f30x.mk

35 lines
1.2 KiB
Makefile

# The processor!
MCU_CORE=cm4
# Set up include paths
MCU_INCLUDE += -I$(LIBDIR)/CMSIS/Device/ST/STM32F30x/Include
MCU_INCLUDE += -I$(LIBDIR)/STM32F30x_StdPeriph_Driver/inc
# Set up CFLAGS
MATH_CPPFLAGS += -D__FPU_PRESENT=1
MCU_CPPFLAGS += -D"assert_param(expr)=((void)0)"
MCU_CFLAGS += -mcpu=cortex-m4 -mthumb -Wa,-mthumb
MCU_CXXFLAGS += -mcpu=cortex-m4 -mthumb -Wa,-mthumb
# CMSIS
STARTUP_OBJS = $(LIBDIR)/CMSIS/Device/ST/STM32F30x/Source/Templates/system_stm32f30x.o $(LIBDIR)/startup_$(MCU).o
# Standard Peripheral Library
STM32F30x_OBJSR = stm32f30x_misc.o stm32f30x_dma.o stm32f30x_rcc.o \
stm32f30x_adc.o stm32f30x_exti.o \
stm32f30x_can.o stm32f30x_flash.o stm32f30x_rtc.o \
stm32f30x_gpio.o stm32f30x_spi.o \
stm32f30x_syscfg.o stm32f30x_tim.o stm32f30x_usart.o \
stm32f30x_dac.o stm32f30x_i2c.o stm32f30x_wwdg.o \
stm32f30x_dbgmcu.o stm32f30x_iwdg.o \
stm32f30x_pwr.o stm32f30x_opamp.o stm32f30x_fmc.o stm32f30x_hrtim.o
STM32F30x_OBJS += $(addprefix $(LIBDIR)/STM32F30x_StdPeriph_Driver/src/,$(STM32F30x_OBJSR))
# Bookkeeping
MCU_LIBS_OBJS += $(STM32F30x_OBJS)
# Build Rules
$(LIBDIR)/startup_$(MCU).o: $(LIBDIR)/CMSIS/Device/ST/STM32F30x/Source/Templates/gcc_ride7/startup_$(MCU).s
@$(E) " AS " $@
$(Q)$(AS) -c -o $@ $<