Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4800be29 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: fix first module build
  kconfig: update kconfig-language text
  kbuild: introduce cc-cross-prefix
  kbuild: disable depmod in cross-compile kernel build
  kbuild: make deb-pkg - add 'Provides:' line
  kconfig: comment typo in scripts/kconfig/Makefile.
  kbuild: stop docproc segfaulting when SRCTREE isn't set.
  kbuild: modpost problem when symbols move from one module to another
  kbuild: cscope - filter out .tmp_* in find_sources
  kbuild: mailing list has moved
  kbuild: check asm symlink when building a kernel
parents c4ec2071 7bb9d092
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -77,7 +77,12 @@ applicable everywhere (see syntax).
  Optionally, dependencies only for this default value can be added with
  Optionally, dependencies only for this default value can be added with
  "if".
  "if".


- dependencies: "depends on"/"requires" <expr>
- type definition + default value:
	"def_bool"/"def_tristate" <expr> ["if" <expr>]
  This is a shorthand notation for a type definition plus a value.
  Optionally dependencies for this default value can be added with "if".

- dependencies: "depends on" <expr>
  This defines a dependency for this menu entry. If multiple
  This defines a dependency for this menu entry. If multiple
  dependencies are defined, they are connected with '&&'. Dependencies
  dependencies are defined, they are connected with '&&'. Dependencies
  are applied to all other options within this menu entry (which also
  are applied to all other options within this menu entry (which also
@@ -289,3 +294,10 @@ source:
	"source" <prompt>
	"source" <prompt>


This reads the specified configuration file. This file is always parsed.
This reads the specified configuration file. This file is always parsed.

mainmenu:

	"mainmenu" <prompt>

This sets the config program's title bar if the config program chooses
to use it.
+22 −0
Original line number Original line Diff line number Diff line
@@ -518,6 +518,28 @@ more details, with real examples.
	In this example for a specific GCC version the build will error out explaining
	In this example for a specific GCC version the build will error out explaining
	to the user why it stops.
	to the user why it stops.


    cc-cross-prefix
	cc-cross-prefix is used to check if there exist a $(CC) in path with
	one of the listed prefixes. The first prefix where there exist a
	prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found
	then nothing is returned.
	Additional prefixes are separated by a single space in the
	call of cc-cross-prefix.
	This functionality is usefull for architecture Makefile that try
	to set CROSS_COMPILE to well know values but may have several
	values to select between.
	It is recommended only to try to set CROSS_COMPILE is it is a cross
	build (host arch is different from target arch). And is CROSS_COMPILE
	is already set then leave it with the old value.

	Example:
		#arch/m68k/Makefile
		ifneq ($(SUBARCH),$(ARCH))
		        ifeq ($(CROSS_COMPILE),)
		               CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu-)
			endif
		endif

=== 4 Host Program support
=== 4 Host Program support


Kbuild supports building executables on the host for use during the
Kbuild supports building executables on the host for use during the
+2 −1
Original line number Original line Diff line number Diff line
@@ -2178,7 +2178,7 @@ S: Maintained
KCONFIG
KCONFIG
P:	Roman Zippel
P:	Roman Zippel
M:	zippel@linux-m68k.org
M:	zippel@linux-m68k.org
L:	kbuild-devel@lists.sourceforge.net
L:	linux-kbuild@vger.kernel.org
S:	Maintained
S:	Maintained


KDUMP
KDUMP
@@ -2207,6 +2207,7 @@ KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*)
P:	Sam Ravnborg
P:	Sam Ravnborg
M:	sam@ravnborg.org
M:	sam@ravnborg.org
T:	git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
T:	git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
L:	linux-kbuild@vger.kernel.org
S:	Maintained
S:	Maintained


KERNEL JANITORS
KERNEL JANITORS
+38 −33
Original line number Original line Diff line number Diff line
@@ -887,10 +887,7 @@ prepare2: prepare3 outputmakefile


prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
                   include/asm include/config/auto.conf
                   include/asm include/config/auto.conf
