help-make
[Top][All Lists]
Advanced

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

How to change certain rules such that they will not executed as long as


From: Peng Yu
Subject: How to change certain rules such that they will not executed as long as the target is available?
Date: Sat, 22 May 2010 16:37:38 -0500

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]