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

[Xen-changelog] Some more build-system finessing:



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4813462ed4f99e64f929d3235e7fd418faf69d53
# Parent  0d9855e12426ff764a7b58fba70438b6ef986388
Some more build-system finessing:
 1. subdirs-y -> subdir-y (match Linux name, and also obj-y
    is singular so this makes sense).
 2. subdirs can be declared with or without trailing slash
 3. As with Linux, subdirs can be declared in the obj-y list
    but they must be distinguished by a trailing slash

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 0d9855e12426 -r 4813462ed4f9 xen/Post.mk
--- a/xen/Post.mk       Mon Mar 20 17:25:01 2006
+++ b/xen/Post.mk       Mon Mar 20 17:36:35 2006
@@ -1,7 +1,16 @@
+# Ensure each subdirectory has exactly one trailing slash.
+subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
+subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
 
-subdirs-all := $(subdirs-y) $(subdirs-n)
+# Add explicitly declared subdirectories to the object list.
+obj-y += $(patsubst %,%/built_in.o,$(subdir-y))
 
-obj-y += $(patsubst %,%/built_in.o,$(subdirs-y))
+# Add implicitly declared subdirectories (in the object list) to the
+# subdirectory list, and rewrite the object-list entry.
+subdir-y += $(filter %/,$(obj-y))
+obj-y    := $(patsubst %/,%/built-in.o,$(obj-y))
+
+subdir-all := $(subdir-y) $(subdir-n)
 
 built_in.o: $(obj-y)
        $(LD) $(LDFLAGS) -r -o $@ $^
@@ -12,7 +21,7 @@
 %/built_in.o: FORCE
        $(MAKE) -C $*
 
-clean:: $(addprefix _clean_, $(subdirs-all)) FORCE
+clean:: $(addprefix _clean_, $(subdir-all)) FORCE
        rm -f *.o *~ core
 _clean_%/: FORCE
        $(MAKE) -C $* clean
diff -r 0d9855e12426 -r 4813462ed4f9 xen/arch/x86/Makefile
--- a/xen/arch/x86/Makefile     Mon Mar 20 17:25:01 2006
+++ b/xen/arch/x86/Makefile     Mon Mar 20 17:36:35 2006
@@ -1,12 +1,12 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-y += acpi
-subdirs-y += cpu
-subdirs-y += genapic
-subdirs-y += hvm
+subdir-y += acpi
+subdir-y += cpu
+subdir-y += genapic
+subdir-y += hvm
 
-subdirs-$(x86_32) += x86_32
-subdirs-$(x86_64) += x86_64
+subdir-$(x86_32) += x86_32
+subdir-$(x86_64) += x86_64
 
 obj-y += apic.o
 obj-y += audit.o
diff -r 0d9855e12426 -r 4813462ed4f9 xen/arch/x86/cpu/Makefile
--- a/xen/arch/x86/cpu/Makefile Mon Mar 20 17:25:01 2006
+++ b/xen/arch/x86/cpu/Makefile Mon Mar 20 17:36:35 2006
@@ -1,7 +1,7 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-y += mcheck
-subdirs-y += mtrr
+subdir-y += mcheck
+subdir-y += mtrr
 
 obj-y += amd.o
 obj-y += common.o
diff -r 0d9855e12426 -r 4813462ed4f9 xen/arch/x86/hvm/Makefile
--- a/xen/arch/x86/hvm/Makefile Mon Mar 20 17:25:01 2006
+++ b/xen/arch/x86/hvm/Makefile Mon Mar 20 17:36:35 2006
@@ -1,7 +1,7 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-y += svm
-subdirs-y += vmx
+subdir-y += svm
+subdir-y += vmx
 
 obj-y += hvm.o
 obj-y += i8259.o
diff -r 0d9855e12426 -r 4813462ed4f9 xen/arch/x86/hvm/svm/Makefile
--- a/xen/arch/x86/hvm/svm/Makefile     Mon Mar 20 17:25:01 2006
+++ b/xen/arch/x86/hvm/svm/Makefile     Mon Mar 20 17:36:35 2006
@@ -1,7 +1,7 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-$(x86_32) += x86_32
-subdirs-$(x86_64) += x86_64
+subdir-$(x86_32) += x86_32
+subdir-$(x86_64) += x86_64
 
 obj-y += emulate.o
 obj-y += instrlen.o
diff -r 0d9855e12426 -r 4813462ed4f9 xen/arch/x86/hvm/vmx/Makefile
--- a/xen/arch/x86/hvm/vmx/Makefile     Mon Mar 20 17:25:01 2006
+++ b/xen/arch/x86/hvm/vmx/Makefile     Mon Mar 20 17:36:35 2006
@@ -1,7 +1,7 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-$(x86_32) += x86_32
-subdirs-$(x86_64) += x86_64
+subdir-$(x86_32) += x86_32
+subdir-$(x86_64) += x86_64
 
 obj-y += io.o
 obj-y += vmcs.o
diff -r 0d9855e12426 -r 4813462ed4f9 xen/drivers/Makefile
--- a/xen/drivers/Makefile      Mon Mar 20 17:25:01 2006
+++ b/xen/drivers/Makefile      Mon Mar 20 17:36:35 2006
@@ -1,6 +1,6 @@
 include $(BASEDIR)/Rules.mk
 
-subdirs-y := char/
-subdirs-$(HAS_ACPI) += acpi/
+subdir-y += char
+subdir-$(HAS_ACPI) += acpi
 
 include $(BASEDIR)/Post.mk

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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