stubdom: fix make clean and distclean on a freshly cloned tree
PATCH 1/1 stubdom: fix make clean and distclean on a freshly cloned tree
Clean and distclean targets need not depend on existence of the mini-os tree. Don't check for mini-os and don't try to blindly include mini-os's Config.mk when doing clean and distclean.
--- stubdom/Makefile | 13 ++++++++----- stubdom/c/Makefile | 2 ++ stubdom/caml/Makefile | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-)
stubdom/Makefile +8 -5
@@ -1,15 +1,18 @@ XEN_ROOT = $(CURDIR)/.. MINI_OS = $(XEN_ROOT)/extras/mini-os -ifeq ($(wildcard $(MINI_OS)/Config.mk),) -$(error Please run `make mini-os-dir' in top-level directory) -endif - export XEN_OS=MiniOS export stubdom=y export debug=y -include $(XEN_ROOT)/Config.mk + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) + ifeq ($(wildcard $(MINI_OS)/Config.mk),) + $(error Please run `make mini-os-dir' in top-level directory) + endif + include $(XEN_ROOT)/Config.mk +endif + -include $(XEN_ROOT)/config/Stubdom.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
stubdom/c/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. +ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk +endif all: main.a
stubdom/caml/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. +ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk +endif CAMLLIB = $(shell $(OCAMLC_CROSS_PREFIX)ocamlc -where) DEF_CPPFLAGS += -I$(CAMLLIB)
Signature · 1 line
1.9.1
CC Samuel and Stefano.
Quoted 70 lines · Wei Liu
Clean and distclean targets need not depend on existence of the mini-os tree. Don't check for mini-os and don't try to blindly include mini-os's Config.mk when doing clean and distclean.
Reported-by Sander Eikelenboom <[email protected]>Signed-off-by Wei Liu <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- stubdom/Makefile | 13 ++++++++----- stubdom/c/Makefile | 2 ++ stubdom/caml/Makefile | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-)stubdom/Makefile +8
-5@@ -1,15 +1,18 @@ XEN_ROOT = $(CURDIR)/.. MINI_OS = $(XEN_ROOT)/extras/mini-os -ifeq ($(wildcard $(MINI_OS)/Config.mk),) -$(error Please run `make mini-os-dir' in top-level directory) -endif - export XEN_OS=MiniOS export stubdom=y export debug=y -include $(XEN_ROOT)/Config.mk + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) + ifeq ($(wildcard $(MINI_OS)/Config.mk),) + $(error Please run `make mini-os-dir' in top-level directory) + endif + include $(XEN_ROOT)/Config.mk +endif + -include $(XEN_ROOT)/config/Stubdom.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)stubdom/c/Makefile +2
-0@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. +ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk +endif all: main.astubdom/caml/Makefile +2
-0@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. +ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk +endif CAMLLIB = $(shell $(OCAMLC_CROSS_PREFIX)ocamlc -where) DEF_CPPFLAGS += -I$(CAMLLIB)Signature · 1 line
1.9.1
Quoted 8 lines · Wei Liu
stubdom/Makefile
Quoted 8 lines
stubdom/Makefile +6
-1-include $(XEN_ROOT)/Config.mk + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) + ifeq ($(wildcard $(MINI_OS)/Config.mk),) + $(error Please run `make mini-os-dir' in top-level directory) + endif + include $(XEN_ROOT)/Config.mk
I'm not sure why the inclusion of this apparently unrelated file ($(MINI_OS) vs $(XEN_ROOT) is conditionalised here.
If that wasn't here then the two ifeq's could be combined into something like:
ifeq(,$(findstring clean,$(MAKECMDGOALS)$(wildcard $(MINI_OS)/Config.mk))
or is that too subtle?
Quoted 12 lines
Quoted 12 lines
stubdom/Makefile +2
-0+endif + -include $(XEN_ROOT)/config/Stubdom.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)stubdom/c/Makefile +0
-0@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../..
Quoted 2 lines
stubdom/c/Makefile line 4
Quoted 2 lines
stubdom/c/Makefile +1
-0+ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk
XEN_ROOT/Config.mk always exists. Did you misread it as MINI_OS?
(and in the next hunk too)
Quoted 13 lines · Ian Campbell
Quoted 8 lines · Wei Liu
stubdom/Makefile
Quoted 8 lines
stubdom/Makefile +6
-1-include $(XEN_ROOT)/Config.mk + +ifeq (,$(findstring clean,$(MAKECMDGOALS))) + ifeq ($(wildcard $(MINI_OS)/Config.mk),) + $(error Please run `make mini-os-dir' in top-level directory) + endif + include $(XEN_ROOT)/Config.mkI'm not sure why the inclusion of this apparently unrelated file ($(MINI_OS) vs $(XEN_ROOT) is conditionalised here.
Quoted 7 lines
If that wasn't here then the two ifeq's could be combined into something like:
ifeq(,$(findstring clean,$(MAKECMDGOALS)$(wildcard $(MINI_OS)/Config.mk))
or is that too subtle?
A bit subtle to me. I used the same line for all three locations so it might be easier to understand the condition.
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
stubdom/Makefile +2
-0+endif + -include $(XEN_ROOT)/config/Stubdom.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)stubdom/c/Makefile +0
-0@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../..
Quoted 5 lines
Quoted 2 lines
stubdom/c/Makefile line 4
Quoted 2 lines
stubdom/c/Makefile +1
-0+ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk
XEN_ROOT/Config.mkalways exists. Did you misread it asMINI_OS?
No, I don't think I misread.
The subtle thing is that XEN_ROOT/Config.mk has
include $(XEN_ROOT)/config/$(XEN_OS).mk
Here XEN_OS=MiniOS. Then in MiniOS.mk
include $(XEN_ROOT)/extras/mini-os/Config.mk
If you don't have extra/mini-os you get an error.
Wei.
Quoted 2 lines
(and in the next hunk too)
Quoted 22 lines · Wei Liu
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
stubdom/Makefile +2
-0+endif + -include $(XEN_ROOT)/config/Stubdom.mk GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)stubdom/c/Makefile +0
-0@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../..Quoted 5 lines
Quoted 2 lines
stubdom/c/Makefile line 4
Quoted 2 lines
stubdom/c/Makefile +1
-0+ifeq (,$(findstring clean,$(MAKECMDGOALS))) include $(XEN_ROOT)/Config.mk
XEN_ROOT/Config.mkalways exists. Did you misread it asMINI_OS?No, I don't think I misread.
The subtle thing is that
XEN_ROOT/Config.mkhas
Quoted 7 lines
include $(XEN_ROOT)/config/$(XEN_OS).mkHere XEN_OS=MiniOS. Then in MiniOS.mk
include $(XEN_ROOT)/extras/mini-os/Config.mkIf you don't have extra/mini-os you get an error.
Ah, that is definitely worth spelling out in the commit log.
(this is the underlying cause of the comments on the first hunk too)
Quoted 5 lines
Wei.
Quoted 2 lines
(and in the next hunk too)