From nobody@FreeBSD.org  Mon Nov 21 16:32:19 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDFCD106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Nov 2011 16:32:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id AE0C88FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Nov 2011 16:32:19 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pALGWJBB006303
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Nov 2011 16:32:19 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pALGWJiT006302;
	Mon, 21 Nov 2011 16:32:19 GMT
	(envelope-from nobody)
Message-Id: <201111211632.pALGWJiT006302@red.freebsd.org>
Date: Mon, 21 Nov 2011 16:32:19 GMT
From: Monthadar <monthadar@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: make whereobj doesn't work after make buildenv
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         162724
>Category:       misc
>Synopsis:       make whereobj doesn't work after make buildenv
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 21 16:40:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Monthadar
>Release:        Current
>Organization:
>Environment:
FreeBSD panter.freebsd 9.0-CURRENT FreeBSD 9.0-CURRENT #58: Sun Feb 20 06:00:42 UTC 2011     root@panter.freebsd:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I have written a custom kernel module residing in my home path (e.g /root/mymodule), and created an obj directory. running 'make whereobj' gives out the path inside my module /root/mymodule/obj.

But after running 'make buildenv' (for cross compiling to another architecture) 'make whereobj' gives out only /root/mymodule and not /root/mymodule/obj!!
>How-To-Repeat:
Create a simple loadable kernel module with the standard makefile:
.PATH:	${.CURDIR}/src
# Declare Name of kernel module
KMOD    =  pci_rf_speedtest
# Enumerate Source files for kernel module
SRCS    =  pci_rf_speedtest_module.c
# Include kernel module makefile
.include <bsd.kmod.mk>

run:
cd /path/to/mymodule
make whereobj
cd /usr/src
make buildenv
cd /path/to/mymodule
make whereobj

and you will get different outputs.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
