Dmitry преди 8 години
родител
ревизия
cd35d0f397
променени са 1 файла, в които са добавени 9 реда и са изтрити 9 реда
  1. 9 9
      Makefile

+ 9 - 9
Makefile

@@ -1,4 +1,6 @@
-CMSIS       ?=../../cmsis
+CMSIS       ?=../../CMSIS
+CMSISDEV     = $(CMSIS)/Device/ST
+CMSISINC     = $(CMSIS)/Include
 FLASH       ?= st-flash
 TOOLSET     ?= arm-none-eabi-
 CC           = $(TOOLSET)gcc
@@ -7,17 +9,17 @@ AR           = $(TOOLSET)gcc-ar
 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
 DEFINES.stm32l052x8  = STM32L0 STM32L052xx
 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
 DEFINES.stm32l100xc  = STM32L1 STM32L100xC
 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
 DEFINES.stm32l476rg  = STM32L4 STM32L476xx
 LDSCRIPT.stm32l476rg = demo/stm32l476xg.ld
@@ -35,7 +37,7 @@ MODULE      ?= libusb_stm32.a
 CFLAGS      ?= $(CFLAGS.$(MCU))
 CFLAGS2      = -mthumb -Os -std=gnu99
 DEFINES     ?= $(DEFINES.$(MCU)) FORCE_C_DRIVER
-INCLUDES    ?= $(CMSIS)/device/ST $(CMSIS)/include .
+INCLUDES    ?= $(CMSISDEV) $(CMSISINC) .
 SOURCES      = $(wildcard src/*.c) $(wildcard src/*.S)
 OBJECTS      = $(addsuffix .o, $(basename $(SOURCES)))
 ARFLAGS     ?= -cvq
@@ -48,12 +50,10 @@ else
 	fixpath = $(strip $1)
 endif
 
-
-
 program: $(DOUT).hex
 	$(FLASH) --reset --format ihex write $(DOUT).hex
 
-demo: clean $(DOUT).hex
+demo: $(DOUT).hex
 
 $(DOUT).hex : $(DOUT).elf
 	@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 $@
 
 clean:
-	$(RM) $(DOUT).*
+	$(RM) $(DOUT).* $(OBJECTS)
 
 doc:
 	doxygen