www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/23/14:14:13

Xref: news2.mv.net comp.os.msdos.djgpp:3014
From: nicolas AT dsys DOT ceng DOT cea DOT fr (Eric NICOLAS)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [Q:] Portable recursive make ??
Date: 23 Apr 1996 13:49:09 GMT
Organization: Commissariat a l'energie atomique, Grenoble (France)
Lines: 37
Message-ID: <4lin4l$no6@news.cea.fr>
Reply-To: nicolas AT dsys DOT ceng DOT cea DOT fr
NNTP-Posting-Host: hudson.ceng.cea.fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

:>:> >default all verif clean depend install:
:>:> >	cd FirstDir
:>:> >	make $@
:>:> >	cd ..
:>:> >	cd SecondDir
:>:> >	make $@
:>:> >	cd ..
:>:> 
:>:> That's very odd... according to what the Make docs say, that shouldn't
:>:> work.  Oh, well.
:>:
:>:That's because under Unix, each line is executed by another instance of 
:>:the shell.  And since on Unix the current working directory is local to 
:>:the program, putting a cd on a line by itself does nothing: once the 
:>:shell that did the cd returns you are back in your previous directory.  
:>:Under MS-DOS that is not so.
:>
:>So, if I understood well, there is absolutely no way of perform a 
:>recursive make in a portable fashion ???
:>
:> How about make -C ? I think it should work under dos.

I know that make -C work under DOS, but many non-gnu make programs 
do NOT support this option :-( (SUN make is one of those programs
and I use it at work).

But, you are right to say that "make -C subdir $@" is much better
for portability than "cd subdir\n make $@ \n cd ..".


-- 
Eric Nicolas <nicolas AT dsys DOT ceng DOT cea DOT fr>

Take a look to the SWORD home page :
	http://bunny.ensea.fr/Pages_Perso/Cedric_Joulain/sword.web/home.html


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019