* Makefile question
@ 1997-04-04 5:00 Liyun Wang
1997-04-05 5:00 ` !@?*$%
0 siblings, 1 reply; 2+ messages in thread
From: Liyun Wang @ 1997-04-04 5:00 UTC (permalink / raw)
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.
Thanks in advance!
Liyun
PS. My OS is DEC OSF/1 V3.2 (Rev. 214).
--
==================================================================
Liyun Wang | FAX: 301-286-0264
G1 Building 26, SOHO EAF | Voice: 301-286-3126
NASA, GSFC, Code 682.3 | Liyun.Wang.1@gsfc.nasa.gov
Greenbelt, MD 20771 | http://orpheus.nascom.nasa.gov/~lwang
==================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Makefile question
1997-04-04 5:00 Makefile question Liyun Wang
@ 1997-04-05 5:00 ` !@?*$%
0 siblings, 0 replies; 2+ messages in thread
From: !@?*$% @ 1997-04-05 5:00 UTC (permalink / raw)
> 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
You don't. make macros are static can't be redefined by commands within
the makefile. If you seriously needed to do this, you can do cascaded
makefiles:
$(FLIST):
AAA=`...` $(MAKE) $(MAKEFLAGS) target
Thus make calls make, and in the second call, the value of the environment
variable AAA is available as a make macro.
--
The fire surges, fills his veins; | S M Ryan, Cupertino CA
the red and black, the blaspheme reigns. | mail to: smryan@mail.com
With flash and spark, he flails dark, | Sais-moi rien?
and curses phantom cavern banes. | I don't use no smileys.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-04-05 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-04-04 5:00 Makefile question Liyun Wang
1997-04-05 5:00 ` !@?*$%
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox