[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
foreach/ordering help
From: |
Mark Therieau |
Subject: |
foreach/ordering help |
Date: |
Sat, 2 Nov 2002 14:00:15 -0800 (PST) |
I'm trying to create an output file that
has one filename per line. (I need to feed
the filenames to the shell one at a time to
avoid win32 command-line length issues when
dealing with hundreds/thousands of files)
The makefile below doesn't work because the
foreach is evaluated *before* the rm command is
executed. The result is that the "shell echo"
commands run first to create "c.pfs" and then
the rm deletes it every time.
Any ideas on a better way to get the rules to
run in the desired order?
---------------------------------------------
CSRCS = file1.c file2.c file999.c file1000.c
c.pfs:
@rm -f $@
@$(foreach f,$(CSRCS),$(shell echo $(f) >> $@))
---------------------------------------------
regards,
markt
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
RE: foreach/ordering help, Randy W. Sims, 2002/11/03