From owner-freebsd-bugs Thu Oct 9 08:00:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA05141 for bugs-outgoing; Thu, 9 Oct 1997 08:00:06 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA05117; Thu, 9 Oct 1997 08:00:01 -0700 (PDT) (envelope-from gnats) Resent-Date: Thu, 9 Oct 1997 08:00:01 -0700 (PDT) Resent-Message-Id: <199710091500.IAA05117@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, dada@sbox.tu-graz.ac.at Received: from fcggsg07.icg.tu-graz.ac.at (fcggsg07.icg.tu-graz.ac.at [129.27.201.16]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA04644 for ; Thu, 9 Oct 1997 07:50:36 -0700 (PDT) (envelope-from dada@lend.tu-graz.ac.at) Received: from lend.tu-graz.ac.at (isdn012.tu-graz.ac.at [129.27.240.12]) by fcggsg07.icg.tu-graz.ac.at (8.8.4/8.8.4) with ESMTP id QAA24994 for ; Thu, 9 Oct 1997 16:49:57 +0200 (MDT) Received: (from dada@localhost) by lend.tu-graz.ac.at (8.8.5/8.8.5) id QAA07975; Thu, 9 Oct 1997 16:47:47 +0200 (CEST) Message-Id: <199710091447.QAA07975@lend.tu-graz.ac.at> Date: Thu, 9 Oct 1997 16:47:47 +0200 (CEST) From: Martin Kammerhofer Reply-To: dada@sbox.tu-graz.ac.at To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4736: Bugs in /usr/share/mk/bsd.*.mk bsd-make include files Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4736 >Category: bin >Synopsis: Bugs in /usr/share/mk/bsd.*.mk bsd-make include files >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 9 08:00:01 PDT 1997 >Last-Modified: >Originator: Martin Kammerhofer >Organization: Graz University of Technology >Release: FreeBSD 2.2.2-RELEASE i386 >Environment: probably all BSDs, for sure in FreeBSD 2.2.2 >Description: There are make rules wich are intended to define default rules for undefined targets, i.e targets never occuring on the left side of a dependency. E.g. from bsd.subdir.mk: .for __target in all checkdpadd clean cleandir depend lint \ maninstall obj objlink .if !target(__target) ${__target}: _SUBDIRUSE .endif .endfor These do not work as intended because ``__target'' is taken literally. It should - of course - read: .if !target(${__target}) As a consequence these default rules are added *unconditionally* (except for the case where someone has explicitely defined a ``__target'' target, in which case no rule at all would get added). There are at least three of these bugs: fgrep -n target\(_ * bsd.port.subdir.mk:51:.if !target(__target) bsd.sgml.mk:152:.if !target(__target) bsd.subdir.mk:31:.if !target(__target) >How-To-Repeat: cat Makefile SUBDIR = nosuchsubdir all: @echo "This rule won't fall over after fixing this bug" clean: _SUBDIRUSE @echo "This is expected to fail" .include make This rule won't fall over after fixing this bug ===> nosuchsubdir cd: can't cd to /var/tmp/nosuchsubdir *** Error code 2 Stop. >Fix: substitute ``target(${__target})'' for ``target(__target)'' Note: Since this affects all makes it could theoretically break existing Makefiles if they relied on this bug. If you want the default rules added, you have to specify a ``_SUBDIRUSE'' dependency like in ``clean'' above. >Audit-Trail: >Unformatted: