From owner-freebsd-hackers Thu May 30 19:42:35 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from w250.z064001178.sjc-ca.dsl.cnc.net (adsl-66.218.45.239.dslextreme.com [66.218.45.239]) by hub.freebsd.org (Postfix) with SMTP id DD1CE37B401 for ; Thu, 30 May 2002 19:42:28 -0700 (PDT) Received: (qmail 91074 invoked by uid 1000); 31 May 2002 02:42:50 -0000 Date: Thu, 30 May 2002 19:42:28 -0700 From: Jos Backus To: freebsd-hackers@freebsd.org Subject: Improving GNU make compatibility in BSD make (+ patch) Message-ID: <20020531024250.GA90997@lizzy.catnook.com> Reply-To: jos@catnook.com Mail-Followup-To: freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.99i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The GNU make info file says: `$^' The names of all the prerequisites, with spaces between them. For prerequisites which are archive members, only the member named is used (*note Archives::). A target has only one prerequisite on each other file it depends on, no matter how many times each file is listed as a prerequisite. So if you list a prerequisite more than once for a target, the value of `$^' contains just one copy of the name. `$+' This is like `$^', but prerequisites listed more than once are duplicated in the order they were listed in the makefile. This is primarily useful for use in linking commands where it is meaningful to repeat library file names in a particular order. The make(1) manpage says: .ALLSRC The list of all sources for this target; also known as `>'. So BSD make interpreting either `$^' or `$+' as its own `$>' would improve compatibility with GNU make Makefiles. I am just not sure which of the two GNU make variables maps better to our `$>'. This patch implements the former: --- var.c Sat Apr 13 03:16:56 2002 +++ var.c.new Thu May 30 19:32:01 2002 @@ -1489,6 +1489,8 @@ name[0] = str[1]; name[1] = '\0'; + if (name[0] == '^') + name[0] = '>'; v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); if (v == (Var *)NULL) { -- Jos Backus _/ _/_/_/ Santa Clara, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos@catnook.com _/_/ _/_/_/ use Std::Disclaimer; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message