Przeglądaj źródła

Added `cmsis` target

 Library depends on CMSIS and stm32.h headers but some projects do not require
 this set of headers. Makefile rule for downloading all required dependencies
 may be useful for these projects.

 Use `make cmsis` to get all required dependencies in a $(CMSIS) directory.
Alexander Voronov 6 lat temu
rodzic
commit
ca6499ded5
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      Makefile

+ 8 - 2
Makefile

@@ -1,4 +1,4 @@
-CMSIS       ?=../../CMSIS
+CMSIS       ?= CMSIS
 CMSISDEV    ?= $(CMSIS)/Device
 CMSISCORE   ?= $(CMSIS)/CMSIS/Include $(CMSIS)/CMSIS/Core/Include
 FLASH       ?= st-flash
@@ -53,6 +53,7 @@ help all:
 	@echo '  stm32l052x8   CDC loopback demo for STM32L052x8 based boards'
 	@echo '  32f429zi-nucleo'
 	@echo '  stm32f429xi   CDC loopback demo for STM32F429xI based boards'
+	@echo '  cmsis         Download CMSIS 5 and stm32.h into a $$(CMSIS) directory'
 	@echo '  doc           DOXYGEN documentation'
 	@echo '  module        static library module using following envars (defaults)'
 	@echo '                MODULE  module name ($(MODULE))'
@@ -71,6 +72,11 @@ help all:
 	@echo '  make bluepill program'
 	@echo '  make module MODULE="usbd.a" CFLAGS="-mcpu=cotrex-m4" DEFINES="STM32L4 STM32L476xx USBD_VBUS_DETECT"'
 
+.PHONY: cmsis
+cmsis:
+	@git clone --depth 1 https://github.com/ARM-software/CMSIS_5.git $(CMSIS)
+	@git clone --recurse-submodules --depth 1 https://github.com/dmitrystu/stm32h.git $(CMSISDEV)/ST
+
 $(OBJDIR):
 	@mkdir $@
 
@@ -207,4 +213,4 @@ stm32f373xc: clean
 	@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f373xc.s' \
 						LDSCRIPT='demo/stm32f373xc.ld' \
 						DEFINES='STM32F3 STM32F373xC USBD_SOF_DISABLED USBD_ASM_DRIVER' \
-						CFLAGS='-mcpu=cortex-m4'
+						CFLAGS='-mcpu=cortex-m4'