|
From: | gmake |
Subject: | Re: (no subject) |
Date: | Tue, 8 Aug 2006 10:00:22 -0500 (CDT) |
Dear GNU make experts, Do you know whydefault: g=$(basename file.ext); \ /bin/echo g=$$g;produces "g=file", whiledefault: f=file.ext; \ g=$(basename $$f); \ /bin/echo g=$$g;"g=file.ext". How to extract the basename of $f in the second case? Thank you in advence, Val.
It needs another $: ... g=$$(basename $$f); \ ... So that it gets passed to the shell as $(basename $f). $(basename ...) is GNU make's basename function, while you want the Unix basename and command-substitution, which is $$(basename ...). Thanks, Lee
[Prev in Thread] | Current Thread | [Next in Thread] |