ia64/xen-unstable

changeset 12938:b58670602d35

[POWERPC][XEN] Builtin cmdline dependency rule
Rebuild cmdline.o when the user changes the CMDLINE=X argument passed to
the make invocation. I couldn't find an example of another project that
handles this case properly, so I came up with this.
Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Oct 05 15:48:26 2006 -0500 (2006-10-05)
parents 020fc58ba873
children 7a4330bd4c5c
files .hgignore xen/arch/powerpc/Makefile
line diff
     1.1 --- a/.hgignore	Wed Oct 04 17:27:16 2006 -0500
     1.2 +++ b/.hgignore	Thu Oct 05 15:48:26 2006 -0500
     1.3 @@ -222,6 +222,7 @@
     1.4  ^xen/arch/powerpc/xen\.lds$
     1.5  ^xen/arch/powerpc/.xen-syms$
     1.6  ^xen/arch/powerpc/xen-syms.S$
     1.7 +^xen/arch/powerpc/cmdline.dep$
     1.8  ^unmodified_drivers/linux-2.6/\.tmp_versions
     1.9  ^unmodified_drivers/linux-2.6/.*\.cmd$
    1.10  ^unmodified_drivers/linux-2.6/.*\.ko$
     2.1 --- a/xen/arch/powerpc/Makefile	Wed Oct 04 17:27:16 2006 -0500
     2.2 +++ b/xen/arch/powerpc/Makefile	Thu Oct 05 15:48:26 2006 -0500
     2.3 @@ -80,6 +80,20 @@ ifneq ($(CMDLINE),)
     2.4  # The first token in the arguments will be silently dropped.
     2.5  FULL_CMDLINE := xen $(CMDLINE)
     2.6  endif
     2.7 +
     2.8 +ifeq ($(wildcard cmdline.dep),)
     2.9 +cmdline.dep:
    2.10 +	echo $(FULL_CMDLINE) > cmdline.dep
    2.11 +else
    2.12 +ifneq ($(FULL_CMDLINE),$(shell cat cmdline.dep))
    2.13 +cmdline.dep::
    2.14 +	echo $(FULL_CMDLINE) > cmdline.dep
    2.15 +else
    2.16 +cmdline.dep:
    2.17 +endif
    2.18 +endif
    2.19 +
    2.20 +cmdline.o: cmdline.dep
    2.21  cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\""
    2.22  
    2.23  TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds
    2.24 @@ -123,4 +137,4 @@ dom0.bin: $(DOM0_IMAGE)
    2.25  
    2.26  clean::
    2.27  	$(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean
    2.28 -	rm -f firmware firmware_image.bin dom0.bin .xen-syms
    2.29 +	rm -f firmware firmware_image.bin dom0.bin .xen-syms cmdline.dep