I am trying to implement a non-recursive make build system in my current project. What I'm struggling with is areas of variables. The target specific variables do not meet my needs, as often the variables determine the goals, not the preconditions. What I need:
Makefile1:
SOMEVAR := original_value include Makefile2 $(warning $(SOMEVAR))
Makefile2:
#some magic here to do what I want and make me happy SOMEVAR := included_value
And the result that I want is "original_value".
Are there any strategies to make it real?
EDIT: The only solution I have made so far is to force and organize myself to put all inlcudes at the end of each specific Makefile and use the immediate variable assignment: =
makefile gnu-make
Alexander Reshytko
source share