X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Thu, 30 Sep 2004 16:32:01 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-ID: <01c4a6fa$Blat.v2.2.2$651c3a00@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: (jansb000@planet.nl) Subject: Re: Problem with cross-platform app: MAKE vs NMAKE References: <415980C6 DOT 6080908 AT inti DOT gov DOT ar> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "jansb000" > Date: Wed, 29 Sep 2004 20:37:16 +0200 > > I like the idea of splitting the makefile into a "header-part" and a > "dependency part". The dependency part can be the same for all flavors of > make. > > If I understand you correctly you use wrappers in part 1 like this: > SOURCE_NAME=$** / $@ > 1ST_PREREQ=$ ??? / = $< > ALL_PREREQ=$** / = $^ > > Then in part 2 you say: > my_target.o: my_target.cpp my_target.h > ...cpp -c $(1st_prereq) > my_target.exe: my_target.o other.o > ...cpp -o $(source_name) $(all_prereq) -libraries Alas, the incompatibilities don't end here. You will find that the backslash treatment is completely incompatible, and that using the forward slash might not work as well, since the tools invoked by NMAKE think a slash is a command-line switch character, not a directory separator. Even more problems lurk in advanced features like recursive Make invocations, static pattern rules, etc. If you can get away without using these, then you are lucky. In my experience, by far the only practical solution is to use GNU Make on all platforms. Yes, that solution is not without problems, but they are easier worked around than with alternatives.