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

Commit 2514395e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kconfig: fix typo in change count initialization
  kconfig: recenter menuconfig
  kconfig: revert conf behaviour change
  kconfig: fix default value for choice input
  kbuild: fix NULL dereference in scripts/mod/modpost.c
  kbuild: fix mode of checkstack.pl and other files.
  kbuild: rebuild initramfs if content of initramfs changes
  kbuild: properly pass options to hostcc when doing make O=..
  kbuild: modules_install for external modules must not remove existing modules
  kbuild: fix make dir/
  ver_linux: don't print reiser4progs version if none found
  kbuild: mips: fix sed regexp to generate asm-offset.h
  kbuild: fix building single targets with make O=.. single-target
  kbuild: use relative path to -I
  kbuild: fix unneeded rebuilds in drivers/net/chelsio after moving source tree
  kbuild: fix unneeded rebuilds in drivers/media/video after moving source tree
  kbuild: fix garbled text in modules.txt
parents b3967dc5 b5ac4817
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ What is covered within this file is mainly information to authors
of modules. The author of an external modules 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
chapter ¤. Creating a kbuild file for an external module".
chapter 4, "Creating a kbuild file for an external module".


=== 2. How to build external modules
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ define sed-y
	"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
endef
# Override default regexp for specific architectures
sed-$(CONFIG_MIPS) := "/^@@@/s///p"
sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}"

quiet_cmd_offsets = GEN     $@
define cmd_offsets
+28 −26
Original line number Diff line number Diff line
@@ -1112,7 +1112,6 @@ modules_install: _emodinst_ _emodinst_post
install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
PHONY += _emodinst_
_emodinst_:
	$(Q)rm -rf $(MODLIB)/$(install-dir)
	$(Q)mkdir -p $(MODLIB)/$(install-dir)
	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst

@@ -1275,40 +1274,43 @@ kernelversion:

# Single targets
# ---------------------------------------------------------------------------
# The directory part is taken from first prerequisite, so this
# works even with external modules
# Single targets are compatible with:
# - build whith mixed source and output
# - build with separate output dir 'make O=...'
# - external modules
#
#  target-dir => where to store outputfile
#  build-dir  => directory in kernel source tree to use

ifeq ($(KBUILD_EXTMOD),)
        build-dir  = $(patsubst %/,%,$(dir $@))
        target-dir = $(dir $@)
else
        zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
        build-dir  = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
        target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif

%.s: %.c prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.i: %.c prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.o: %.c prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.lst: %.c prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.s: %.S prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.o: %.S prepare scripts FORCE
	$(Q)$(MAKE) $(build)=$(dir $<) $(dir $<)$(notdir $@)
	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)

# For external modules we shall include any directory of the target,
# but usual case there is no directory part.
# make M=`pwd` module.o     => $(dir $@)=./
# make M=`pwd` foo/module.o => $(dir $@)=foo/
# make M=`pwd` /            => $(dir $@)=/
 
ifeq ($(KBUILD_EXTMOD),)
        target-dir = $(@D)
else
        zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
        target-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
endif

/ %/:      scripts prepare FORCE
# Modules
/ %/: prepare scripts FORCE
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
	$(build)=$(target-dir)
%.ko: scripts FORCE
	$(build)=$(build-dir)
%.ko: prepare scripts FORCE
	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
	$(build)=$(target-dir) $(@:.ko=.o)
	$(build)=$(build-dir) $(@:.ko=.o)
	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost

# FIXME Should go into a make.lib or something 
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#

CFLAGS_kbd.o	:= -Idrivers/char
CFLAGS_vreset.o := -I$(srctree)/arch/ppc/boot/include
CFLAGS_vreset.o := -Iarch/ppc/boot/include

zlib  := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
	 
+1 −1
Original line number Diff line number Diff line
@@ -5,4 +5,4 @@
obj-y    := math.o

EXTRA_AFLAGS := -ansi
EXTRA_CFLAGS = -I. -I$(TOPDIR)/include/math-emu -w
EXTRA_CFLAGS = -I. -Iinclude/math-emu -w
Loading