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 ...@@ -4,3 +4,5 @@ kconfig-language.txt
- specification of Config Language, the language in Kconfig files - specification of Config Language, the language in Kconfig files
makefiles.txt makefiles.txt
- developer information for linux kernel makefiles - 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 ...@@ -302,12 +302,15 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV
# Helpers built in scripts/ # 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: scripts:
$(Q)$(MAKE) $(build)=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 # 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 # catch them early, and hand them over to scripts/kconfig/Makefile
...@@ -385,8 +388,8 @@ include .config ...@@ -385,8 +388,8 @@ include .config
# If .config is newer than include/linux/autoconf.h, someone tinkered # If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig # with it and forgot to run make oldconfig
include/linux/autoconf.h: scripts/fixdep .config include/linux/autoconf.h: .config
$(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
endif endif
...@@ -745,7 +748,7 @@ MRPROPER_FILES += \ ...@@ -745,7 +748,7 @@ MRPROPER_FILES += \
.menuconfig.log \ .menuconfig.log \
include/asm \ include/asm \
.hdepend include/linux/modversions.h \ .hdepend include/linux/modversions.h \
tags TAGS cscope kernel.spec \ tags TAGS cscope.out kernel.spec \
.tmp* .tmp*
# Directories removed with 'make mrproper' # Directories removed with 'make mrproper'
......
...@@ -58,10 +58,6 @@ bzImage: zImage ...@@ -58,10 +58,6 @@ bzImage: zImage
$(BOOT_TARGETS): vmlinux $(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=arch/ppc/boot $@ $(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: archclean:
$(Q)$(MAKE) $(clean)=arch/ppc/boot $(Q)$(MAKE) $(clean)=arch/ppc/boot
......
...@@ -41,10 +41,6 @@ boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm ...@@ -41,10 +41,6 @@ boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
$(boottarget-y): vmlinux $(boottarget-y): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ $(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_PSERIES) := zImage
bootimage-$(CONFIG_PPC_ISERIES) := vmlinux.sm bootimage-$(CONFIG_PPC_ISERIES) := vmlinux.sm
BOOTIMAGE := $(bootimage-y) BOOTIMAGE := $(bootimage-y)
......
...@@ -262,7 +262,7 @@ if_changed_rule = $(if $(strip $? \ ...@@ -262,7 +262,7 @@ if_changed_rule = $(if $(strip $? \
# If quiet is set, only print short version of command # 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>) # $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target> # Recursively call a sub-make in <dir> with target <target>
......
...@@ -40,6 +40,9 @@ allmodconfig: $(obj)/conf ...@@ -40,6 +40,9 @@ allmodconfig: $(obj)/conf
defconfig: $(obj)/conf defconfig: $(obj)/conf
$< -d arch/$(ARCH)/Kconfig $< -d arch/$(ARCH)/Kconfig
%_defconfig: $(obj)/conf
$(Q)$< -D arch/$(ARCH)/configs/$@ arch/$(ARCH)/Kconfig
# Help text used by make help # Help text used by make help
help: help:
@echo ' oldconfig - Update current config utilising a line-oriented program' @echo ' oldconfig - Update current config utilising a line-oriented program'
......
...@@ -26,6 +26,7 @@ enum { ...@@ -26,6 +26,7 @@ enum {
set_no, set_no,
set_random set_random
} input_mode = ask_all; } input_mode = ask_all;
char *defconfig_file;
static int indent = 1; static int indent = 1;
static int valid_stdin = 1; static int valid_stdin = 1;
...@@ -483,11 +484,12 @@ static void check_conf(struct menu *menu) ...@@ -483,11 +484,12 @@ static void check_conf(struct menu *menu)
int main(int ac, char **av) int main(int ac, char **av)
{ {
int i = 1;
const char *name; const char *name;
struct stat tmpstat; struct stat tmpstat;
if (ac > 1 && av[1][0] == '-') { if (ac > i && av[i][0] == '-') {
switch (av[1][1]) { switch (av[i++][1]) {
case 'o': case 'o':
input_mode = ask_new; input_mode = ask_new;
break; break;
...@@ -498,6 +500,15 @@ int main(int ac, char **av) ...@@ -498,6 +500,15 @@ int main(int ac, char **av)
case 'd': case 'd':
input_mode = set_default; input_mode = set_default;
break; 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': case 'n':
input_mode = set_no; input_mode = set_no;
break; break;
...@@ -516,18 +527,21 @@ int main(int ac, char **av) ...@@ -516,18 +527,21 @@ int main(int ac, char **av)
printf("%s [-o|-s] config\n", av[0]); printf("%s [-o|-s] config\n", av[0]);
exit(0); exit(0);
} }
name = av[2]; }
} else name = av[i];
name = av[1]; if (!name) {
printf("%s: Kconfig file missing\n", av[0]);
}
conf_parse(name); conf_parse(name);
//zconfdump(stdout); //zconfdump(stdout);
switch (input_mode) { switch (input_mode) {
case set_default: case set_default:
name = conf_get_default_confname(); if (!defconfig_file)
if (conf_read(name)) { defconfig_file = conf_get_default_confname();
if (conf_read(defconfig_file)) {
printf("***\n" printf("***\n"
"*** Can't find default configuration \"%s\"!\n" "*** Can't find default configuration \"%s\"!\n"
"***\n", name); "***\n", defconfig_file);
exit(1); exit(1);
} }
break; 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