aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile56
1 files changed, 29 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index b4019426fa25..a940eaefe1c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 17 3SUBLEVEL = 17
4EXTRAVERSION =-rc1 4EXTRAVERSION =-rc2
5NAME=Sliding Snow Leopard 5NAME=Sliding Snow Leopard
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -1112,7 +1112,6 @@ modules_install: _emodinst_ _emodinst_post
1112install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) 1112install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
1113PHONY += _emodinst_ 1113PHONY += _emodinst_
1114_emodinst_: 1114_emodinst_:
1115 $(Q)rm -rf $(MODLIB)/$(install-dir)
1116 $(Q)mkdir -p $(MODLIB)/$(install-dir) 1115 $(Q)mkdir -p $(MODLIB)/$(install-dir)
1117 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst 1116 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
1118 1117
@@ -1275,40 +1274,43 @@ kernelversion:
1275 1274
1276# Single targets 1275# Single targets
1277# --------------------------------------------------------------------------- 1276# ---------------------------------------------------------------------------
1278# The directory part is taken from first prerequisite, so this 1277# Single targets are compatible with:
1279# works even with external modules 1278# - build whith mixed source and output
1279# - build with separate output dir 'make O=...'
1280# - external modules
1281#
1282# target-dir => where to store outputfile
1283# build-dir => directory in kernel source tree to use
1284
1285ifeq ($(KBUILD_EXTMOD),)
1286 build-dir = $(patsubst %/,%,$(dir $@))
1287 target-dir = $(dir $@)
1288else
1289 zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
1290 build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
1291 target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
1292endif
1293
1280%.s: %.c prepare scripts FORCE 1294%.s: %.c prepare scripts FORCE
1281 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1295 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1282%.i: %.c prepare scripts FORCE 1296%.i: %.c prepare scripts FORCE
1283 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1297 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1284%.o: %.c prepare scripts FORCE 1298%.o: %.c prepare scripts FORCE
1285 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1299 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1286%.lst: %.c prepare scripts FORCE 1300%.lst: %.c prepare scripts FORCE
1287 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1301 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1288%.s: %.S prepare scripts FORCE 1302%.s: %.S prepare scripts FORCE
1289 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1303 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1290%.o: %.S prepare scripts FORCE 1304%.o: %.S prepare scripts FORCE
1291 $(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@) 1305 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1292
1293# For external modules we shall include any directory of the target,
1294# but usual case there is no directory part.
1295# make M=`pwd` module.o => $(dir $@)=./
1296# make M=`pwd` foo/module.o => $(dir $@)=foo/
1297# make M=`pwd` / => $(dir $@)=/
1298
1299ifeq ($(KBUILD_EXTMOD),)
1300 target-dir = $(@D)
1301else
1302 zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
1303 target-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
1304endif
1305 1306
1306/ %/: scripts prepare FORCE 1307# Modules
1308/ %/: prepare scripts FORCE
1307 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1309 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1308 $(build)=$(target-dir) 1310 $(build)=$(build-dir)
1309%.ko: scripts FORCE 1311%.ko: prepare scripts FORCE
1310 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1312 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1311 $(build)=$(target-dir) $(@:.ko=.o) 1313 $(build)=$(build-dir) $(@:.ko=.o)
1312 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost 1314 $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
1313 1315
1314# FIXME Should go into a make.lib or something 1316# FIXME Should go into a make.lib or something