On Fri, Nov 20, 2009 at 8:26 PM, Paul Smith <[email protected]> wrote:
> On Fri, 2009-11-20 at 18:50 -0600, Peng Yu wrote:
>> But I don't want to explicitly specify the files, because I might
>> change 'some_command' to generate different files.  I don't want to
>> modify Makefile every time I change 'some_command'.
>
> So, to be clear: you want the rule to run if there are no files in the
> directory, or if there are any files and any of them are newer than the
> target?

I want the rule to run if there is no such a directory, or there are
no files in the directory, or there is any file that is older than the
dependent files.

> How about:
>
>        FILES := $(wildcard somedir/*)
>        ifeq ($(FILES),)
>        .PHONY: target
>        endif
>        target: $(FILES)
>                somecommand
>
> --
> -------------------------------------------------------------------------------
>  Paul D. Smith <[email protected]>          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
>
>


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to