ia64/xen-unstable

changeset 9343:4813462ed4f9

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@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Mar 20 18:36:35 2006 +0100 (2006-03-20)
parents 0d9855e12426
children b9486f0d6970
files xen/Post.mk xen/arch/x86/Makefile xen/arch/x86/cpu/Makefile xen/arch/x86/hvm/Makefile xen/arch/x86/hvm/svm/Makefile xen/arch/x86/hvm/vmx/Makefile xen/drivers/Makefile
line diff
     1.1 --- a/xen/Post.mk	Mon Mar 20 18:25:01 2006 +0100
     1.2 +++ b/xen/Post.mk	Mon Mar 20 18:36:35 2006 +0100
     1.3 @@ -1,7 +1,16 @@
     1.4 +# Ensure each subdirectory has exactly one trailing slash.
     1.5 +subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
     1.6 +subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
     1.7  
     1.8 -subdirs-all := $(subdirs-y) $(subdirs-n)
     1.9 +# Add explicitly declared subdirectories to the object list.
    1.10 +obj-y += $(patsubst %,%/built_in.o,$(subdir-y))
    1.11  
    1.12 -obj-y += $(patsubst %,%/built_in.o,$(subdirs-y))
    1.13 +# Add implicitly declared subdirectories (in the object list) to the
    1.14 +# subdirectory list, and rewrite the object-list entry.
    1.15 +subdir-y += $(filter %/,$(obj-y))
    1.16 +obj-y    := $(patsubst %/,%/built-in.o,$(obj-y))
    1.17 +
    1.18 +subdir-all := $(subdir-y) $(subdir-n)
    1.19  
    1.20  built_in.o: $(obj-y)
    1.21  	$(LD) $(LDFLAGS) -r -o $@ $^
    1.22 @@ -12,7 +21,7 @@ FORCE:
    1.23  %/built_in.o: FORCE
    1.24  	$(MAKE) -C $*
    1.25  
    1.26 -clean:: $(addprefix _clean_, $(subdirs-all)) FORCE
    1.27 +clean:: $(addprefix _clean_, $(subdir-all)) FORCE
    1.28  	rm -f *.o *~ core
    1.29  _clean_%/: FORCE
    1.30  	$(MAKE) -C $* clean
     2.1 --- a/xen/arch/x86/Makefile	Mon Mar 20 18:25:01 2006 +0100
     2.2 +++ b/xen/arch/x86/Makefile	Mon Mar 20 18:36:35 2006 +0100
     2.3 @@ -1,12 +1,12 @@
     2.4  include $(BASEDIR)/Rules.mk
     2.5  
     2.6 -subdirs-y += acpi
     2.7 -subdirs-y += cpu
     2.8 -subdirs-y += genapic
     2.9 -subdirs-y += hvm
    2.10 +subdir-y += acpi
    2.11 +subdir-y += cpu
    2.12 +subdir-y += genapic
    2.13 +subdir-y += hvm
    2.14  
    2.15 -subdirs-$(x86_32) += x86_32
    2.16 -subdirs-$(x86_64) += x86_64
    2.17 +subdir-$(x86_32) += x86_32
    2.18 +subdir-$(x86_64) += x86_64
    2.19  
    2.20  obj-y += apic.o
    2.21  obj-y += audit.o
     3.1 --- a/xen/arch/x86/cpu/Makefile	Mon Mar 20 18:25:01 2006 +0100
     3.2 +++ b/xen/arch/x86/cpu/Makefile	Mon Mar 20 18:36:35 2006 +0100
     3.3 @@ -1,7 +1,7 @@
     3.4  include $(BASEDIR)/Rules.mk
     3.5  
     3.6 -subdirs-y += mcheck
     3.7 -subdirs-y += mtrr
     3.8 +subdir-y += mcheck
     3.9 +subdir-y += mtrr
    3.10  
    3.11  obj-y += amd.o
    3.12  obj-y += common.o
     4.1 --- a/xen/arch/x86/hvm/Makefile	Mon Mar 20 18:25:01 2006 +0100
     4.2 +++ b/xen/arch/x86/hvm/Makefile	Mon Mar 20 18:36:35 2006 +0100
     4.3 @@ -1,7 +1,7 @@
     4.4  include $(BASEDIR)/Rules.mk
     4.5  
     4.6 -subdirs-y += svm
     4.7 -subdirs-y += vmx
     4.8 +subdir-y += svm
     4.9 +subdir-y += vmx
    4.10  
    4.11  obj-y += hvm.o
    4.12  obj-y += i8259.o
     5.1 --- a/xen/arch/x86/hvm/svm/Makefile	Mon Mar 20 18:25:01 2006 +0100
     5.2 +++ b/xen/arch/x86/hvm/svm/Makefile	Mon Mar 20 18:36:35 2006 +0100
     5.3 @@ -1,7 +1,7 @@
     5.4  include $(BASEDIR)/Rules.mk
     5.5  
     5.6 -subdirs-$(x86_32) += x86_32
     5.7 -subdirs-$(x86_64) += x86_64
     5.8 +subdir-$(x86_32) += x86_32
     5.9 +subdir-$(x86_64) += x86_64
    5.10  
    5.11  obj-y += emulate.o
    5.12  obj-y += instrlen.o
     6.1 --- a/xen/arch/x86/hvm/vmx/Makefile	Mon Mar 20 18:25:01 2006 +0100
     6.2 +++ b/xen/arch/x86/hvm/vmx/Makefile	Mon Mar 20 18:36:35 2006 +0100
     6.3 @@ -1,7 +1,7 @@
     6.4  include $(BASEDIR)/Rules.mk
     6.5  
     6.6 -subdirs-$(x86_32) += x86_32
     6.7 -subdirs-$(x86_64) += x86_64
     6.8 +subdir-$(x86_32) += x86_32
     6.9 +subdir-$(x86_64) += x86_64
    6.10  
    6.11  obj-y += io.o
    6.12  obj-y += vmcs.o
     7.1 --- a/xen/drivers/Makefile	Mon Mar 20 18:25:01 2006 +0100
     7.2 +++ b/xen/drivers/Makefile	Mon Mar 20 18:36:35 2006 +0100
     7.3 @@ -1,6 +1,6 @@
     7.4  include $(BASEDIR)/Rules.mk
     7.5  
     7.6 -subdirs-y := char/
     7.7 -subdirs-$(HAS_ACPI) += acpi/
     7.8 +subdir-y += char
     7.9 +subdir-$(HAS_ACPI) += acpi
    7.10  
    7.11  include $(BASEDIR)/Post.mk