diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - TARGET:=therm TOOLCHAIN_PATH:=/usr/bin TOOLCHAIN_PREFIX:=arm-none-eabi @@ -6,20 +5,29 @@ OPTLVL:=3 # Optimization level, can be [ #PROJECT_NAME:=$(notdir $(lastword $(CURDIR))) TOP:=$(shell readlink -f "../..") -STMLIB:=libraries -OLEDDRV:=oleddrv -USBDRV:=USB -STD_PERIPH:=$(STMLIB)/STM32F0xx_StdPeriph_Driver +LIBDIR:=libraries + +HAL_LIB:=$(LIBDIR)/STM32F0xx_HAL_Driver +USB_LIB:=$(LIBDIR)/STM32_USB_Device_Library + STARTUP:=$(STMLIB)/CMSIS/Device/ST/STM32F0xx/Source/Templates/gcc_ride7 + LINKER_SCRIPT:=$(CURDIR)/stm32-flash.ld -#LINKER_SCRIPT:=$(CURDIR)/../stm32_flash.ld +# Local libs INCLUDE=-I$(CURDIR) -INCLUDE+=-I$(STMLIB)/CMSIS/Include -INCLUDE+=-I$(STMLIB)/CMSIS/Device/ST/STM32F0xx/Include -INCLUDE+=-I$(STD_PERIPH)/inc -INCLUDE+=-I$(STMLIB)/$(OLEDDRV) -INCLUDE+=-I$(STMLIB)/$(USBDRV) + +# CMSIS +INCLUDE+=-I$(LIBDIR)/CMSIS/Include +INCLUDE+=-I$(LIBDIR)/CMSIS/Device/ST/STM32F0xx/Include + +# USB +INCLUDE+=-I$(USB_LIB)/Class/CDC +INCLUDE+=-I$(USB_LIB)/Core + +# HAL +INCLUDE+=-I$(HAL_LIB)/Inc + # vpath is used so object files are written to the current directory instead # of the same directory as their source files