Subject: getting /usr/bin/make out of compatibility mode?
To: None <current-users@netbsd.org>
From: J Chapman Flack <flack@cs.purdue.edu>
List: current-users
Date: 12/29/2004 23:18:05
I just noticed this in 2.0 - maybe it was true before and I never noticed:
$ cat Makefile
foo : bar
echo $$$$
echo $$$$
cd /tmp
pwd
$ make
echo $$
6221
echo $$
14194
cd /tmp
make: exec(cd) failed (No such file or directory)
*** Error code 1
Stop.
That looks like old-style compatibility behavior, so I guess that's the
default--but neither 'man make' nor /usr/share/doc/psd/12.make/tutorial.ms
quite told me that. I did see in 'man make' that -j will turn compatibility
mode off, and that works:
$ make -j1
echo $$
7571
echo $$
7571
cd /tmp
pwd
/tmp
Now a single shell is used, and the cd works.
Is there any way I can indicate inside a makefile that I want the newer
semantics, or do I always have to remember -j1 on the command line or
export it in MAKEFLAGS from the shell? I didn't expect MAKEFLAGS += -j1
in the makefile to work, and I was right, it didn't.
Does this mean all the times I've built kernels without giving -j, I've
been running make in compatibility mode ... ?
-Chap