help-make
[Top][All Lists]
Advanced

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

Re: complex Makefile for a bootstrapped self-hosting translator [GCC MEL


From: Paul Smith
Subject: Re: complex Makefile for a bootstrapped self-hosting translator [GCC MELT] ?
Date: Sat, 14 Jan 2012 15:30:38 -0500

On Tue, 2012-01-10 at 10:44 +0100, Basile Starynkevitch wrote:
> A prerequisite question is that I have no precise idea of when should
> timestamp files be used.

Make is based wholly on relative modification times of files to
determine whether targets need to be rebuilt.  In general a timestamp
file is used when the algorithm to decide when to rebuild a target is
too complex to be expressed as a simple "is the mod time newer?"
statement.

What that means exactly varies a lot with the circumstance.

> I forgot to explain, the do nothing 3 or 4 minutes time is not spent
> in make processes, but in actual commands which are not needed, and I
> have not a clear idea on how to detect that they are useless.

That's critical information indeed.

You have to translate the decision about when things need to be rebuilt
into modification times (on timestamp files), so make can handle them
properly.  That can be tricky, for sure.  It's feasible it could even be
impossible in some situations; I'm not sure.

If you can provide one specific scenario we can look at it.

> > If you haven't done so yet (and you don't need the builtin rules which
> > many makefiles don't), you can remove all builtin implicit rules by
> > adding this to your makefile:
> > 
> >         .SUFFIXES:
> >         %:: %,v
> >         %:: RCS/%,v
> >         %:: RCS/%
> >         %:: s.%
> >         %:: SCCS/s.%
> 
> Why should that help in practice?

If you write a simple makefile without these rules and run "make -d",
then add those rules and run "make -d" again, you'll see the difference
in the amount of work make is doing.  And that work increases with every
target in the makefile.

> Why don't usual Makefile-s (in particular autotools generated ones
> don't have these)?

Because many makefiles rely on these generic rules rather than writing
their own.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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