I am using GNU make version 4.2.1 with an Eclipse framework called 'STM32CubeIDE'. It is structured with targets in sub-directories such as 'Release', 'Debug' and 'bootloader' that have the main makefile. In the directory above, there are optional support files to modify the build behaviour such as,
-include ../makefile.init
# Define lists of source files
-include ../makefile.defs
# Define make variable and rules
-include ../makefile.targets
The above makefile is generated automatically by Java code within the Eclipse/STM32CubeIDE framework.
I have a makefile.defs and I attempt a definition like this,
TYPE=$(strip $(notdir $(CURDIR))) # Debug, Release or bootloader
However, the $(strip) seems to be in-effective. If I apply it directly in a condition, it works.
ifeq ($(strip $(TYPE)),bootloader)
$(info bootloader active)
endif
I don't understand what make facilities would cause this? The purpose of 'TYPE' is to be used in the subsequent makefile.targets to over-ride the linker commands.