help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get the current directory name


From: Eric Venditti
Subject: How to get the current directory name
Date: Thu, 05 Apr 2001 11:39:32 -0600

Hi,

I have a general rule to build a program based on a specific directory
structure. if I am in directory "/project/myproj/myprog1" I can build myprog1
and if I am in directory "/project/myproj/myprog2". For amintenance purpose I
want to have a common Makefile and get the target name from the directory name.

using " pwd | awk -F'/' '{print $NF}' " I can get the directory name on the
command line but when I try to do this in make it doesn't work.

In my Makefile I have:

SHEL     = /bin/ksh
MYTARGET = $(shell pwd | awk -F'/' '{print $NF}' )

myrule :
        @echo My target is ${MYTARGET}

What am I doing wrong?

Thanks,
Eric.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]