I’m experimenting with using variables with makefile and can’t seem to use them consistently.
The following code (in file silly2.mak):
SUBS = src
SSUBS=/src2
SHELL=/bin/sh
silly5:
echo '<<<' $$SUBS '--' $$SSUBS '--' $$SHELL '>>>'
When run with:
me@ubuntu:/usr/local/hsfsys$ make -f silly2.mak silly5
Gives the following output:
echo '<<<' $SUBS '--' $SSUBS '--' $SHELL '>>>'
<<< -- -- /bin/bash >>>
Why does ‘SHELL’ seem to work better than my other variables? Is it some sort of reserved word? I’ve tried moving the order of the variables around and looking at online documentation, but still don’t understand why echo picks up the value of SHELL, but not SUBS or SSUBS.
Try this