Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Strange makefile construct Message-ID: <4475@ncoast.UUCP> Date: Sun, 6-Sep-87 19:32:38 EDT Article-I.D.: ncoast.4475 Posted: Sun Sep 6 19:32:38 1987 Date-Received: Tue, 8-Sep-87 00:55:46 EDT References: <1162@nrcvax.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.questions Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 29 Xref: utgpu comp.unix.questions:3524 comp.unix.wizards:3833 As quoted from <1162@nrcvax.UUCP> by chris@nrcvax.UUCP (Chris Grevstad): +--------------- | 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? I'm hacking on the 4.3BSD make and wouldn't mind putting | this in, if it does what I think it does. +--------------- The `:' signals a substitution: $(?:.o=.c) means "in all words in $?, change instances of `.o' into `.c'. Note that, to my knowledge (which may be faulty), there is no way to prevent this macro from changing `foo.obj.c' to `foo.cbj.c'. -- Brandon S. Allbery, moderator of comp.sources.misc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!mandrill!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <> All opinions in this message are random characters produced when my cat jumped (-: up onto the keyboard of my PC. :-)