Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 2015 17:36:19 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288179 - head/share/mk
Message-ID:  <201509241736.t8OHaJOZ047449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <src.opts.mk>
 
 FILES=	\
@@ -63,3 +68,4 @@ FILES+=	tap.test.mk
 .endif
 
 .include <bsd.prog.mk>
+.endif	# CURDIR == PARSEDIR



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509241736.t8OHaJOZ047449>