Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: jkj@emperor.netman.dk (Jens Kjerte)
Subject: Re: Makefile question
Date: 1997/04/08	[thread overview]
Message-ID: <5ictfa$1bs$1@tinderbox.netman.dk> (raw)
In-Reply-To: 334529E7.41C6@gsfc.nasa.gov


Liyun Wang (Liyun.Wang.1@gsfc.nasa.gov) wrote:
: Hi,

: I am writing a Makefile in which I need to "extract" file names without
: directory paths from a target list which contains list of files with
: full directory path: e.g.

: FLIST = /usr/local/bin/file1 /usr/local/bin/file2 /usr/local/bin/file3
: ...
: $(FLIST):
: 	# Make macro AAA, from $@, which contains only file1, etc.

: How do I extract file1, file2, etc., from $@ or any of internal macros
: to form new marco AAA to be used in later part of my Makefile? I tried 

: $(FLIST):
: 	AAA=`echo $@ | sed -e "s|/usr/local/bin/||"`
: 	echo $(AAA)

: but it did not work. If any of you could help, I would greatly
: appreciate it.

Digital Unix make supports the F suffix, which applies to the filename
part of the variable. In your case it could be used as:

$(FLIST):
	echo ${@F}


Hope this is what you needed.


--
Jens Kjerte 					E-mail: jkj@netman.dk
NetMan A/S					Phone:  +45 39664020
Vandtaarnsvej 77				Fax:	+45 39660675
2860 Soeborg



      reply	other threads:[~1997-04-08  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-04  5:00 Makefile question Liyun Wang
1997-04-08  4:00 ` Jens Kjerte [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox