jw-pkg/make/mcu-exe.mk
Jan Lindemann df6c1ef9a1 make, tmpl/tagged: Add basic microcontroller support
Add support for building the firmware of the Cortex M3 ST-NUCLEO-F103RB
development board with an STM32 microcontroller. This commit add some hooks,
notably support for tagged templates, but adds lots of crap, too, notably
makefiles and variables that should have different names and / or
functionality.

New makefiles are: Mcu-defs.mk  mcu-exe.mk  mcu-flash.mk  mcu-tags.mk
mcu-topdir.mk tagged-tmpl.mk, a new directory is tmpl/tagged.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-06 12:19:42 +00:00

22 lines
673 B
Makefile

DIR_BASENAME = $(notdir $(CWD))
ifeq ($(EXE_BASENAME),)
ifneq ($(DIR_BASENAME),test)
EXE_BASENAME = $(DIR_BASENAME).elf
else
EXE_BASENAME = test-$(notdir $(shell cd ..; $(PWD))).elf
endif
endif
MCU_FLASH_PUSH_FILE_HEX ?= $(patsubst %.elf,%.hex,$(EXE_BASENAME))
EXE_MAP ?= $(patsubst %.elf,%.map,$(EXE_BASENAME))
PROJECT_LDFLAGS += -static
LD_DEFINE_SYMBOLS += _sbrk
PROJECT_LDFLAGS += $(addprefix -u ,$(LD_DEFINE_SYMBOLS))
include $(MODDIR)/make/mcu-defs.mk
include $(MODDIR)/make/exe.mk
include $(MODDIR)/make/mcu-flash.mk
all: $(MCU_FLASH_PUSH_FILE_HEX)