[asterisk-dev] [svn-commits] rizzo: trunk r72700 - /trunk/main/Makefile

Luigi Rizzo rizzo at icir.org
Fri Jun 29 16:12:02 CDT 2007

On Fri, Jun 29, 2007 at 03:49:58PM -0500, Russell Bryant wrote:
> SVN commits to the Digium repositories wrote:
> > Author: rizzo
> > Date: Fri Jun 29 15:33:35 2007
> > New Revision: 72700
> > 
> > URL: http://svn.digium.com/view/asterisk?view=rev&rev=72700
> > Log:
> > Make sure that we properly recurse in subdirectories to
> > check dependencies for libraries.
> > Because these targets (e.g. minimime/libmmime.a) are real ones,
> > declaring them .PHONY would cause them to be rebuilt every time
> > (see e.g. SVN 64355).
> > 
> > As a workaround I am using the following CHECK_SUBDIR target:
> > 
> >   CHECK_SUBDIR:  # do nothing, just make sure that we recurse in the subdir/
> >   minimime/libmmime.a: CHECK_SUBDIR
> > 	@cd minimime && $(MAKE) libmmime.a
> > 
> > which seems to do a better job than .PHONY (probably because
> > .PHONY forces the rebuild even if the recursive make does not think
> > it is necessary).
> Hm, this is interesting.  I have always thought that declaring a target
> as .PHONY did the exact same thing as what this method does.  In fact,
> the GNU make manual claims they do the same thing.
> http://www.gnu.org/software/make/manual/html_node/Force-Targets.html#Force-Targets

I think the last sentence in the above manpage is wrong and the two things
are actually different (in fact, if you try, they do behave differently
if the target is a real file). If you read the .PHONY page


it says that .PHONY targets should not be real files, and i bet that internally
gmake uses this assumption to imply that the target is not just _possibly_ out
of date, but it _must_ be rebuilt.

Anyways, FORCE might be a better name than CHECK_SUBDIR for the fake target.


More information about the asterisk-dev mailing list