[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fail, if a target was not generated
From: |
Paul D. Smith |
Subject: |
Re: fail, if a target was not generated |
Date: |
Wed, 12 Oct 2005 18:03:39 -0400 |
%% Torsten Mohr <address@hidden> writes:
tm> the commands in a certain rule to generate a target always give
tm> a return code different to 0x00.
tm> This is known and ok, the wanted output file is generated.
tm> At the moment i have a rule like this:
tm> $(OUTPUT) : $(INPUT)
tm> -command -o $@ -c $<
tm> I'd like to have something like this:
tm> $(OUTPUT) : $(INPUT)
tm> -command -o $@ -c $<
tm> fail_if_target_does_not_exist_or_is_older_than_input $@ $<
tm> Is something like this possible?
Well, of course you can do it in the shell:
$(OUTPUT) : $(INPUT)
-command -o $@ -c $<
@[ -f $@ -a $@ -nt $< ]
It seems like there should be a way to get make to do this, since that's
what make does, but I can't think of one offhand.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist