Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Make: Loop to handle several object files listed in a file separately

4 views
Skip to first unread message

Peter Bolz

unread,
Jun 28, 2000, 3:00:00 AM6/28/00
to
Hello,
does anyone know how to get a loop depending on the filenames
listed in a file, so that each file listed there can be handled
individually?

This is to call the library builder which has to be done separate for each
object file.

----- File list e.g. in file File1.X:
LIBOBJ= \
nscanf.o \
clock.o \
chksmadj.o \
netconf.o \
httest.o \

----- Tools:
LIBR = $(PATH_CTOOL_UNIX)/ax

----- Rule:
libgen:
@echo xxx Create lib xxx
rm -f liby.a
$(foreach objfile, $(LIBOBJ), ???????????????????????????????????)
@echo xxx Ready lib creation xxx

Thank you!

=== Peter Bolz <Peter...@de.bosch.com> ===


Arnd Kohrs

unread,
Jun 29, 2000, 3:00:00 AM6/29/00
to

>>>>> "Peter" == Peter Bolz <Peter...@de.bosch.com> writes:

Peter> Hello, does anyone know how to get a loop depending on the
Peter> filenames listed in a file, so that each file listed there
Peter> can be handled individually?

Peter> This is to call the library builder which has to be done
Peter> separate for each object file.

Hi,
I am not sure that I understand your problem but if you just want to
read a list of dependencies from a file and then compile a library from
these something like the following should work:

# SNIP
LIBOBJ=$(shell cat File1.X)

liby.a: $(LIBOBJ)
rm $@
for o in $(LIBOBJ) ; do \
apply_treatment $$o ; \
done;

libgen: liby.a

# SNAP

I believe make has already some library compilation functionality, but I
have not yet studied it.

Cheers,
Arnd.
--
Arnd Kohrs - Institut Eurecom - http://www.eurecom.fr/~kohrs

The Active WebMuseum: Your personalized access to art paintings.
Visit now -> http://www.eurecom.fr/~kohrs/museum.html

Peter Bolz

unread,
Jun 29, 2000, 3:00:00 AM6/29/00
to
Hello Arnd,

thanks for your proposal. I'll test it.
First try failed, but give me some time.

Peter

0 new messages