|
|
@@ -26,7 +26,7 @@ DEFINES ?= STM32F1 STM32F103x6
|
|
|
ARFLAGS = -cvq
|
|
|
LDFLAGS = --specs=nano.specs -nostartfiles -Wl,--gc-sections
|
|
|
INCLUDES = $(CMSISDEV)/ST $(CMSISCORE) inc
|
|
|
-CFLAGS2 = -mthumb -std=gnu99 -fshort-wchar $(OPTFLAGS)
|
|
|
+CFLAGS2 ?= $(CFLAGS) -mthumb -std=gnu99 $(OPTFLAGS)
|
|
|
|
|
|
OBJDIR = obj
|
|
|
SOURCES = $(wildcard src/*.c) $(wildcard src/*.S)
|
|
|
@@ -55,9 +55,9 @@ help all:
|
|
|
@echo ' stm32f429xi CDC loopback demo for STM32F429xI based boards'
|
|
|
@echo ' doc DOXYGEN documentation'
|
|
|
@echo ' module static library module using following envars (defaults)'
|
|
|
- @echo ' MODULE module name (libusb.a)'
|
|
|
- @echo ' CFLAGS mcu specified compiler flags (-mcpu=cortex-m3)'
|
|
|
- @echo ' DEFINES mcu and module specified defines (STM32F1 STM32F103x6)'
|
|
|
+ @echo ' MODULE module name ($(MODULE))'
|
|
|
+ @echo ' CFLAGS mcu specified compiler flags ($(CFLAGS))'
|
|
|
+ @echo ' DEFINES mcu and module specified defines ($(DEFINES))'
|
|
|
@echo ' see USB Device HW driver and core API section for the'
|
|
|
@echo ' compile-time control macros'
|
|
|
@echo ' '
|
|
|
@@ -95,7 +95,7 @@ $(DOUT).hex : $(DOUT).elf
|
|
|
|
|
|
$(DOUT).elf : $(OBJDIR) $(DOBJ) $(OBJECTS)
|
|
|
@echo building $@
|
|
|
- @$(LD) $(CFLAGS) $(CFLAGS2) $(LDFLAGS) -Wl,--script='$(LDSCRIPT)' -Wl,-Map=$(DOUT).map $(DOBJ) $(OBJECTS) -o $@
|
|
|
+ @$(LD) $(CFLAGS2) $(LDFLAGS) -Wl,--script='$(LDSCRIPT)' -Wl,-Map=$(DOUT).map $(DOBJ) $(OBJECTS) -o $@
|
|
|
|
|
|
clean:
|
|
|
@$(RM) $(DOUT).*
|
|
|
@@ -104,88 +104,89 @@ clean:
|
|
|
doc:
|
|
|
doxygen
|
|
|
|
|
|
-module: clean $(MODULE)
|
|
|
+module: clean
|
|
|
+ $(MAKE) $(MODULE)
|
|
|
|
|
|
$(MODULE): $(OBJDIR) $(OBJECTS)
|
|
|
@$(AR) $(ARFLAGS) $(MODULE) $(OBJECTS)
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
@echo compiling $<
|
|
|
- @$(CC) $(CFLAGS) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
+ @$(CC) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
|
|
|
$(OBJDIR)/%.o: %.S
|
|
|
@echo assembling $<
|
|
|
- @$(CC) $(CFLAGS) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
+ @$(CC) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
|
|
|
$(OBJDIR)/%.o: %.s
|
|
|
@echo assembling $<
|
|
|
- @$(CC) $(CFLAGS) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
+ @$(CC) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
|
|
|
|
|
|
.PHONY: module doc demo clean program help all program_stcube
|
|
|
|
|
|
-stm32f103x6 bluepill:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103x6.s' \
|
|
|
+stm32f103x6 bluepill: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103x6.s' \
|
|
|
LDSCRIPT='demo/stm32f103x6.ld' \
|
|
|
DEFINES='STM32F1 STM32F103x6 USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m3 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m3'
|
|
|
|
|
|
-stm32f303xe 32f303re-nucleo:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xe.s' \
|
|
|
+stm32f303xe 32f303re-nucleo: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f303xe.s' \
|
|
|
LDSCRIPT='demo/stm32f303xe.ld' \
|
|
|
DEFINES='STM32F3 STM32F303xE USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m4 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m4'
|
|
|
|
|
|
|
|
|
-stm32f105xb:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f105xc.s' \
|
|
|
+stm32f105xb: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f105xc.s' \
|
|
|
LDSCRIPT='demo/stm32f105xb.ld' \
|
|
|
DEFINES='STM32F1 STM32F105xC USBD_VBUS_DETECT USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m3 -mthumb -Wp,-w'
|
|
|
+ CFLAGS='-mcpu=cortex-m3 -Wp,-w'
|
|
|
|
|
|
-stm32f107xb:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f107xc.s' \
|
|
|
+stm32f107xb: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f107xc.s' \
|
|
|
LDSCRIPT='demo/stm32f105xb.ld' \
|
|
|
DEFINES='STM32F1 STM32F107xC HSE_25MHZ USBD_VBUS_DETECT USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m3 -mthumb -Wp,-w'
|
|
|
+ CFLAGS='-mcpu=cortex-m3 -Wp,-w'
|
|
|
|
|
|
-stm32l052x8:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32L0xx/Source/Templates/gcc/startup_stm32l052xx.s' \
|
|
|
+stm32l052x8: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32L0xx/Source/Templates/gcc/startup_stm32l052xx.s' \
|
|
|
LDSCRIPT='demo/stm32l052x8.ld' \
|
|
|
DEFINES='STM32L0 STM32L052xx USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m0plus -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m0plus'
|
|
|
|
|
|
-stm32l100xc 32l100c-disco:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32L1xx/Source/Templates/gcc/startup_stm32l100xc.s' \
|
|
|
+stm32l100xc 32l100c-disco: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32L1xx/Source/Templates/gcc/startup_stm32l100xc.s' \
|
|
|
LDSCRIPT='demo/stm32l100xc.ld' \
|
|
|
DEFINES='STM32L1 STM32L100xC USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m3 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m3'
|
|
|
|
|
|
-stm32l476xg 32l476rg-nucleo:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l476xx.s' \
|
|
|
+stm32l476xg 32l476rg-nucleo: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l476xx.s' \
|
|
|
LDSCRIPT='demo/stm32l476xg.ld' \
|
|
|
DEFINES='STM32L4 STM32L476xx USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m4 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m4'
|
|
|
|
|
|
-stm32f429xi 32f429zi-nucleo:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s' \
|
|
|
+stm32f429xi 32f429zi-nucleo: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s' \
|
|
|
LDSCRIPT='demo/stm32f429xi.ld' \
|
|
|
DEFINES='STM32F4 STM32F429xx USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m4 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m4'
|
|
|
|
|
|
-stm32f429xi_hs 32f429zi-nucleo_hs:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s' \
|
|
|
+stm32f429xi_hs 32f429zi-nucleo_hs: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s' \
|
|
|
LDSCRIPT='demo/stm32f429xi.ld' \
|
|
|
DEFINES='STM32F4 STM32F429xx USBD_PRIMARY_OTGHS USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m4 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m4'
|
|
|
|
|
|
-stm32l433cc:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l433xx.s' \
|
|
|
+stm32l433cc: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l433xx.s' \
|
|
|
LDSCRIPT='demo/stm32l433xc.ld' \
|
|
|
DEFINES='STM32L4 STM32L433xx USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m4 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m4'
|
|
|
|
|
|
-stm32f070xb:
|
|
|
- @$(MAKE) clean demo STARTUP='$(CMSISDEV)/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f070xb.s' \
|
|
|
+stm32f070xb: clean
|
|
|
+ @$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F0xx/Source/Templates/gcc/startup_stm32f070xb.s' \
|
|
|
LDSCRIPT='demo/stm32f070xb.ld' \
|
|
|
DEFINES='STM32F0 STM32F070xB USBD_SOF_DISABLED' \
|
|
|
- CFLAGS='-mcpu=cortex-m0 -mthumb'
|
|
|
+ CFLAGS='-mcpu=cortex-m0'
|