]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
stubdom: fix make clean and distclean on a freshly cloned tree
authorWei Liu <wei.liu2@citrix.com>
Mon, 2 Mar 2015 15:05:43 +0000 (15:05 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 2 Mar 2015 16:27:38 +0000 (16:27 +0000)
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@eikelenboom.it>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
stubdom/Makefile
stubdom/c/Makefile
stubdom/caml/Makefile

index 1a1f26330b40f2cfd9d78a3114e4cae3efdaf0cc..f339b200b8c5f1179fe004ef8ff4c1096d64555b 100644 (file)
@@ -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)
index c646c26e74f17afb77931b79110daa706d0b46ec..b252dcad0b50767eca4d82e9477e90410d8eb0d7 100644 (file)
@@ -1,6 +1,8 @@
 XEN_ROOT = $(CURDIR)/../..
 
+ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 include $(XEN_ROOT)/Config.mk
+endif
 
 all: main.a
 
index e79c98df135715f9cb06c0cba8d58426cee9daa2..f550de1680a71df3de12175df47d2ea0b8444caf 100644 (file)
@@ -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)