ChangeSet 1.2231.1.110, 2005/03/28 19:47:08-08:00, [EMAIL PROTECTED]

        [PATCH] uml - kbuild: link cmd
        
        Use the cmd_* syntax to define a command for symlink creations in UML 
(to
        reuse files from other archs).
        
        Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 scripts/Makefile.rules |    3 +++
 sys-i386/Makefile      |   13 +++++--------
 sys-x86_64/Makefile    |   16 ++++++++--------
 3 files changed, 16 insertions(+), 16 deletions(-)


diff -Nru a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
--- a/arch/um/scripts/Makefile.rules    2005-03-28 21:30:41 -08:00
+++ b/arch/um/scripts/Makefile.rules    2005-03-28 21:30:41 -08:00
@@ -8,3 +8,6 @@
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS): c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir 
$@))
+
+quiet_cmd_make_link = SYMLINK $@
+cmd_make_link       = rm -f $@; ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir 
$@)-dir)/$(notdir $@) $@
diff -Nru a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
--- a/arch/um/sys-i386/Makefile 2005-03-28 21:30:41 -08:00
+++ b/arch/um/sys-i386/Makefile 2005-03-28 21:30:41 -08:00
@@ -14,19 +14,16 @@
 # complete paths like $(src)/$f.
 clean-files := $(SYMLINKS)
 
-SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
+targets += $(SYMLINKS)
+
+SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f)
 
 bitops.c-dir = lib
 semaphore.c-dir = kernel
 highmem.c-dir = mm
 module.c-dir = kernel
 
-define make_link
-       -rm -f $1
-       ln -sf $(srctree)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
-endef
-
-$(SYMLINKS): 
-       $(call make_link,$@)
+$(SYMLINKS): FORCE
+       $(call if_changed,make_link)
 
 subdir- := util
diff -Nru a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile
--- a/arch/um/sys-x86_64/Makefile       2005-03-28 21:30:41 -08:00
+++ b/arch/um/sys-x86_64/Makefile       2005-03-28 21:30:41 -08:00
@@ -14,10 +14,15 @@
 
 SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \
        semaphore.c thunk.S
-SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
 
+# this needs to be before the foreach, because clean-files does not accept
+# complete paths like $(src)/$f.
 clean-files := $(SYMLINKS)
 
+targets += $(SYMLINKS)
+
+SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f)
+
 bitops.c-dir = lib
 csum-copy.S-dir = lib
 csum-partial.c-dir = lib
@@ -26,12 +31,7 @@
 semaphore.c-dir = kernel
 thunk.S-dir = lib
 
-define make_link
-       -rm -f $1
-       ln -sf $(srctree)/arch/x86_64/$($(notdir $1)-dir)/$(notdir $1) $1
-endef
-
-$(SYMLINKS):
-       $(call make_link,$@)
+$(SYMLINKS): FORCE
+       $(call if_changed,make_link)
 
 CFLAGS_csum-partial.o := -Dcsum_partial=arch_csum_partial
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to