Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.5.8-pre3 /Rules.make

Filename:/Rules.make
Lines Added:20
Lines Deleted:8
Also changed in: (Previous) 2.5.8-pre2  2.5.8-pre1  2.5.7  2.5.7-pre2  2.5.5  2.5.5-pre1 
(Following) 2.5.8  2.5.9  2.5.11  2.5.13  2.5.17  2.5.18 

Location
[  2.5.8-pre3
   o  Rules.make

Patch

diff -Nru a/Rules.make b/Rules.make
--- a/Rules.make   Tue Apr  9 18:29:43 2002
+++ b/Rules.make   Tue Apr  9 18:29:43 2002
@@ -50,10 +50,10 @@
 #
 
 %.s: %.c
-   $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -S $< -o $@
+   $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -S $< -o $@
 
 %.i: %.c
-   $(CPP) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) $< > $@
+   $(CPP) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) $< > $@
 
 %.o: %.c
    $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -c -o $@ $<
@@ -126,11 +126,23 @@
 
 # for make >= 3.78 the following is cleaner:
 # multi-used := $(foreach m,$(obj-y) $(obj-m), $(if $($(basename $(m))-objs), $(m)))
-multi-used := $(sort $(foreach m,$(obj-y) $(obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
-ld-multi-used := $(filter-out $(list-multi),$(multi-used))
-ld-multi-objs := $(foreach m, $(ld-multi-used), $($(basename $(m))-objs))
+multi-used-y := $(sort $(foreach m,$(obj-y),$(patsubst %,$(m),$($(basename $(m))-objs))))
+multi-used-m := $(sort $(foreach m,$(obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
+ld-multi-used-y := $(filter-out $(list-multi),$(multi-used-y))
+ld-multi-used-m := $(filter-out $(list-multi),$(multi-used-m))
+ld-multi-objs-y := $(foreach m, $(ld-multi-used-y), $($(basename $(m))-objs))
+ld-multi-objs-m := $(foreach m, $(ld-multi-used-m), $($(basename $(m))-objs))
 
-$(ld-multi-used) : %.o: $(ld-multi-objs)
+$(ld-multi-used-y) : %.o: $(ld-multi-objs-y)
+   rm -f $@
+   $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
+   @ ( \
+       echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $+
$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \
+       echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
+       echo 'endif' \
+   ) > $(dir $@)/.$(notdir $@).flags
+
+$(ld-multi-used-m) : %.o: $(ld-multi-objs-m)
    rm -f $@
    $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
    @ ( \
@@ -153,7 +165,7 @@
    $(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep
 endif
 
-   
+
 #
 # A rule to make subdirectories
 #
@@ -250,7 +262,7 @@
       if [ -r $@ ] && cmp -s $@ $@.tmp; then echo $@ is unchanged; rm -f $@.tmp; \
       else echo mv $@.tmp $@; mv -f $@.tmp $@; fi; \
    fi; touch $(MODINCL)/$(MODPREFIX)$*.stamp
-   
+
 $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
 
 # updates .ver files but not modversions.h


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.