concatenating a string variable in a Makefile
In a textbook* example of a Makefile there was a construction which
simplifies to:
package = jupiter
version = 1.0
distdir = $(package)-$(version)
Then later in the Makefile the value $(distdir) is used both in rules and
in commands.
The Makefile does not work but it can be made to work like this:
# package = jupiter
# version = 1.0
distdir = jupiter-1.0
The last line is clearly what was intended. I have just commented out the
preliminaries.
So: How do you concatenate?
I have tried many experiments and have also tried to find the answer in
the GNU make manual, the man page, the info page, and by online reading of
parts of another book about make.
*FYI the textbook is "Autotools" by John Calcote. The example is listing
2-12 -- the first one I actually tried.
No comments:
Post a Comment