Commit e272a0c6 authored by Sam Ravnborg's avatar Sam Ravnborg

Merge mars.ravnborg.org:/home/sam/bk/kbuild-patchset-1

into mars.ravnborg.org:/home/sam/bk/sepout
parents 09009772 efacc216
......@@ -4,3 +4,5 @@ kconfig-language.txt
- specification of Config Language, the language in Kconfig files
makefiles.txt
- developer information for linux kernel makefiles
modules.txt
- how to build modules and to install them
For now this is a raw copy from the old Documentation/modules.txt,
which was removed in 2.6.0-test5.
The information herein is correct but not complete.
Installing modules in a non-standard location
---------------------------------------------
When the modules needs to be installed under another directory
the INSTALL_MOD_PATH can be used to prefix "/lib/modules" as seen
in the following example:
make INSTALL_MOD_PATH=/frodo modules_install
This will install the modules in the directory /frodo/lib/modules.
/frodo can be a NFS mounted filesystem on another machine, allowing
out-of-the-box support for installation on remote machines.
Compiling modules outside the official kernel
---------------------------------------------
Often modules are developed outside the official kernel.
To keep up with changes in the build system the most portable way
to compile a module outside the kernel is to use the following command-line:
make -C path/to/kernel/src SUBDIRS=$PWD modules
This requires that a makefile exits made in accordance to
Documentation/kbuild/makefiles.txt.
......@@ -302,12 +302,15 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV
# Helpers built in scripts/
scripts/docproc scripts/fixdep scripts/split-include : scripts ;
scripts/docproc scripts/split-include : scripts ;
.PHONY: scripts
.PHONY: scripts scripts/fixdep
scripts:
$(Q)$(MAKE) $(build)=scripts
scripts/fixdep:
$(Q)$(MAKE) $(build)=scripts $@
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
......@@ -385,8 +388,8 @@ include .config
# If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig
include/linux/autoconf.h: scripts/fixdep .config
$(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
include/linux/autoconf.h: .config
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
endif
......@@ -745,7 +748,7 @@ MRPROPER_FILES += \
.menuconfig.log \
include/asm \
.hdepend include/linux/modversions.h \
tags TAGS cscope kernel.spec \
tags TAGS cscope.out kernel.spec \
.tmp*
# Directories removed with 'make mrproper'
......
......@@ -58,10 +58,6 @@ bzImage: zImage
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=arch/ppc/boot $@
%_config: arch/ppc/configs/%_defconfig
rm -f .config arch/ppc/defconfig
cp -f arch/ppc/configs/$(@:config=defconfig) .config
archclean:
$(Q)$(MAKE) $(clean)=arch/ppc/boot
......
......@@ -41,10 +41,6 @@ boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
$(boottarget-y): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
%_config: arch/ppc64/configs/%_defconfig
rm -f .config arch/ppc64/defconfig
cp -f arch/ppc64/configs/$(@:config=defconfig) arch/ppc64/defconfig
bootimage-$(CONFIG_PPC_PSERIES) := zImage
bootimage-$(CONFIG_PPC_ISERIES) := vmlinux.sm
BOOTIMAGE := $(bootimage-y)
......
......@@ -262,7 +262,7 @@ if_changed_rule = $(if $(strip $? \
# If quiet is set, only print short version of command
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
......
......@@ -40,6 +40,9 @@ allmodconfig: $(obj)/conf
defconfig: $(obj)/conf
$< -d arch/$(ARCH)/Kconfig
%_defconfig: $(obj)/conf
$(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
# Help text used by make help
help:
@echo ' oldconfig - Update current config utilising a line-oriented program'
......
......@@ -26,6 +26,7 @@ enum {
set_no,
set_random
} input_mode = ask_all;
char *defconfig_file;
static int indent = 1;
static int valid_stdin = 1;
......@@ -483,11 +484,12 @@ static void check_conf(struct menu *menu)
int main(int ac, char **av)
{
int i = 1;
const char *name;
struct stat tmpstat;
if (ac > 1 && av[1][0] == '-') {
switch (av[1][1]) {
if (ac > i && av[i][0] == '-') {
switch (av[i++][1]) {
case 'o':
input_mode = ask_new;
break;
......@@ -498,6 +500,15 @@ int main(int ac, char **av)
case 'd':
input_mode = set_default;
break;
case 'D':
input_mode = set_default;
defconfig_file = av[i++];
if (!defconfig_file) {
printf("%s: No default config file specified\n",
av[0]);
exit(1);
}
break;
case 'n':
input_mode = set_no;
break;
......@@ -516,18 +527,21 @@ int main(int ac, char **av)
printf("%s [-o|-s] config\n", av[0]);
exit(0);
}
name = av[2];
} else
name = av[1];
}
name = av[i];
if (!name) {
printf("%s: Kconfig file missing\n", av[0]);
}
conf_parse(name);
//zconfdump(stdout);
switch (input_mode) {
case set_default:
name = conf_get_default_confname();
if (conf_read(name)) {
if (!defconfig_file)
defconfig_file = conf_get_default_confname();
if (conf_read(defconfig_file)) {
printf("***\n"
"*** Can't find default configuration \"%s\"!\n"
"***\n", name);
"***\n", defconfig_file);
exit(1);
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment