Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!unido!iaoobelix!wagner From: wagner@iaoobelix.UUCP Newsgroups: comp.unix.questions Subject: Re: Strange makefile construct - (nf) Message-ID: <8200021@iaoobelix.UUCP> Date: Thu, 17-Sep-87 16:43:00 EDT Article-I.D.: iaoobeli.8200021 Posted: Thu Sep 17 16:43:00 1987 Date-Received: Sun, 20-Sep-87 20:02:23 EDT References: <1162@nrcvax.UUCP> Lines: 46 Nf-ID: #R:nrcvax:1162:iaoobelix:8200021:000:1277 Nf-From: iaoobelix!wagner Sep 17 21:43:00 1987 /***** iaoobelix:comp.unix.ques / nsc!woolsey / 12:13 am Sep 9, 1987*/ > All I need now is something that turns > > FILES = one two three four > > into > > $(CC) $(CFLAGS) one.c two.c three.c four.c > > and a default rule to go along with it. I know about basename(1), but > it doesn't do what I want. ... > Jeff Woolsey National Semiconductor Corporation Ok. So, how about using a default rule, anyway? You want to have some object files depending on some source files. As far as transformations between source and object file names are restricted to mere suffix substitution (exception: under SYSV and on Suns you can use the empty suffix), it shouldn't be the least bit difficult to write such a dependency. OBJS = one.o two.o three.o four.o foo: $(OBJS) $(CC) $(LDFLAGS) -o foo $(OBJS) .c.o: $(CC) $(CFLAGS) -c $*.c Or what were your intentions with the construct above? Did you want to get four separate programs with that single dependency (sorry, I am just asking)? In that case, you have to write (under SYSV and friends): BINS = one two three four .c: $(CC) $(LDFLAGS) -o $* $*.o .c.o: $(CC) $(CFLAGS) -c $*.c I hope this helps. Juergen Wagner, (USENET) ...seismo!unido!iaoobel!wagner ("Gandalf") Fraunhofer Institute IAO, Stuttgart