开发者

makefile link dir/file name

In my pr开发者_如何学Gooject for daily build we storing its library to its version name dir. .

for latest one we are creating symbolic link as a 'LATEST'. ex.-

ls -ltr
drw-r--r-- 1 4096 2010-02-10 16:34 abc7.2.0
drw-r--r-- 1 4096 2010-02-10 16:34 abc7.2.1
drw-r--r-- 1 4096 2010-02-10 16:34 abc7.2.2
drw-r--r-- 1 4096 2010-02-10 16:34 abc7.2.3
lrwxrwxrwx 1    8 2010-02-10 16:34 LATEST -> abc7.2.3

Now, In makefile, I want to get dir. name to which LATEST is linking to?

Thanks in advance. :-)


You can used shell's functionality to get link values. In shell you might type

$ readlink LATEST
abc7.2.3

So in makefile you can just invoke shell command to get the actual value. This will store the link target to value variable.

value=$(shell readlink LATEST)

Note that it doesn't work relatively to working dir, but, rather, to the directory the symlink is in.

I also reckon a question with link-related issues; it may be useful for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