help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: how to do recursive "subsystem" make properly?


From: Mark Galeck (CW)
Subject: RE: how to do recursive "subsystem" make properly?
Date: Tue, 3 Nov 2009 15:32:16 -0800

>Actually the sentinel is, IMO, an annoying implementation.  Managing all
those sentinel files is a PITA.  If you're happy to require GNU make,
I'd probably suggest going with order-only prerequisites (or else going
all the way to non-recursive builds) as the most robust solution.


OK, after trying the sentinel file, I can't get it work:

top makefile is


foobar: subdir/sentinel
                echo making foobar
                touch foobar
subdir/sentinel:
                make -C subdir



subdir makefile is

all:
#       touch sentinel



Well, what am I doing wrong - because, with this foobar always gets rebuilt.  
Probably because make attempted to remake subdir/sentinel as "target", and even 
though that file did not get updated, make remembers that it remade the target.



Also,  order-only don't work for me either:  

Top makefile is


foobar: | subsystem
                echo making foobar
                touch foobar    
subsystem:
                make -C subdir


and subdir makefile is

all: subfile
subfile: 
                touch subfile

This time, foobar never gets rebuilt.  

-------------------------

All I need is for this example above, to work.  That is, if I have the "touch 
subfile" line, then make foobar, rebuilds foobar.  If I comment out the "touch 
subfile", then make foobar, does not rebuild foobar.  

I am sorry I am such a poor student, I just don't get it from your suggestions, 
how to do this.  

Mark






> (and with the question I had asked a few days ago, that of
> interrupting make not working, to which there were no replys, I assume
> this means "that is the way it is, make does the best possible effort
> to remove the target".  So my workaround, was when building the
> targets, to use a temporary name, and then as the last operation,
> rename it to the correct target name.  )

The problem is your issue, as best as I recall, is Windows-specific.
Most of the people reading this list are using make on POSIX systems,
and ^C on POSIX systems does the right thing (at least in the tests I've
conducted).  You might have more luck asking Windows-specific questions
on the address@hidden mailing list instead: Windows-knowledgeable
folks tend to hang out there.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]