diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:41:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:41:02 -0400 |
commit | 2514395ef88b46e895726a8d40966cb83de7940c (patch) | |
tree | 216c6e194e81bdd9c97697cf162cc9505bde310a /Makefile | |
parent | b3967dc566bc89df19e9aeb87b2fd483418b02e6 (diff) | |
parent | b5ac4817de3032796c558b0a32062e7392b5ea60 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
kconfig: fix typo in change count initialization
kconfig: recenter menuconfig
kconfig: revert conf behaviour change
kconfig: fix default value for choice input
kbuild: fix NULL dereference in scripts/mod/modpost.c
kbuild: fix mode of checkstack.pl and other files.
kbuild: rebuild initramfs if content of initramfs changes
kbuild: properly pass options to hostcc when doing make O=..
kbuild: modules_install for external modules must not remove existing modules
kbuild: fix make dir/
ver_linux: don't print reiser4progs version if none found
kbuild: mips: fix sed regexp to generate asm-offset.h
kbuild: fix building single targets with make O=.. single-target
kbuild: use relative path to -I
kbuild: fix unneeded rebuilds in drivers/net/chelsio after moving source tree
kbuild: fix unneeded rebuilds in drivers/media/video after moving source tree
kbuild: fix garbled text in modules.txt
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 54 |
1 files changed, 28 insertions, 26 deletions
@@ -1112,7 +1112,6 @@ modules_install: _emodinst_ _emodinst_post | |||
1112 | install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) | 1112 | install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) |
1113 | PHONY += _emodinst_ | 1113 | PHONY += _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 | |||
1285 | ifeq ($(KBUILD_EXTMOD),) | ||
1286 | build-dir = $(patsubst %/,%,$(dir $@)) | ||
1287 | target-dir = $(dir $@) | ||
1288 | else | ||
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 $@)) | ||
1292 | endif | ||
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 | |||
1299 | ifeq ($(KBUILD_EXTMOD),) | ||
1300 | target-dir = $(@D) | ||
1301 | else | ||
1302 | zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) | ||
1303 | target-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) | ||
1304 | endif | ||
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 |