From owner-freebsd-bugs Tue Aug 26 20:50:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA03331 for bugs-outgoing; Tue, 26 Aug 1997 20:50:26 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA03322; Tue, 26 Aug 1997 20:50:11 -0700 (PDT) Resent-Date: Tue, 26 Aug 1997 20:50:11 -0700 (PDT) Resent-Message-Id: <199708270350.UAA03322@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, gibbs@narnia.plutotech.com Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA02462 for ; Tue, 26 Aug 1997 20:40:07 -0700 (PDT) Received: (from gibbs@localhost) by narnia.plutotech.com (8.8.7/8.7.3) id VAA19884; Tue, 26 Aug 1997 21:38:27 -0600 (MDT) Message-Id: <199708270338.VAA19884@narnia.plutotech.com> Date: Tue, 26 Aug 1997 21:38:27 -0600 (MDT) From: "Justin T. Gibbs" Reply-To: gibbs@narnia.plutotech.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/4401: make searches for it's Makefile in MAKEOBJDIR before curdir. Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4401 >Category: bin >Synopsis: make searches for it's Makefile in MAKEOBJDIR before curdir. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 26 20:50:03 PDT 1997 >Last-Modified: >Originator: Justin T. Gibbs >Organization: Pluto Technologies International Inc. >Release: FreeBSD 3.0-CURRENT i386 >Environment: >Description: If MAKEOBJDIR is set to a directory that happens to contain a Makefile, make will execute it instead of the Makefile in the current directory. >How-To-Repeat: export MAKEOBJDIR=/usr/src/sys/compile/MYKERNEL cd /usr/src/bin/ls make Kernel gets built instead of ls. 8-) >Fix: Index: main.c =================================================================== RCS file: /usr/cvs/src/usr.bin/make/main.c,v retrieving revision 1.21 diff -c -r1.21 main.c *** main.c 1997/08/25 21:35:44 1.21 --- main.c 1997/08/26 20:18:50 *************** *** 834,841 **** Parse_File("(stdin)", stdin); Var_Set("MAKEFILE", "", VAR_GLOBAL); } else { - if ((stream = fopen(fname, "r")) != NULL) - goto found; /* if we've chdir'd, rebuild the path name */ if (curdir != objdir && *fname != '/') { (void)sprintf(path, "%s/%s", curdir, fname); --- 834,839 ---- *************** *** 843,849 **** fname = path; goto found; } ! } /* look in -I and system include directories. */ name = Dir_FindFile(fname, parseIncPath); if (!name) --- 841,848 ---- fname = path; goto found; } ! } else if ((stream = fopen(fname, "r")) != NULL) ! goto found; /* look in -I and system include directories. */ name = Dir_FindFile(fname, parseIncPath); if (!name) >Audit-Trail: >Unformatted: