I'm kinda stuck here. We have two makefiles (a requirement that I cannot change)
- defs.mk: contains the names of the source files and their additional flag compilation (except for standard flags), for example:
C_FILES = c / src / main / rule_main.c
rule_main_OPTIONAL_FLAG = + w127
rule_main_DEBUG = TRUE
Makefile: It contains all the rules.
Now I want to add a tool so that I can define flags for specific files (and an additional debug flag for a specific file) as in:
CUSTOM_DEBUG_FLAG = $($(basename $(notdir $@))_DEBUG)
ifeq ($(CUSTOM_DEBUG_FLAG),TRUE)
do something
endif
But this does not work, because the extension of automatic variables is not supported in conditional expressions. Is there any other way to do this?
source
share