[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] 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.

Note that one subtle issue is that $(XEN_ROOT)/Config.mk tries to
include $(XEN_ROOT)/config/$(XEN_OS).mk. In stubdom's case XEN_OS is
"MiniOS". Then $(XEN_ROOT)/config/MiniOS.mk tries to include mini-os's
Config.mk.

Since clean and distclean don't enforce existence of mini-os tree, don't
include $(XEN_ROOT)/Config.mk to avoid getting error due to the
aforementioned issue.

Reported-by: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 stubdom/Makefile      | 13 ++++++++-----
 stubdom/c/Makefile    |  2 ++
 stubdom/caml/Makefile |  2 ++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 1a1f263..f339b20 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -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)
diff --git a/stubdom/c/Makefile b/stubdom/c/Makefile
index c646c26..b252dca 100644
--- a/stubdom/c/Makefile
+++ b/stubdom/c/Makefile
@@ -1,6 +1,8 @@
 XEN_ROOT = $(CURDIR)/../..
 
+ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 include $(XEN_ROOT)/Config.mk
+endif
 
 all: main.a
 
diff --git a/stubdom/caml/Makefile b/stubdom/caml/Makefile
index e79c98d..f550de1 100644
--- a/stubdom/caml/Makefile
+++ b/stubdom/caml/Makefile
@@ -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)
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.