From owner-freebsd-arch@FreeBSD.ORG Sun Jun 22 01:37:23 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D158B37B401 for ; Sun, 22 Jun 2003 01:37:23 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7896E43F75 for ; Sun, 22 Jun 2003 01:37:20 -0700 (PDT) (envelope-from ru@sunbay.com) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h5M8bFVd005550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 22 Jun 2003 11:37:16 +0300 (EEST) (envelope-from ru@sunbay.com) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9/8.12.8/Submit) id h5M8bFx7005545; Sun, 22 Jun 2003 11:37:15 +0300 (EEST) (envelope-from ru) Date: Sun, 22 Jun 2003 11:37:14 +0300 From: Ruslan Ermilov To: Bruce Evans Message-ID: <20030622083714.GD99674@sunbay.com> References: <20030622005124.GA59673@HAL9000.homeunix.com> <20030622035258.GB60460@HAL9000.homeunix.com> <20030622180851.K55800@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AkbCVLjbJ9qUtAXD" Content-Disposition: inline In-Reply-To: <20030622180851.K55800@gamplex.bde.org> User-Agent: Mutt/1.5.4i cc: arch@freebsd.org cc: David Schultz Subject: Re: Per-source CFLAGS X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2003 08:37:24 -0000 --AkbCVLjbJ9qUtAXD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 22, 2003 at 06:23:20PM +1000, Bruce Evans wrote: [...] > > > Some rules are specified by POSIX, so they can't be changed. I don't > > > see how ${CFLAGS} can be per-file directly, so the POSIX spec seems to > > > be actively opposed to per-file CFLAGS. > > > > ??? You mean we can't add a variable that will normally expand to > > nil? This seems like a compatible change, unless you're worried > > about someone's makefile breaking because they defined > > CFLAGS_foo.c to mean something else. >=20 > >From POSIX.1-200x-draft7.txt: >=20 > % 23836 Default Rules > % 23837 The default rules for make shall achieve results = that are the same as if the following were used. > % ... > % 23864 SINGLE SUFFIX RULES > % 23865 .c: > % 23866 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< >=20 > This leaves little scope for modifying the default rules. >=20 A double suffix rule would be more appropriate here: 23883 DOUBLE SUFFIX RULES 23884 .c.o: 23885 $(CC) $(CFLAGS) -c $< 23886 .f.o: 23887 $(FC) $(FFLAGS) -c $< 23888 .y.o: 23889 $(YACC) $(YFLAGS) $< 23890 $(CC) $(CFLAGS) -c y.tab.c 23891 rm -f y.tab.c 23892 mv y.tab.o $@ Anyway, this only means we should not add the support for per-source CFLAGS to the %POSIX section of sys.mk. I still have some concerns with the proposed implementation. All already existing per-file knobs override the global knob, and I think that maybe the per-source CFLAGS should behave the same? Doing it this way is more flexible; you're free to augment the global CFLAGS by saying CFLAGS_foo.c=3D ${CFLAGS} -DFOO Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --AkbCVLjbJ9qUtAXD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+9Wq6Ukv4P6juNwoRApwXAJ40ttjhe6+nuLfil2gC/MeRK5r8ggCfUDZn HZqwKWaN0OF9XbC8T1b7Mk0= =zxou -----END PGP SIGNATURE----- --AkbCVLjbJ9qUtAXD--