Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: trivial documentation fixes
  kconfig: fix saving alternate kconfig file in parent dir
  kbuild: make modpost processing configurable
  kconfig/menuconfig: do not let ncurses clutter screen on exit
  kconfig/lxdialog: clear long menu lines
  kbuild: do not build mconf & lxdialog unless needed
  kconfig/lxdialog: fix make mrproper
  kconfig/lxdialog: support resize
  kconfig/lxdialog: let <ESC><ESC> behave as expected
  kconfig/menuconfig: lxdialog is now built-in
  kconfig/lxdialog: add a new theme bluetitle which is now default
  kconfig/lxdialog: add support for color themes and add blackbg theme
  kconfig/lxdialog: refactor color support
  • Loading branch information
Linus Torvalds committed Oct 3, 2006
2 parents 8b2a1fd + 99c8b94 commit b4a9071
Show file tree
Hide file tree
Showing 16 changed files with 1,053 additions and 1,446 deletions.
9 changes: 5 additions & 4 deletions Documentation/kbuild/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ are not planned to be included in the kernel tree.
What is covered within this file is mainly information to authors
of modules. The author of an external module should supply
a makefile that hides most of the complexity, so one only has to type
'make' to build the module. A complete example will be present in
'make' to build the module. A complete example will be presented in
chapter 4, "Creating a kbuild file for an external module".


Expand All @@ -61,6 +61,7 @@ when building an external module.
make -C <path-to-kernel> M=`pwd`

For the running kernel use:

make -C /lib/modules/`uname -r`/build M=`pwd`

For the above command to succeed, the kernel must have been
Expand Down Expand Up @@ -130,10 +131,10 @@ when building an external module.

To make sure the kernel contains the information required to
build external modules the target 'modules_prepare' must be used.
'module_prepare' exists solely as a simple way to prepare
'modules_prepare' exists solely as a simple way to prepare
a kernel source tree for building external modules.
Note: modules_prepare will not build Module.symvers even if
CONFIG_MODULEVERSIONING is set. Therefore a full kernel build
CONFIG_MODVERSIONS is set. Therefore a full kernel build
needs to be executed to make module versioning work.

--- 2.5 Building separate files for a module
Expand Down Expand Up @@ -450,7 +451,7 @@ kernel refuses to load the module.

Module.symvers contains a list of all exported symbols from a kernel build.

--- 7.1 Symbols fron the kernel (vmlinux + modules)
--- 7.1 Symbols from the kernel (vmlinux + modules)

During a kernel build, a file named Module.symvers will be generated.
Module.symvers contains all exported symbols from the kernel and
Expand Down
11 changes: 8 additions & 3 deletions scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
# Step 4 is solely used to allow module versioning in external modules,
# where the CRC of each module is retrieved from the Module.symers file.

# KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
# symbols in the final module linking stage
# KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
# This is solely usefull to speed up test compiles
PHONY := _modpost
_modpost: __modpost

Expand All @@ -46,7 +50,8 @@ modulesymfile := $(KBUILD_EXTMOD)/Module.symvers
__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))

_modpost: $(modules)
# Stop after building .o files if NOFINAL is set. Makes compile tests quicker
_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))


# Step 2), invoke modpost
Expand All @@ -58,7 +63,7 @@ quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(KBUILD_EXTMOD),-w) \
$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
$(wildcard vmlinux) $(filter-out FORCE,$^)

PHONY += __modpost
Expand Down Expand Up @@ -92,7 +97,7 @@ targets += $(modules:.ko=.mod.o)

# Step 6), final link of the modules
quiet_cmd_ld_ko_o = LD [M] $@
cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
$(filter-out FORCE,$^)

$(modules): %.ko :%.o %.mod.o FORCE
Expand Down
31 changes: 27 additions & 4 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ gconfig: $(obj)/gconf
$< arch/$(ARCH)/Kconfig

menuconfig: $(obj)/mconf
$(Q)$(MAKE) $(build)=scripts/kconfig/lxdialog
$< arch/$(ARCH)/Kconfig

config: $(obj)/conf
Expand Down Expand Up @@ -81,6 +80,23 @@ help:
@echo ' allyesconfig - New config where all options are accepted with yes'
@echo ' allnoconfig - New config where all options are answered with no'

# lxdialog stuff
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh

# Use reursively expanded variables so we do not call gcc unless
# we really need to do so. (Do not call gcc as part of make mrproper)
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))

HOST_EXTRACFLAGS += -DLOCALE

PHONY += $(obj)/dochecklxdialog
$(obj)/dochecklxdialog:
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)

always := dochecklxdialog


# ===========================================================================
# Shared Makefile for the various kconfig executables:
# conf: Used for defconfig, oldconfig and related targets
Expand All @@ -92,11 +108,19 @@ help:
# Based on GTK which needs to be installed to compile it
# object files used by all kconfig flavours

hostprogs-y := conf mconf qconf gconf kxgettext
lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o

conf-objs := conf.o zconf.tab.o
mconf-objs := mconf.o zconf.tab.o
mconf-objs := mconf.o zconf.tab.o $(lxdialog)
kxgettext-objs := kxgettext.o zconf.tab.o

hostprogs-y := conf qconf gconf kxgettext

ifeq ($(MAKECMDGOALS),menuconfig)
hostprogs-y += mconf
endif

ifeq ($(MAKECMDGOALS),xconfig)
qconf-target := 1
endif
Expand All @@ -116,7 +140,6 @@ endif

clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
.tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
subdir- += lxdialog

# Needed for systems without gettext
KBUILD_HAVE_NLS := $(shell \
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ int conf_write(const char *name)
fclose(out);

if (*tmpname) {
strcat(dirname, name ? name : conf_get_configname());
strcat(dirname, basename);
strcat(dirname, ".old");
rename(newname, dirname);
if (rename(tmpname, newname))
Expand Down
21 changes: 0 additions & 21 deletions scripts/kconfig/lxdialog/Makefile

This file was deleted.

Loading

0 comments on commit b4a9071

Please sign in to comment.