tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make -C dir ?



On Thu, 27 Aug 2009 10:30:38 +0200, Alan Barrett <apb%cequrux.com@localhost> 
wrote:
> On Wed, 26 Aug 2009, Simon J. Gerraty wrote:
>> I've been asked about adding support for the command line switch 
>> -C "dir" to bmake.  Since both gmake and freebsd's make support this,
>> I thought it might make sense to add to our make (and hence bmake).
> 
> Are the semantics well defined when "-C chdir" and "-f makefile"
> are intermixed?  For example, what does "make -f ./Makefile -C
> /elsewhere target" do, and is it the same or different from "make
> -C /elsewhere -f ./Makefile target"?
> 
> --apb (Alan Barrett)

Here is the test I've done on my FreeBSD (8-BETA3) :

elbarto@sonic> pwd
/usr/home/elbarto/test
elbarto@sonic> ls -R
Makefile        test1

./test1:
Makefile
elbarto@sonic> cat Makefile 
all:
@echo test
elbarto@sonic> cat test1/Makefile 
all:
@echo test1
elbarto@sonic> make -C test1 -f ./Makefile 
test1
elbarto@sonic> make -C test1 -f `pwd`/Makefile
test
elbarto@sonic> make -f ./Makefile -C test1
test1
elbarto@sonic> make -f `pwd`/Makefile -C test1
test
elbarto@sonic> 

So the -C argument is done before opening the Makefile.

-- 
Emmanuel Vadot
elbarto%arcadebsd.org@localhost


Home | Main Index | Thread Index | Old Index