Bug or feature? (about FreeBSD make)

When a folder contains a sub folder names obj.
make run in a different (correct?) path.

See following:
Code:
[jcz@jcz-freebsd ~]$ mkdir test
[jcz@jcz-freebsd ~]$ cd test
[jcz@jcz-freebsd ~/test]$ echo -e "first:\n\tpwd" > Makefile
[jcz@jcz-freebsd ~/test]$ cat Makefile 
first:
        pwd
[jcz@jcz-freebsd ~/test]$ make
pwd
/usr/home/jcz/test
[jcz@jcz-freebsd ~/test]$ mkdir obj
[jcz@jcz-freebsd ~/test]$ make
pwd
/usr/home/jcz/test/obj
 
pjincz said:
When a folder[red]directory[/red] contains a sub folder[red]subdirectory[/red] names[red]named[/red] obj.[red],[/red] make run[red]s[/red] in a different (correct?) path.
Admittedly, I normally use GNU Make (devel/gmake) because a) it's more widely used/supported, b) I just happen to be used to it and c) it appears to have more features, but I do seem to recall that BSD Make has this thing with obj directories. Does the man page (see make(1)) say anything about it?
 
This seems to be a feature.

From the manpage:
Code:
     .OBJDIR       A path to the directory where the targets are built.  At
         startup, make searches for an alternate directory to
         place target files.  It will attempt to change into this
         special directory and will search this directory for
         makefiles not found in the current directory.  The fol‐
         lowing directories are tried in order:

         1.   ${MAKEOBJDIRPREFIX}/`pwd -P`
         2.   ${MAKEOBJDIR}
         3.   obj.${MACHINE}
         4.   obj
         5.   /usr/obj/`pwd -P`
 
Carpetsmoker said:
This seems to be a feature.

From the manpage:
[snip]
Exactly. It may catch one off-guard if one is more used to GNU Make, but it does appear to be intended BSD Make behaviour.
 
Back
Top