git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
scripts
/
Makefile.build
diff --git
a/scripts/Makefile.build
b/scripts/Makefile.build
index
672b008
..
e2ad2dc
100644
(file)
--- a/
scripts/Makefile.build
+++ b/
scripts/Makefile.build
@@
-4,13
+4,17
@@
src := $(obj)
src := $(obj)
-
.PHONY:
__build
+
PHONY :=
__build
__build:
# Read .config if it exist, otherwise ignore
__build:
# Read .config if it exist, otherwise ignore
--include
.config
+-include
include/config/auto.conf
-include $(obj)/Makefile
+include scripts/Kbuild.include
+
+# The filename Kbuild has precedence over Makefile
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
include scripts/Makefile.lib
include scripts/Makefile.lib
@@
-113,7
+117,7
@@
$(real-objs-m:.o=.lst): quiet_modtag := [M]
$(obj-m) : quiet_modtag := [M]
# Default for not multi-part modules
$(obj-m) : quiet_modtag := [M]
# Default for not multi-part modules
-modname = $(
*F
)
+modname = $(
basetarget
)
$(multi-objs-m) : modname = $(modname-multi)
$(multi-objs-m:.o=.i) : modname = $(modname-multi)
$(multi-objs-m) : modname = $(modname-multi)
$(multi-objs-m:.o=.i) : modname = $(modname-multi)
@@
-125,7
+129,7
@@
$(multi-objs-y:.o=.s) : modname = $(modname-multi)
$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
-cmd_cc_s_c = $(CC) $(c_flags) -
S -o $@ $<
+cmd_cc_s_c = $(CC) $(c_flags) -
fverbose-asm -S -o $@ $<
%.s: %.c FORCE
$(call if_changed_dep,cc_s_c)
%.s: %.c FORCE
$(call if_changed_dep,cc_s_c)
@@
-136,6
+140,15
@@
cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i: %.c FORCE
$(call if_changed_dep,cc_i_c)
%.i: %.c FORCE
$(call if_changed_dep,cc_i_c)
+quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
+cmd_cc_symtypes_c = \
+ $(CPP) -D__GENKSYMS__ $(c_flags) $< \
+ | $(GENKSYMS) -T $@ >/dev/null; \
+ test -s $@ || rm -f $@
+
+%.symtypes : %.c FORCE
+ $(call if_changed_dep,cc_symtypes_c)
+
# C (.c) files
# The C file is compiled and updated dependency information is generated.
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
# C (.c) files
# The C file is compiled and updated dependency information is generated.
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
@@
-162,26
+175,26
@@
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
cmd_modversions = \
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
cmd_modversions = \
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
- | $(GENKSYMS) \
+ | $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
+ -T $(@D)/$(@F:.o=.symtypes)) -a $(ARCH) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
- mv
$(@D)/.tmp_$(@F) $@;
\
+ mv
-f $(@D)/.tmp_$(@F) $@;
\
fi;
endif
define rule_cc_o_c
fi;
endif
define rule_cc_o_c
- $(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \
- $(cmd_checksrc) \
- $(if $($(quiet)cmd_cc_o_c),echo ' $($(quiet)cmd_cc_o_c)';) \
- $(cmd_cc_o_c); \
+ $(call echo-cmd,checksrc) $(cmd_checksrc) \
+ $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
$(cmd_modversions) \
$(cmd_modversions) \
- scripts/basic/fixdep $(depfile) $@ '$(cmd_cc_o_c)' > $(@D)/.$(@F).tmp; \
+ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
+ $(dot-target).tmp; \
rm -f $(depfile); \
rm -f $(depfile); \
- mv -f $(
@D)/.$(@F).tmp $(@D)/.$(@F
).cmd
+ mv -f $(
dot-target).tmp $(dot-target
).cmd
endef
# Built-in and composite module parts
endef
# Built-in and composite module parts
@@
-306,14
+319,14
@@
targets += $(multi-used-y) $(multi-used-m)
# Descending
# ---------------------------------------------------------------------------
# Descending
# ---------------------------------------------------------------------------
-
.PHONY:
$(subdir-ym)
+
PHONY +=
$(subdir-ym)
$(subdir-ym):
$(Q)$(MAKE) $(build)=$@
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
$(subdir-ym):
$(Q)$(MAKE) $(build)=$@
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
-
.PHONY:
FORCE
+
PHONY +=
FORCE
FORCE:
FORCE:
@@
-328,3
+341,9
@@
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
endif
ifneq ($(cmd_files),)
include $(cmd_files)
endif
+
+
+# Declare the contents of the .PHONY variable as phony. We keep that
+# information in a variable se we can use it in if_changed and friends.
+
+.PHONY: $(PHONY)