help-make
[Top][All Lists]
Advanced

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

Re: parallel and recursive make


From: Philip Guenther
Subject: Re: parallel and recursive make
Date: Thu, 26 Mar 2009 19:36:40 -0700

2009/3/25 Ethan Tira-Thompson <address@hidden>:
> This module has some header files which are constructed from a sort of
> template file (call it a 'fsm' file to avoid confusion with C++ templates or
> such)
> Source files in the project then include the generated header files from the
> module.
> The problem is that when using parallel builds, if a 'fsm' file is modified,
> the module headers are regenerated, but the project source files are only
> recompiled on the *next* make.  If I use a single-threaded build, then
> everything is kept in sync properly.

The problem is that the toplevel makefile doesn't show any action
required for the sub/bar.h target.  As far as make is concerned, that
means it doesn't need to check the timestamp as having changed, so it
doesn't notice that it has changed after invoking the sub target.

The simplest solution is to give the sub/bar.h target a command:

sub/bar.h: sub
        @: do nothing

(The ':' command is a shell built-in that does nothing).  Or even the
empty action:

sub/bar.h: sub ;

That's enough to force make to recheck whether the timestamp on the
target has changed


Philip Guenther




reply via email to

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