Say I have a makefile called Foo, and it has a variable called Bar.in Foo I have:Bar := /some/initial/pathOther_var := ${Bar}/more/pathsand then in my main makefile I use Fooinclude Path/to/FooBut How can I make it such in my main makefile I can set Bar and have my value of Bar be the one used in Foo? I tried using eval but the := is a real challenge. A big goal is to not change the source of Foo.
Override a := in another makefile
make
My GNU make 4.0 online info says if you use the override keyword on an assignment, normally used to override command line var=value settings, then the value will not be changed by further assignments which do not use the override keyword.So you could try in your main makefile:override Bar := myvalueforbarinclude Path/to/Foo