Commit 029650bf authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

build: Unify phony forms usage

Explicit .PHONY is preferred for style unification sake.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b8df05e6
...@@ -107,7 +107,7 @@ CFLAGS += $(WARNINGS) $(DEFINES) ...@@ -107,7 +107,7 @@ CFLAGS += $(WARNINGS) $(DEFINES)
# Protobuf images first, they are not depending # Protobuf images first, they are not depending
# on anything else. # on anything else.
$(eval $(call gen-built-in,images)) $(eval $(call gen-built-in,images))
PHONY += images .PHONY: images
# #
# CRIU building done in own directory # CRIU building done in own directory
...@@ -131,23 +131,23 @@ lib/%: criu ...@@ -131,23 +131,23 @@ lib/%: criu
$(Q) $(MAKE) -C lib $@ $(Q) $(MAKE) -C lib $@
lib: criu lib: criu
$(Q) $(MAKE) -C lib all $(Q) $(MAKE) -C lib all
PHONY += lib .PHONY: lib
all: criu lib all: criu lib
PHONY += all .PHONY: all
clean-built: clean-built:
$(Q) $(MAKE) $(build)=images clean $(Q) $(MAKE) $(build)=images clean
$(Q) $(MAKE) -C criu clean $(Q) $(MAKE) -C criu clean
$(Q) $(MAKE) -C lib clean $(Q) $(MAKE) -C lib clean
$(Q) $(MAKE) -C Documentation clean $(Q) $(MAKE) -C Documentation clean
PHONY += clean-built .PHONY: clean-built
clean: clean-built clean: clean-built
$(call msg-clean, criu) $(call msg-clean, criu)
$(Q) $(RM) cscope.* $(Q) $(RM) cscope.*
$(Q) $(RM) tags TAGS $(Q) $(RM) tags TAGS
PHONY += clean .PHONY: clean
# #
# Non-CRIU stuff. # Non-CRIU stuff.
...@@ -155,15 +155,15 @@ PHONY += clean ...@@ -155,15 +155,15 @@ PHONY += clean
docs: docs:
$(Q) $(MAKE) -s -C Documentation all $(Q) $(MAKE) -s -C Documentation all
PHONY += docs .PHONY: docs
zdtm: all zdtm: all
$(Q) MAKEFLAGS= $(MAKE) -C test/zdtm all $(Q) MAKEFLAGS= $(MAKE) -C test/zdtm all
PHONY += zdtm .PHONY: zdtm
test: zdtm test: zdtm
$(Q) MAKEFLAGS= $(MAKE) -C test $(Q) MAKEFLAGS= $(MAKE) -C test
PHONY += test .PHONY: test
# #
# Generating tar requires tag matched CRIU_VERSION. # Generating tar requires tag matched CRIU_VERSION.
...@@ -184,20 +184,20 @@ tags: ...@@ -184,20 +184,20 @@ tags:
$(call msg-gen, $@) $(call msg-gen, $@)
$(Q) $(RM) tags $(Q) $(RM) tags
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(CTAGS) -a $(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(CTAGS) -a
PHONY += tags .PHONY: tags
etags: etags:
$(call msg-gen, $@) $(call msg-gen, $@)
$(Q) $(RM) TAGS $(Q) $(RM) TAGS
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(ETAGS) -a $(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(ETAGS) -a
PHONY += etags .PHONY: etags
cscope: cscope:
$(call msg-gen, $@) $(call msg-gen, $@)
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' ! -type l -print > cscope.files $(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' ! -type l -print > cscope.files
$(Q) $(CSCOPE) -bkqu $(Q) $(CSCOPE) -bkqu
PHONY += cscope .PHONY: cscope
gcov: gcov:
$(E) " GCOV" $(E) " GCOV"
...@@ -206,16 +206,15 @@ gcov: ...@@ -206,16 +206,15 @@ gcov:
cd gcov && \ cd gcov && \
genhtml --rc lcov_branch_coverage=1 --output-directory html criu.info genhtml --rc lcov_branch_coverage=1 --output-directory html criu.info
@echo "Code coverage report is in `pwd`/gcov/html/ directory." @echo "Code coverage report is in `pwd`/gcov/html/ directory."
PHONY += gcov .PHONY: gcov
docker-build: docker-build:
$(MAKE) -C scripts/build/ x86_64 $(MAKE) -C scripts/build/ x86_64
.PHONY: docker-build
PHONY += docker-build
docker-test: docker-test:
docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup docker run --rm -it --privileged criu-x86_64 ./test/zdtm.py run -a -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup
PHONY += docker-test .PHONY: docker-test
help: help:
@echo ' Targets:' @echo ' Targets:'
...@@ -232,12 +231,10 @@ help: ...@@ -232,12 +231,10 @@ help:
@echo ' rebuild - Force-rebuild of [*] targets' @echo ' rebuild - Force-rebuild of [*] targets'
@echo ' test - Run zdtm test-suite' @echo ' test - Run zdtm test-suite'
@echo ' gcov - Make code coverage report' @echo ' gcov - Make code coverage report'
PHONY += help .PHONY: help
include Makefile.install include Makefile.install
.PHONY: $(PHONY)
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
# #
......
...@@ -16,14 +16,18 @@ c/$(CRIU_SO): c/built-in.o ...@@ -16,14 +16,18 @@ c/$(CRIU_SO): c/built-in.o
$(call msg-link, $@) $(call msg-link, $@)
$(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS) $(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
lib-c: c/$(CRIU_SO) lib-c: c/$(CRIU_SO)
PHONY += lib-c .PHONY: lib-c
# #
# Python bindings. # Python bindings.
lib-py: lib-py:
$(call msg-gen, $@) $(call msg-gen, $@)
$(Q) $(MAKE) -C py all $(Q) $(MAKE) -C py all
PHONY += lib-py .PHONY: lib-py
all: lib-c lib-py
@true
.PHONY: all
clean: clean:
$(call msg-clean, lib-c) $(call msg-clean, lib-c)
...@@ -32,10 +36,7 @@ clean: ...@@ -32,10 +36,7 @@ clean:
$(Q) $(RM) c/criu.pc $(Q) $(RM) c/criu.pc
$(call msg-clean, lib-py) $(call msg-clean, lib-py)
$(Q) $(MAKE) -C py $@ $(Q) $(MAKE) -C py $@
.PHONY: clean
all: $(PHONY)
@true
PHONY += all
install: lib-c lib-py ../crit/crit c/criu.pc.in install: lib-c lib-py ../crit/crit c/criu.pc.in
$(E) " INSTALL " $(CRIU_SO) $(E) " INSTALL " $(CRIU_SO)
...@@ -52,5 +53,3 @@ install: lib-c lib-py ../crit/crit c/criu.pc.in ...@@ -52,5 +53,3 @@ install: lib-c lib-py ../crit/crit c/criu.pc.in
$(E) " INSTALL " crit $(E) " INSTALL " crit
$(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) $(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
.PHONY: install .PHONY: install
.PHONY: $(PHONY) clean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment