Commit f50f7d01 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

make: Move all generated files cleanup to clean-built target

This allows to reuse the code and make rebuild to work correctly.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2f9f03a3
...@@ -109,7 +109,7 @@ build-crtools := -r -R --no-print-directory -f scripts/Makefile.build makefile=M ...@@ -109,7 +109,7 @@ build-crtools := -r -R --no-print-directory -f scripts/Makefile.build makefile=M
PROGRAM := crtools PROGRAM := crtools
.PHONY: all zdtm test rebuild clean distclean tags cscope \ .PHONY: all zdtm test rebuild clean distclean tags cscope \
docs help pie protobuf arch/$(ARCH) docs help pie protobuf arch/$(ARCH) clean-built
ifeq ($(GCOV),1) ifeq ($(GCOV),1)
%.o $(PROGRAM): override CFLAGS += --coverage %.o $(PROGRAM): override CFLAGS += --coverage
...@@ -148,25 +148,24 @@ zdtm: all ...@@ -148,25 +148,24 @@ zdtm: all
test: zdtm test: zdtm
$(Q) $(SH) test/zdtm.sh $(Q) $(SH) test/zdtm.sh
rebuild: clean-built:
$(E) " FORCE-REBUILD"
$(Q) $(RM) ./*.o
$(Q) $(RM) ./*.d
$(Q) $(RM) ./protobuf/*.pb-c.c
$(Q) $(RM) ./protobuf/*.pb-c.h
$(Q) $(MAKE)
clean:
$(E) " CLEAN"
$(Q) $(RM) $(VERSION_HEADER) $(Q) $(RM) $(VERSION_HEADER)
$(Q) $(MAKE) $(build)=arch/$(ARCH) clean $(Q) $(MAKE) $(build)=arch/$(ARCH) clean
$(Q) $(MAKE) $(build)=protobuf clean $(Q) $(MAKE) $(build)=protobuf clean
$(Q) $(MAKE) $(build)=pie clean $(Q) $(MAKE) $(build)=pie clean
$(Q) $(MAKE) $(build-crtools)=. clean $(Q) $(MAKE) $(build-crtools)=. clean
$(Q) $(MAKE) -C Documentation clean
$(Q) $(RM) ./$(PROGRAM)
rebuild: clean-built
$(E) " FORCE-REBUILD"
$(Q) $(MAKE)
clean: clean-built
$(E) " CLEAN"
$(Q) $(RM) ./*.img $(Q) $(RM) ./*.img
$(Q) $(RM) ./*.out $(Q) $(RM) ./*.out
$(Q) $(RM) ./*.bin $(Q) $(RM) ./*.bin
$(Q) $(RM) ./$(PROGRAM)
$(Q) $(RM) -r ./test/dump/ $(Q) $(RM) -r ./test/dump/
$(Q) $(RM) ./*.gcov ./*.gcda ./*.gcno $(Q) $(RM) ./*.gcov ./*.gcda ./*.gcno
$(Q) $(RM) -r ./gcov $(Q) $(RM) -r ./gcov
...@@ -175,7 +174,6 @@ clean: ...@@ -175,7 +174,6 @@ clean:
$(Q) $(MAKE) -C test/zdtm cleandep $(Q) $(MAKE) -C test/zdtm cleandep
$(Q) $(MAKE) -C test/zdtm clean $(Q) $(MAKE) -C test/zdtm clean
$(Q) $(MAKE) -C test/zdtm cleanout $(Q) $(MAKE) -C test/zdtm cleanout
$(Q) $(MAKE) -C Documentation clean
distclean: clean distclean: clean
$(E) " DISTCLEAN" $(E) " DISTCLEAN"
......
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