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:
  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
  • Loading branch information
Linus Torvalds committed Apr 11, 2006
2 parents b3967dc + b5ac481 commit 2514395
Show file tree
Hide file tree
Showing 25 changed files with 254 additions and 204 deletions.
2 changes: 1 addition & 1 deletion Documentation/kbuild/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
54 changes: 28 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 $@)

# 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
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)

/ %/: 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
Expand Down
2 changes: 1 addition & 1 deletion arch/ppc/boot/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/math-emu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion drivers/media/video/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ obj-$(CONFIG_USB_IBMCAM) += usbvideo/
obj-$(CONFIG_USB_KONICAWC) += usbvideo/
obj-$(CONFIG_USB_VICAM) += usbvideo/

EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
2 changes: 1 addition & 1 deletion drivers/media/video/bt8xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
obj-$(CONFIG_VIDEO_BT848) += bttv.o

EXTRA_CFLAGS += -I$(src)/..
EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
2 changes: 1 addition & 1 deletion drivers/media/video/cx25840/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ cx25840-objs := cx25840-core.o cx25840-audio.o cx25840-firmware.o \

obj-$(CONFIG_VIDEO_CX25840) += cx25840.o

EXTRA_CFLAGS += -I$(src)/..
EXTRA_CFLAGS += -Idrivers/media/video
6 changes: 3 additions & 3 deletions drivers/media/video/cx88/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o
obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o
obj-$(CONFIG_VIDEO_CX88_VP3054) += cx88-vp3054-i2c.o

EXTRA_CFLAGS += -I$(src)/..
EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
EXTRA_CFLAGS += -Idrivers/media/video
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
EXTRA_CFLAGS += -Idrivers/media/dvb/frontends

extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1
extra-cflags-$(CONFIG_DVB_CX22702) += -DHAVE_CX22702=1
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/em28xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ em28xx-objs := em28xx-video.o em28xx-i2c.o em28xx-cards.o em28xx-core.o \

obj-$(CONFIG_VIDEO_EM28XX) += em28xx.o

EXTRA_CFLAGS += -I$(src)/..
EXTRA_CFLAGS += -Idrivers/media/video
6 changes: 3 additions & 3 deletions drivers/media/video/saa7134/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o

obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o

EXTRA_CFLAGS += -I$(src)/..
EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
EXTRA_CFLAGS += -Idrivers/media/video
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
EXTRA_CFLAGS += -Idrivers/media/dvb/frontends

extra-cflags-$(CONFIG_VIDEO_BUF_DVB) += -DHAVE_VIDEO_BUF_DVB=1
extra-cflags-$(CONFIG_DVB_MT352) += -DHAVE_MT352=1
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/chelsio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj-$(CONFIG_CHELSIO_T1) += cxgb.o

EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/chelsio $(DEBUG_FLAGS)
EXTRA_CFLAGS += -Idrivers/net/chelsio $(DEBUG_FLAGS)


cxgb-objs := cxgb2.o espi.o pm3393.o sge.o subr.o mv88x201x.o
Expand Down
5 changes: 5 additions & 0 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ cc-ifversion = $(shell if [ $(call cc-version, $(CC)) $(1) $(2) ]; then \
# $(Q)$(MAKE) $(build)=dir
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj

# Prefix -I with $(srctree) if it is not an absolute path
addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
# Find all -I options and call addtree
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))

# If quiet is set, only print short version of command
cmd = @$(echo-cmd) $(cmd_$(1))

Expand Down
5 changes: 0 additions & 5 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ __a_flags = $(_a_flags)
__cpp_flags = $(_cpp_flags)
else

# Prefix -I with $(srctree) if it is not an absolute path
addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
# Find all -I options and call addtree
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))

# -I$(obj) locates generated .h files
# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
# and locates generated .h files
Expand Down
Empty file modified scripts/bloat-o-meter
100644 → 100755
Empty file.
Empty file modified scripts/checkstack.pl
100644 → 100755
Empty file.
Loading

0 comments on commit 2514395

Please sign in to comment.