help-make
[Top][All Lists]
Advanced

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

Re: Auto generated files with dependency


From: Paul Smith
Subject: Re: Auto generated files with dependency
Date: Thu, 19 Jun 2008 10:50:08 -0400

On Thu, 2008-06-19 at 10:47 -0300, Boris Godin wrote:
> For example this would work:
> 
> data.pack: config.ini
>     pack.exe -f config.ini -v
> 
> But i don't know if filename in config.ini is data.pack or something
> else

You need to use a sentinel file:

        all: .config-sentinel

        .config-sentinel: config.ini
                pack.exe -f $< -v
                @touch $@

Now whenever the config file is compiled, the sentinel file
(.config-sentinel) is updated.

This is not perfect (for example, if someone deletes one of the output
files like "data.pack" make won't realize that it needs to run the rule)
but it basically works.  To get any more accurate you'll have to have a
way of generating a list of files that pack.exe will generate (or has
generated) and then turning that into make prerequisite statements.
-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "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]