# Weird behavior of make on 10-STABLE, anyone else seeing this?



## ljboiler (Feb 21, 2016)

I've been working on porting OpenJFX, and ran into a weird problem with a Makefile that had me stumped.   I finally stumbled upon a solution, but what I see looks like a pretty nasty bug in the system `make` command on 10-STABLE.

Here a minimal Makefile:
	
	



```
all:
        echo $(PWD)
```

Put this in any directory and run `make`.   You should be shown, as you would expect, the current directory.  Now, create a sub-directory named objright where you are and try `make` again.  Do you get something you don't expect?

This is on 10-STABLE, as I said.   I don't see this on a 9.3 release system.


UPDATE:   False alarm - make is supposed to do this.   Must read the fine print about .OBJDIR in the man page.  Now I wonder why I _don't_ see it changing to the obj directory on my 9.3 system?


----------



## Juha Nurmela (Feb 21, 2016)

obj is special. Don't fight it if you can. Try `make -dCdex hello` to see the mechanism.

Juha


----------



## kpa (Feb 21, 2016)

FreeBSD 10 has a newer make that is the devel/bmake, older releases have the make(1) that was known as fmake.

https://www.bsdcan.org/2014/schedule/attachments/267_freebsd-bmake-slides.pdf


----------

