X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "jansb000" Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with cross-platform app: MAKE vs NMAKE Date: Wed, 29 Sep 2004 20:37:16 +0200 Organization: Planet Internet Lines: 68 Message-ID: References: <415980C6 DOT 6080908 AT inti DOT gov DOT ar> NNTP-Posting-Host: ip503dfffd.speed.planet.nl X-Trace: reader10.wxs.nl 1096483317 21102 80.61.255.253 (29 Sep 2004 18:41:57 GMT) X-Complaints-To: abuse AT planet DOT nl NNTP-Posting-Date: 29 Sep 2004 18:41:57 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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 Questions: - What is the NMAKE code for referencing the first prerequisite? - How is the makefile part 1 referencing to part 2? As an include? - - - - - - - - - - - - "Salvador Eduardo Tropea" schreef in bericht news:415980C6 DOT 6080908 AT inti DOT gov DOT ar... > jansb000 wrote: > > >I am working on a program that is supposed to be cross-platform. Recently we > >have a project member who is using MSVC. The makefile that I made for DJGPP > >make is not working for nmake from MSVC. > > > >I use the variables $@, $< and $^. These seem to be unavailable in MSVC. > >Also the IFEQ command is not recognised by nmake. > > > >What can I do to make my makefile usable to both DJGPP and MSVC? > > > > > You can split your makefile into: > > 1) Rules. > 2) Dependencies. > > The part (1) will be different for make and nmake and (2) will be shared. > Youīll probably need to split (1) to separate the compiler dependent > stuff because BC++ also uses nmake syntax. > Turbo Vision 2.0.3 (http://sf.net/projects/tvision) does it. It have 3 > makefiles (GNU, BC++ and MSVC). The MSVC/BC++ are the same, I just use a > wrapper to define a variable. > Most UNIX systems does what Eli says, but BC++ and MSVC users arenīt > like UNIX users ;-) > In *BSD systems you can usually find GNU make renamed as "gmake", the > native make isnīt compatible with GNU make. > > SET > > -- > Salvador Eduardo Tropea (SET). (Electronics Engineer) > Visit my home page: http://welcome.to/SetSoft or > http://www.geocities.com/SiliconValley/Vista/6552/ > Alternative e-mail: set AT computer DOT org set AT ieee DOT org > Address: Curapaligue 2124, Caseros, 3 de Febrero > Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013 > > > >