2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 07:45:17 +00:00

Makefiles: don't use the FORCE, Luke!

With GNU make, using .PHONY leads to the same result as using
the "FORCE" hack, but unlike FORCE is not a hack. Since we do not
plan to use any other make than GNU make, let's just mark phony
targets as such.

For more details about why PHONY is better than FORCE, see
http://www.gnu.org/software/make/manual/make.html#index-FORCE

[v2: rebased and splitted]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Kir Kolyshkin
2016-02-24 12:29:57 -08:00
committed by Pavel Emelyanov
parent 885370f1be
commit 2edc082e07
2 changed files with 14 additions and 14 deletions

View File

@@ -1,16 +1,15 @@
ARCHES ?= armv7hf aarch64 ppc64le # x86_64
all: $(ARCHES)
.FORCE:
Dockerfile.%: Dockerfile.%.hdr Dockerfile.tmpl
cat $^ > $@
qemu-user-static:
./extract-deb-pkg qemu-user-static
binfmt_misc: .FORCE
binfmt_misc:
./binfmt_misc
.PHONY: binfmt_misc
%: Dockerfile.% qemu-user-static binfmt_misc
docker build -t criu-$@ -f $< ../..

View File

@@ -3,45 +3,46 @@ RM := rm -f --one-file-system
ZDTM_ARGS ?= -C
export ZDTM_ARGS
.FORCE:
all:
$(MAKE) zdtm
$(MAKE) zdtm-pre-dump
$(MAKE) zdtm-snapshot
$(MAKE) zdtm-iter
$(MAKE) zdtm-freezer
.PHONY: all
TESTS = unix-callback mem-snap rpc libcriu mounts/ext security pipes crit socketpairs overlayfs
other: .FORCE
other:
for t in $(TESTS); do \
setsid $(MAKE) -C $$t run || exit 1; \
done \
done
.PHONY: other
zdtm_ct: zdtm_ct.c
zdtm: .FORCE
zdtm:
./zdtm.py run -a --parallel 2
.PHONY: zdtm
zdtm-pre-dump:
./zdtm.py run --pre 2:1 -t zdtm/transition/fork -f uns
.PHONY: zdtm
zdtm-snapshot:
./zdtm.py run --pre 2:1 --snap -t zdtm/transition/fork -f uns
.PHONY: zdtm-snapshot
zdtm-iter:
./zdtm.py run --iters 3:1 -t zdtm/transition/fork -f uns
.PHONY: zdtm-iter
zdtm-freezer:
./zdtm.py run --test zdtm/transition/thread-bomb --pre 3 --freezecg zdtm:t
./zdtm.py run --test zdtm/transition/thread-bomb --pre 3 --freezecg zdtm:f
.PHONY: zdtm-freezer
.PHONY: zdtm
fault-injection: .FORCE
fault-injection:
$(MAKE) -C fault-injection
.PHONY: fault-injection
@@ -49,6 +50,7 @@ override CFLAGS += -D_GNU_SOURCE
clean_root:
$(Q) ./zdtm.py clean nsroot
.PHONY: clean_root
clean: clean_root
$(RM) zdtm_ct zdtm-tst-list
@@ -58,5 +60,4 @@ clean: clean_root
$(Q) $(MAKE) -C libcriu clean
$(Q) $(MAKE) -C rpc clean
$(Q) $(MAKE) -C crit clean
.PHONY: zdtm_ns
.PHONY: clean