summaryrefslogtreecommitdiff
path: root/scripts/Makefile.modpost
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-12 01:05:40 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-12 01:05:40 -0700
commit07e5823127155b3a29003aca926f87c9843f6810 (patch)
tree017708141514420c45c43802f4cfa7c20f1f16e6 /scripts/Makefile.modpost
parenta065cde36a7889a058dcbcbebfb01c78cc19b0a8 (diff)
[PATCH] kbuild: external module support
From: Sam Ravnborg <sam@ravnborg.org> Based on initial patch from Andreas Gruenbacher there is now better support for building external modules with kbuild. The preferred syntax is now: make -C $KERNELSRC M=$PWD but the old syntax: make -C $KERNELSRC SUBDIRS=$PWD modules will remain supported. The major differences compared to before are that: 1) No attempt is made to neither check nor update any files in $KERNELSRC 2) Module versions are now supported During stage 2 of kernel compilation where the modules are built, a new file Module.symvers is created. This file contains the version for all symbols exported by the kernel and any module compiled within the kernel tree. When the external module is build the Module.symvers file is being read and symbol versions are used from that file. The purpose of avoiding any updates in the kernel src is that usually in a distribution the kernel src will be read-only, and there is no need to try to update it. And when building an external module the focus is on the module, not the kernel. I expect the distributions will start using something like this: kernel src - with no generated files. Not even .config: /usr/src/linux-<version> Output from build: /lib/modules/linux-<version>/build where build is a real directory with relevant output files and the appropriate .config. I have some Documentation in the pipe-line, but wants to see how this approach is received before completing it. This patch is made on top of the previously posted patch to divide make clean in three steps. And you may need to edit the following line in the patch to make it apply: %docs: scripts_basic FORCE to %docs: scripts FORCE
Diffstat (limited to 'scripts/Makefile.modpost')
-rw-r--r--scripts/Makefile.modpost12
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index d349dda5edf7..777b1a111ab5 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -13,12 +13,6 @@ include scripts/Makefile.lib
__modules := $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod))
modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
-ifneq ($(filter-out $(modules),$(__modules)),)
- $(warning Trouble: $(filter-out $(modules),$(__modules)))
- $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS,)
- $(warning do not complain if something goes wrong.)
-endif
-
__modversions: $(modules)
@:
@@ -55,9 +49,11 @@ $(modules:.ko=.mod.c): __modpost ;
# Extract all checksums for all exported symbols
quiet_cmd_modpost = MODPOST
- cmd_modpost = scripts/modpost $(filter-out FORCE,$^)
+ cmd_modpost = scripts/modpost \
+ $(if $(filter vmlinux,$^),-o,-i) $(objtree)/Module.symvers \
+ $(filter-out FORCE,$^)
-__modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
+__modpost: $(if $(KBUILD_EXTMOD),,$(wildcard vmlinux)) $(modules:.ko=.o) FORCE
$(call if_changed,modpost)
targets += __modpost