help-make
[Top][All Lists]
Advanced

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

Re: Opposite of .PHONY


From: Eric Hanchrow
Subject: Re: Opposite of .PHONY
Date: Mon, 21 Aug 2006 16:02:14 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.51 (gnu/linux)

>>>>> "Thomas" == Thomas Mogwitz <address@hidden> writes:

    Thomas> Now I would like make to run the command only if one of
    Thomas> the prerequisites has been remade.  But since 'install' is
    Thomas> no file, make does it always.  I don't really like the
    Thomas> idea of creating an empty file with each command that
    Thomas> builds one of the prerequisites.  Is there another way?

My understanding is that you only need a single empty file for the
"install" target, not "an empty file with each command that builds one
of the prerequisites".  For example, from (info "(make)Empty
Targets"), I see

         print: foo.c bar.c
                 lpr -p $?
                 touch print

    With this rule, `make print' will execute the `lpr' command if either
    source file has changed since the last `make print'.  The automatic
    variable `$?' is used to print only those files that have changed
    (*note Automatic Variables::).

I think that would do what you want, if you substituted "install" for
"print", and various installation commands for "lpr".

-- 
I hope to get back to work on Arc soon.
        -- Paul Graham, quoted in "ACM Crossroads", no date given





reply via email to

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