Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ut-sally!husc6!bbn!oberon!rdlvax!psivax!nrcvax!chris From: chris@nrcvax.UUCP (Chris Grevstad) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Strange makefile construct Message-ID: <1171@nrcvax.UUCP> Date: Sat, 5-Sep-87 22:41:49 EDT Article-I.D.: nrcvax.1171 Posted: Sat Sep 5 22:41:49 1987 Date-Received: Tue, 8-Sep-87 02:17:42 EDT References: <1162@nrcvax.UUCP> <781@custom.UUCP> Reply-To: chris@minnie.UUCP (Chris Grevstad) Organization: Frobozo Items Co. Inc. Ltd. Lines: 43 Xref: mnetor comp.unix.questions:3927 comp.unix.wizards:4121 In article <1162@nrcvax.UUCP>, I (Chris Grevstad) write: > I was looking at some source that came across the net some time ago and > ran across a very strange construct in the makefile. It appears that this > makefile is targeted for a SYSV system and I am familiar only with 4.2BSD > make. > > This is the weirdness: > > target: file1.o file2.o file3.o file4.o > $(CC) $(CFLAGS) $(?:.o=.c) > > Any suggestions? [....] > > My interpretation says: > This: > $(CC) $(CFLAGS) $(?:.o=.c) > becomes this: > $(CC) $(CFLAGS) file1.c file2.c file3.c file4.c and boykin@custom.UUCP (Joseph Boykin) responds: > [agreement as to my interpretation but has a caveat] > ... >than the target. The problem with this particular command is >that 'target' may now be compiled with only three (or less) files >instead of all four if one or more of the .o files was not modified; >given the command, this may cause an error. Yes, that is true if the target is supposed to be some sort of executable. In the application that I found this, the target is in fact a library, and the $(CC) line is followed by a few lines that either create the library or update the library, whichever is needed. Guy Harris (I think it was Guy, I have since deleted the mail) also responded to the latter part of my posting about the 4th generation make by pointing out something to me that I had forgotten, which is that there is a very good description of the new make in the proceeedings for the Portland Usenix conference. -- Chris Grevstad cit-vax!elroy!nrcvax!chris@rutgers.edu hplabs!sdcrdcf!psivax!nrcvax!chris ihnp4!nrcvax!chris