From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 30 15:44:03 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2112106573B for ; Sun, 30 Nov 2008 15:44:03 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-3.dlr.de (smtp-3.dlr.de [195.37.61.187]) by mx1.freebsd.org (Postfix) with ESMTP id 528658FC0A for ; Sun, 30 Nov 2008 15:44:02 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from [192.168.2.100] ([172.21.151.2]) by smtp-3.dlr.de with Microsoft SMTPSVC(6.0.3790.1830); Sun, 30 Nov 2008 16:30:45 +0100 Message-ID: <4932B193.7030106@dlr.de> Date: Sun, 30 Nov 2008 16:30:27 +0100 From: Hartmut Brandt User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Eitan Adler References: <49320219.4070804@gmail.com> In-Reply-To: <49320219.4070804@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Nov 2008 15:30:45.0261 (UTC) FILETIME=[9CCDD3D0:01C95300] Cc: freebsd-hackers@freebsd.org Subject: Re: change to make - error when Makefile doesn't exist X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2008 15:44:03 -0000 Eitan Adler wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I stupidly forgot to make a backup so I can't provide a diff but in > src/usr.bin > I changed > TryReadMakefile("Makefile"); > to > if (!TryReadMakefile("Makefile")) > Fatal("Makefile could not be opened"); > That way you could differentiate between the Makefile not existing and > the target not existing. > > gmake provided the following error message: > gmake: *** No targets specified and no makefile found. Stop. > > It is perfectly valid to have no makefile yet to run make. Make has a number of builtin rules. If, for example, you have a file x.c then 'make x' or 'make x.o' make will cause make to compile x.c even without a makefile. But if you have no Makefile, you must specify a target. Otherwise how would make know what to make? So the error message is quite exact: it is an error to have no makefile AND to specify no target. harti