X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <415B2450.3020706@inti.gov.ar> Date: Wed, 29 Sep 2004 18:08:32 -0300 From: Salvador Eduardo Tropea User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: es-ar, es, en MIME-Version: 1.0 To: djgpp AT delorie DOT com, jansb000 AT planet DOT nl Subject: Re: Problem with cross-platform app: MAKE vs NMAKE References: <415980C6 DOT 6080908 AT inti DOT gov DOT ar> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i8TL8UN3002894 Reply-To: djgpp AT delorie DOT com jansb000 wrote: >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 > > Yes, but with more levels of abstraction: ALL_PREREQ=$^ .... RHIDE_COMPILE_ARCHIVE=$(RHIDE_AR) $(RHIDE_ARFLAGS) $(OUTFILE)\ $(ALL_PREREQ) .... librhtv$(ExLIB):: \ ../makes/obj/beep$(ExOBJ) \ ../makes/obj/drivevalid$(ExOBJ) \ ..... More dependencies $(RHIDE_COMPILE_ARCHIVE) >Questions: >- What is the NMAKE code for referencing the first prerequisite? > > I donīt remmember. Look in the MSN development site, it have an nmake reference. I think the free BC++ compiler also have some docs about the make tool. For my case $** is ok. But thatīs because I have 2 sets of dependencies: 1) For development, targets depends on sources and headers. 2) For users, targets depends just on their sources. For BC++ and MSVC I always use (2). >- How is the makefile part 1 referencing to part 2? As an include? > > Yes, but that could be tricky because the GNU command is "include" and the nmake command is "!include". In my case the makefiles are nested and hence the dependencies file can pull another dependencies. As the directive is different I just define variables like INCLUDE00, INCLUDE01, etc. Then I pull the defined includes from part 1. 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