[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to deal with a target in the dependence chain that is deleted after
From: |
Peng Yu |
Subject: |
How to deal with a target in the dependence chain that is deleted after the command execution? |
Date: |
Sat, 26 Dec 2009 20:59:47 -0600 |
I have the following two files. Whenever I call 'make', 'gzip' will be
called again. I'm wondering what is the correct way to write the
makefile such that gzip will not be called as long as test.txt.gz is
newer than test.sh.
$ cat Makefile
.PHONY: all
all: test.txt.gz
test.txt.gz: test.txt
gzip $<
test.txt: test.sh
./$< > $@
$ cat test.sh
#!/usr/bin/env bash
echo test
$ make
./test.sh > test.txt
gzip test.txt
gzip: test.txt.gz already exists; do you wish to overwrite (y or n)? y
- How to deal with a target in the dependence chain that is deleted after the command execution?,
Peng Yu <=