ifneq ($(KBUILD_MODULES),)
	$(cmd_crmodverdir)
	$(Q)mkdir -p $(MODVERDIR)
	$(Q)rm -f $(MODVERDIR)/*
endif


archprepare: prepare1 scripts_basic
archprepare: prepare1 scripts_basic


@@ -906,14 +903,24 @@ prepare: prepare0


export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)


# FIXME: The asm symlink changes when $(ARCH) changes. That's
# The asm symlink changes when $(ARCH) changes.
# hard to detect, but I suppose "make mrproper" is a good idea
# Detect this and ask user to run make mrproper
# before switching between archs anyway.


include/asm:
include/asm: FORCE
	@echo '  SYMLINK $@ -> include/asm-$(SRCARCH)'
	$(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;   \
	$(Q)if [ ! -d include ]; then mkdir -p include; fi;
	if [ -L include/asm ]; then                                     \
	@ln -fsn asm-$(SRCARCH) $@
		if [ "$$asmlink" != "$(SRCARCH)" ]; then                \
			echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
			echo "       set ARCH or save .config and run 'make mrproper' to fix it";             \
			exit 1;                                         \
		fi;                                                     \
	else                                                            \
		echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';          \
		if [ ! -d include ]; then                               \
			mkdir -p include;                               \
		fi;                                                     \
		ln -fsn asm-$(SRCARCH) $@;                              \
	fi


# Generate some files
# Generate some files
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
@@ -1023,19 +1030,12 @@ _modinst_:
	fi
	fi
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst


# If System.map exists, run depmod.  This deliberately does not have a
# This depmod is only for convenience to give the initial
# dependency on System.map since that would run the dependency tree on
# vmlinux.  This depmod is only for convenience to give the initial
# boot a modules.dep even before / is mounted read-write.  However the
# boot a modules.dep even before / is mounted read-write.  However the
# boot script depmod is the master version.
# boot script depmod is the master version.
ifeq "$(strip $(INSTALL_MOD_PATH))" ""
depmod_opts	:=
else
depmod_opts	:= -b $(INSTALL_MOD_PATH) -r
endif
PHONY += _modinst_post
PHONY += _modinst_post
_modinst_post: _modinst_
_modinst_post: _modinst_
	if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi
	$(call cmd,depmod)


else # CONFIG_MODULES
else # CONFIG_MODULES


@@ -1223,8 +1223,7 @@ else # KBUILD_EXTMOD
KBUILD_MODULES := 1
KBUILD_MODULES := 1
PHONY += crmodverdir
PHONY += crmodverdir
crmodverdir:
crmodverdir:
	$(Q)mkdir -p $(MODVERDIR)
	$(cmd_crmodverdir)
	$(Q)rm -f $(MODVERDIR)/*


PHONY += $(objtree)/Module.symvers
PHONY += $(objtree)/Module.symvers
$(objtree)/Module.symvers:
$(objtree)/Module.symvers:
@@ -1252,15 +1251,6 @@ _emodinst_:
	$(Q)mkdir -p $(MODLIB)/$(install-dir)
	$(Q)mkdir -p $(MODLIB)/$(install-dir)
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst


# Run depmod only is we have System.map and depmod is executable
quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
      cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
                      $(DEPMOD) -ae -F System.map             \
                      $(if $(strip $(INSTALL_MOD_PATH)),      \
		      -b $(INSTALL_MOD_PATH) -r)              \
		      $(KERNELRELEASE);                       \
                   fi

PHONY += _emodinst_post
PHONY += _emodinst_post
_emodinst_post: _emodinst_
_emodinst_post: _emodinst_
	$(call cmd,depmod)
	$(call cmd,depmod)
@@ -1344,7 +1334,7 @@ define find-sources
	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
	       -name $1 -print; \
	       -name $1 -print; \
	  find $(__srctree) $(RCS_FIND_IGNORE) \
	  find $(__srctree) $(RCS_FIND_IGNORE) \
	       \( -name include -o -name arch \) -prune -o \
	       \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
	       -name $1 -print; \
	       -name $1 -print; \
	  )
	  )
endef
endef
@@ -1493,9 +1483,11 @@ endif


# Modules
# Modules
/ %/: prepare scripts FORCE
/ %/: prepare scripts FORCE
	$(cmd_crmodverdir)
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
	$(build)=$(build-dir)
	$(build)=$(build-dir)
%.ko: prepare scripts FORCE
%.ko: prepare scripts FORCE
	$(cmd_crmodverdir)
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
	$(build)=$(build-dir) $(@:.ko=.o)
	$(build)=$(build-dir) $(@:.ko=.o)
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1509,6 +1501,19 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files)))
      cmd_rmfiles = rm -f $(rm-files)
      cmd_rmfiles = rm -f $(rm-files)


# Run depmod only is we have System.map and depmod is executable
# and we build for the host arch
quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
      cmd_depmod = \
	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
		$(DEPMOD) -ae -F System.map                                     \
		$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r)   \
		$(KERNELRELEASE);                                               \
	fi

# Create temporary dir for module support files
cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/*



a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
	  $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
	  $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
+11 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,17 @@ endef
# gcc support functions
# gcc support functions
# See documentation in Documentation/kbuild/makefiles.txt
# See documentation in Documentation/kbuild/makefiles.txt


# cc-cross-prefix
# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
# Return first prefix where a prefix$(CC) is found in PATH.
# If no $(CC) found in PATH with listed prefixes return nothing
cc-cross-prefix =  \
	$(word 1, $(foreach c,$(1),                                   \
		$(shell set -e;                                       \
		if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \
			echo $(c);                                    \
		fi)))

# output directory for tests below
# output directory for tests below
TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)


Loading