Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2003 13:50:59 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Pawel Jakub Dawidek <nick@garage.freebsd.pl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Bug in make(1)?
Message-ID:  <20030403215059.GA37698@athlon.pn.xcllnt.net>
In-Reply-To: <20030403212300.GL54604@garage.freebsd.pl>
References:  <20030403212300.GL54604@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 03, 2003 at 11:23:00PM +0200, Pawel Jakub Dawidek wrote:
> 
> Could someone please explain such make(1) behaviour:

Because you told make(1) to by virtue of including bsd.prog.mk

OBJS is derived from SRCS by replacing the extension. If SRCS
contains foo/bar.c, OBJS will contain foo/bar.o...

> IMHO make(1) should put .o files in current directory _and_ look for them
> there when producing an executable file. Right?

Wrong. It's the C compiler that puts files in the current
directory by default, unless otherwise told by command line
options. The only thing make(1) does is look for files you
tell it to look for and make them if they are out of date
(if told to do so). If you tell make to look for files the
compiler does not create you have a broken makefile.

It looks bsd.prog.mk does not handle subdirectories in a way
you want, which means you have to reorganize your sources in
order to use bsd.prog.mk or enhance the BSD includes to deal
with that (if appropriate).

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



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