www.digitalmars.com         C & C++   DMDScript  

c++.command-line - smake infinite recursion

reply Larry Brasfield <larry_brasfield snotmail.com> writes:
I'm reporting this as a bug against smake without
any claim that it represents a deviation from
documented behavior.  There is a work-around for
it, although it does complicate our "check-out
and automated build" process somewhat.

Consider this excerpt from a Makefile:


depends :
         $(PERL) $(PROJTOOLS)\makedeps.pl *.CXX *.H *.A86 > depends.mak

!if exist(depends.mak)
! include depends.mak
!else
! if [echo. > depends.mak]
! endif
! if [$(MAKE) depends] || 1
!  message  Please delete "depends.mak" whenever dependencies change.
! endif
! if exist(depends.mak)
!  include depends.mak
! else
!  error Cannot generate depends.mak, build failed.
! endif
!endif

The result of having the recursive call "! if [$(MAKE) depends] || 1"
when smake is the Makefile interpretor is an infinite recursion.  I
think the reason smake acts that way and nmake does not is that the
bracketed conditionals are evaluated after building the make syntax
tree in smake, leading to a no-leaf branch, while nmake executes and
switches on the conditional as it is encountered.

I know that recursive make is frowned upon these days, but I will
say that the above construct has been very handy and, until I began
using smake, trouble free.

I appreciate that this may be a low-priority bug or as-designed
and will not be a disgruntled customer should smake continue to
never stop executing the above construct.

-- 
-Larry Brasfield
(address munged, s/sn/h/ to reply)
Aug 01 2002
parent "Walter" <walter digitalmars.com> writes:
"Larry Brasfield" <larry_brasfield snotmail.com> wrote in message
news:MPG.17b3697d9e8e969989689 news.digitalmars.com...
 I appreciate that this may be a low-priority bug or as-designed
 and will not be a disgruntled customer should smake continue to
 never stop executing the above construct.
Smake isn't being worked on at the moment, but I do save all the bug reports and log them against each component. When there's enough to open development on a component again, all the bug reports are there and can be addressed. So the bug reports you take the time to prepare are worthwhile. Thanks, -Walter
Aug 01 2002