Makefile: Add linker script as dependency for linking step
This commit is contained in:
parent
86ba94a3f3
commit
fa20304df8
@ -14,6 +14,7 @@ LIBRARIES = -larm_cortexM4lf_math -lm
|
|||||||
|
|
||||||
DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4 -DHSE_VALUE=8000000UL
|
DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4 -DHSE_VALUE=8000000UL
|
||||||
MAPFILE_BASE = memory-mapping
|
MAPFILE_BASE = memory-mapping
|
||||||
|
LINKER_SCRIPT=stm32f407vet6_flash.ld
|
||||||
|
|
||||||
export GIT_VER = $(shell git describe --always --dirty --tags)
|
export GIT_VER = $(shell git describe --always --dirty --tags)
|
||||||
DEFINES += -DGIT_VER=$(GIT_VER)
|
DEFINES += -DGIT_VER=$(GIT_VER)
|
||||||
@ -89,7 +90,7 @@ endif
|
|||||||
|
|
||||||
LFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
LFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
||||||
LFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 --disable-newlib-supplied-syscalls -nostartfiles
|
LFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 --disable-newlib-supplied-syscalls -nostartfiles
|
||||||
LFLAGS += -Tstm32f407vet6_flash.ld -Wl,-Map=$(MAPFILE).map -Wl,--print-memory-usage
|
LFLAGS += -T$(LINKER_SCRIPT) -Wl,-Map=$(MAPFILE).map -Wl,--print-memory-usage
|
||||||
|
|
||||||
CFLAGS += -c -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
CFLAGS += -c -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
||||||
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles
|
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles
|
||||||
@ -116,9 +117,9 @@ debug:
|
|||||||
$(QUIET)$(OBJCOPY) -O ihex $^ $@
|
$(QUIET)$(OBJCOPY) -O ihex $^ $@
|
||||||
|
|
||||||
#Linking
|
#Linking
|
||||||
$(target).elf: $(OBJ) $(ASOBJ)
|
$(target).elf: $(OBJ) $(ASOBJ) $(LINKER_SCRIPT)
|
||||||
@echo [LD] $@
|
@echo [LD] $@
|
||||||
$(QUIET)$(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $^ $(LIBRARIES)
|
$(QUIET)$(CC) $(LFLAGS) $(LIBRARYPATH) -o $@ $(OBJ) $(ASOBJ) $(LIBRARIES)
|
||||||
$(QUIET)$(SIZE) $@
|
$(QUIET)$(SIZE) $@
|
||||||
@echo "Built Version $(GIT_VER)"
|
@echo "Built Version $(GIT_VER)"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user