ia64/xen-unstable

view xen/Post.mk @ 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 768936b2800a
children
line source
1 # Ensure each subdirectory has exactly one trailing slash.
2 subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n)))
3 subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y)))
5 # Add explicitly declared subdirectories to the object list.
6 obj-y += $(patsubst %,%/built_in.o,$(subdir-y))
8 # Add implicitly declared subdirectories (in the object list) to the
9 # subdirectory list, and rewrite the object-list entry.
10 subdir-y += $(filter %/,$(obj-y))
11 obj-y := $(patsubst %/,%/built-in.o,$(obj-y))
13 subdir-all := $(subdir-y) $(subdir-n)
15 built_in.o: $(obj-y)
16 $(LD) $(LDFLAGS) -r -o $@ $^
18 .PHONY: FORCE
19 FORCE:
21 %/built_in.o: FORCE
22 $(MAKE) -C $*
24 clean:: $(addprefix _clean_, $(subdir-all)) FORCE
25 rm -f *.o *~ core
26 _clean_%/: FORCE
27 $(MAKE) -C $* clean