From owner-svn-src-head@freebsd.org Thu Sep 24 17:36:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ECC3A0831D; Thu, 24 Sep 2015 17:36:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C42E1518; Thu, 24 Sep 2015 17:36:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8OHaJjZ047450; Thu, 24 Sep 2015 17:36:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8OHaJOZ047449; Thu, 24 Sep 2015 17:36:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201509241736.t8OHaJOZ047449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 24 Sep 2015 17:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288179 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2015 17:36:19 -0000 Author: bdrewery Date: Thu Sep 24 17:36:18 2015 New Revision: 288179 URL: https://svnweb.freebsd.org/changeset/base/288179 Log: Fix running make in src directories without a Makefile giving confusing errors. This fixes the following errors: make: don't know how to make bsd.README. Stop make: don't know how to make auto.obj.mk. Stop This is easily seen in sys/dev/*. The new behavior is now the expected output: make: no target to make. This would happen as MAKESYSPATH (.../share/mk) is auto added to the -I list. Any directory where make is ran in the src tree that has no local Makefile would then try executing the target in share/mk/Makefile, which by default was to build the first entry in FILES. Of course, because bsd.README and auto.obj.mk are not in the current directory the error is shown. This check only works for bmake, but I will still MFC it with an extra '!defined(.PARSEDIR) ||' guard for stable/10. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Thu Sep 24 17:23:41 2015 (r288178) +++ head/share/mk/Makefile Thu Sep 24 17:36:18 2015 (r288179) @@ -1,6 +1,11 @@ # $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/8/93 +# Only parse this if executing make in this directory, not in other places +# in src that lack a Makefile, such as sys/dev/*. Otherwise the MAKESYSPATH +# will read this Makefile since it auto includes it into -I. +.if ${.CURDIR} == ${.PARSEDIR} + .include FILES= \ @@ -63,3 +68,4 @@ FILES+= tap.test.mk .endif .include +.endif # CURDIR == PARSEDIR