On Sun, 3 Feb 2002, Iftach Hyams wrote:
> (After reading the man page, most of the info and some examples)
> Can you please show me the rules to :
> 1. Create a link named "foo.l" for each "foo.a" file. Assume all .a files
> are in the same directory.
> 2. Create a link named "foo.l" for each file ends with f (like "foof").
> Should I use the old fashion or the new GNU fashion ?
> Is there a common solution ?
> Thank you
What about (probably quite gnu-make-spesific[*], and untested):
# maybe you'll have a more direct way to get the lst of files
FOO_A_FILES=$(shell ls *.a)
# This may be wrong, depends where the expantion occours
FOOL_A_FILES=$(FOO_A_FILES:%.a=%.l)
FOOF_FILES=$(shell ls *f)
FOOL_F_FILES=$(FOOF_FILES:%f=%.l)
# Use this as a target somewhere:
FOOL_FILES=$(FOOL_F_FILES) $(FOOL_A_FILES)
%.l: %.a
ln -s "$@" "$^"
%.l: %f
ln -s "$@" "$^"
[*] Is there any way to write a "non-trivial" makefile that will work both
with gnu- and bsd-make?
--
Tzafrir Cohen /"\
mailto:[EMAIL PROTECTED] \ / ASCII Ribbon Campaign
Taub 229, 972-4-829-3942, X Against HTML Mail
http://www.technion.ac.il/~tzafrir / \
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]