[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to specify a dependence on a directory?
From: |
Paul Smith |
Subject: |
Re: How to specify a dependence on a directory? |
Date: |
Fri, 20 Nov 2009 21:26:59 -0500 |
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?
How about:
FILES := $(wildcard somedir/*)
ifeq ($(FILES),)
.PHONY: target
endif
target: $(FILES)
somecommand
--
-------------------------------------------------------------------------------
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