Mail Archives: djgpp/2004/09/29/17:09:14
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
- Raw text -