[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to change certain rules such that they will not executed as long
From: |
couling |
Subject: |
Re: How to change certain rules such that they will not executed as long as the target is available? |
Date: |
Fri, 11 Jun 2010 11:54:07 -0700 (PDT) |
I Think what you're looking for is
http://www.gnu.org/software/make/manual/make.html#index-order_002donly-prerequisites-155
order-only-prerequisites . These act just like normal prerequisites except
that they will ignore the date.
To use them just put a pipe (|) after the normal prerequisites (there don't
have to be any) and everything that follows will be treated as an
order-only-prerequisite.
item : prereq | order-only-prereq
command
Hope this helps.
Peng Yu wrote:
>
> I have the following Makefile to extract tar files. However, it will
> always extract all the tar files. I could add touch $@ after tar xzvf
> $<. But I prefer not to do so. Because I don't want change the date of
> the extracted package.
>
> I'm wondering if there is any walkaround to not to update these rules
> as long as the targets exist.
>
> .PHONY: all
>
> TAR_GZ_FILES:=$(wildcard *.tar.gz)
> DIRS:=$(patsubst %.tar.gz,%,$(TAR_GZ_FILES))
>
> all: $(DIRS)
>
> $(DIRS): %: %.tar.gz
> tar xzvf $<
>
>
> --
> Regards,
> Peng
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>
>
--
View this message in context:
http://old.nabble.com/How-to-change-certain-rules-such-that-they-will-not-executed-as-long-as-the-target-is-available--tp28646116p28858913.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
- Re: How to change certain rules such that they will not executed as long as the target is available?,
couling <=