Skip to content

Commit

Permalink
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/mmarek/kbuild

Pull kbuild changes from Michal Marek:
 - fix for handling dependencies of *-objs targets by Masahiro Yamada
 - lots of cleanups in the kbuild machinery, also by Masahiro
 - fixes for the kconfig build to use an UTF-8 capable ncurses library
   if possible and to build on not-so-standard installs
 - some more minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Do not reference *-n variables in the Makefile
  kbuild: simplify build, clean, modbuiltin shorthands
  kbuild: arm: Do not define "comma" twice
  kbuild: remove obj-n and lib-n handling
  kbuild: remove unnecessary variable initializaions
  kbuild: remove unnecessary "obj- := dummy.o" trick
  kbuild: handle C=... and M=... after entering into build directory
  kbuild: use $(Q) for sub-make target
  kbuild: fake the "Entering directory ..." message more simply
  kconfig/lxdialog: get ncurses CFLAGS with pkg-config
  kconfig: nconfig: fix multi-byte UTF handling
  kconfig: lxdialog: fix spelling
  kbuild: Make scripts executable
  kbuild: remove redundant clean-files from scripts/kconfig/Makefile
  kbuild: refactor script/kconfig/Makefile
  kbuild: handle the dependency of multi-objs hostprogs appropriately
  kbuild: handle multi-objs dependency appropriately
  • Loading branch information
torvalds committed Oct 14, 2014
2 parents 1b5a5f5 + 3014223 commit f33a3fa
Show file tree
Hide file tree
Showing 55 changed files with 76 additions and 181 deletions.
88 changes: 40 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ NAME = Shuffling Zombie Juror
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.

# Do not:
# o use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
# o print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory
# Do not use make's built-in rules and variables
# (this increases performance and avoids hard-to-debug behaviour);
MAKEFLAGS += -rR

# Avoid funny character set dependencies
unexport LC_ALL
Expand Down Expand Up @@ -97,34 +95,6 @@ endif

export quiet Q KBUILD_VERBOSE

# Call a source code checker (by default, "sparse") as part of the
# C compilation.
#
# Use 'make C=1' to enable checking of only re-compiled files.
# Use 'make C=2' to enable checking of *all* source files, regardless
# of whether they are re-compiled or not.
#
# See the file "Documentation/sparse.txt" for more details, including
# where to get the "sparse" utility.

ifeq ("$(origin C)", "command line")
KBUILD_CHECKSRC = $(C)
endif
ifndef KBUILD_CHECKSRC
KBUILD_CHECKSRC = 0
endif

# Use make M=dir to specify directory of external module to build
# Old syntax make ... SUBDIRS=$PWD is still supported
# Setting the environment variable KBUILD_EXTMOD take precedence
ifdef SUBDIRS
KBUILD_EXTMOD ?= $(SUBDIRS)
endif

ifeq ("$(origin M)", "command line")
KBUILD_EXTMOD := $(M)
endif

# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
# In both cases the working directory must be the root of the kernel src.
Expand All @@ -140,7 +110,6 @@ endif
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
# variable.


# KBUILD_SRC is set on invocation of make in OBJ directory
# KBUILD_SRC is not intended to be used by the regular user (for now)
ifeq ($(KBUILD_SRC),)
Expand Down Expand Up @@ -172,17 +141,9 @@ PHONY += $(MAKECMDGOALS) sub-make
$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
@:

# Fake the "Entering directory" message once, so that IDEs/editors are
# able to understand relative filenames.
echodir := @echo
quiet_echodir := @echo
silent_echodir := @:
sub-make: FORCE
$($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
KBUILD_SRC=$(CURDIR) \
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
$(filter-out _all sub-make,$(MAKECMDGOALS))
$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))

# Leave processing to above invocation of make
skip-makefile := 1
Expand All @@ -192,6 +153,39 @@ endif # ifeq ($(KBUILD_SRC),)
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(skip-makefile),)

# Do not print "Entering directory ...",
# but we want to display it when entering to the output directory
# so that IDEs/editors are able to understand relative filenames.
MAKEFLAGS += --no-print-directory

# Call a source code checker (by default, "sparse") as part of the
# C compilation.
#
# Use 'make C=1' to enable checking of only re-compiled files.
# Use 'make C=2' to enable checking of *all* source files, regardless
# of whether they are re-compiled or not.
#
# See the file "Documentation/sparse.txt" for more details, including
# where to get the "sparse" utility.

ifeq ("$(origin C)", "command line")
KBUILD_CHECKSRC = $(C)
endif
ifndef KBUILD_CHECKSRC
KBUILD_CHECKSRC = 0
endif

# Use make M=dir to specify directory of external module to build
# Old syntax make ... SUBDIRS=$PWD is still supported
# Setting the environment variable KBUILD_EXTMOD take precedence
ifdef SUBDIRS
KBUILD_EXTMOD ?= $(SUBDIRS)
endif

ifeq ("$(origin M)", "command line")
KBUILD_EXTMOD := $(M)
endif

# If building an external module we do not care about the all: rule
# but instead _all depend on modules
PHONY += all
Expand Down Expand Up @@ -889,9 +883,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m)))

vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
$(init-n) $(init-) \
$(core-n) $(core-) $(drivers-n) $(drivers-) \
$(net-n) $(net-) $(libs-n) $(libs-))))
$(init-) $(core-) $(drivers-) $(net-) $(libs-))))

init-y := $(patsubst %/, %/built-in.o, $(init-y))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
Expand Down Expand Up @@ -1591,7 +1583,7 @@ endif
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
clean := -f $(srctree)/scripts/Makefile.clean obj

endif # skip-makefile

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ AS += -EL
LD += -EL
endif

comma = ,

# This selects which instruction set is used.
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-at91/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#

obj-y := gpio.o setup.o sysirq_mask.o
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_OLD_IRQ_AT91) += irq.o
obj-$(CONFIG_OLD_CLK_AT91) += clock.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-ebsa110/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@
# Object file lists.

obj-y := core.o io.o leds.o
obj-m :=
obj-n :=
obj- :=
3 changes: 0 additions & 3 deletions arch/arm/mach-ep93xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# Makefile for the linux kernel.
#
obj-y := core.o clock.o
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_EP93XX_DMA) += dma.o

Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-exynos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include

obj-y :=
obj-m :=
obj-n :=
obj- :=

# Core

obj-$(CONFIG_ARCH_EXYNOS) += exynos.o pmu.o exynos-smc.o firmware.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-footbridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# Object file lists.

obj-y := common.o dma.o isa-irq.o
obj-m :=
obj-n :=
obj- :=

pci-y += dc21285.o
pci-$(CONFIG_ARCH_CATS) += cats-pci.o
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-iop13xx/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
obj-y :=
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_ARCH_IOP13XX) += setup.o
obj-$(CONFIG_ARCH_IOP13XX) += irq.o
obj-$(CONFIG_ARCH_IOP13XX) += pci.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-iop32x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#

obj-y := irq.o
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_MACH_GLANTANK) += glantank.o
obj-$(CONFIG_ARCH_IQ80321) += iq80321.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-iop33x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#

obj-y := irq.o uart.o
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_ARCH_IQ80331) += iq80331.o
obj-$(CONFIG_MACH_IQ80332) += iq80332.o
3 changes: 0 additions & 3 deletions arch/arm/mach-ks8695/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#

obj-y := cpu.o irq.o time.o devices.o
obj-m :=
obj-n :=
obj- :=

# PCI support is optional
obj-$(CONFIG_PCI) += pci.o
Expand Down
4 changes: 0 additions & 4 deletions arch/arm/mach-rpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
# Object file lists.

obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o
obj-m :=
obj-n :=
obj- :=

5 changes: 0 additions & 5 deletions arch/arm/mach-s3c24xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
#
# Licensed under GPLv2

obj-y :=
obj-m :=
obj-n :=
obj- :=

# core

obj-y += common.o
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-s3c64xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
#
# Licensed under GPLv2

obj-y :=
obj-m :=
obj-n :=
obj- :=

# Core

obj-y += common.o
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-s5pv210/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include

obj-y :=
obj-m :=
obj-n :=
obj- :=

# Core

obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-sa1100/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

# Common support
obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o
obj-m :=
obj-n :=
obj- :=

# Specific board support
obj-$(CONFIG_SA1100_ASSABET) += assabet.o
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-u300/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#

obj-y := core.o
obj-m :=
obj-n :=
obj- :=

obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
obj-$(CONFIG_REGULATOR_AB3100) += regulator.o
6 changes: 0 additions & 6 deletions arch/arm/plat-iop/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Makefile for the linux kernel.
#

obj-y :=

# IOP32X
obj-$(CONFIG_ARCH_IOP32X) += i2c.o
obj-$(CONFIG_ARCH_IOP32X) += pci.o
Expand All @@ -27,7 +25,3 @@ obj-$(CONFIG_ARCH_IOP33X) += restart.o
# IOP13XX
obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
obj-$(CONFIG_ARCH_IOP13XX) += time.o

obj-m :=
obj-n :=
obj- :=
3 changes: 0 additions & 3 deletions arch/arm/plat-omap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include

# Common support
obj-y := sram.o dma.o counter_32k.o
obj-m :=
obj-n :=
obj- :=

# omap_device support (OMAP2+ only at the moment)

Expand Down
5 changes: 0 additions & 5 deletions arch/arm/plat-samsung/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

ccflags-$(CONFIG_ARCH_MULTI_V7) += -I$(srctree)/$(src)/include

obj-y :=
obj-m :=
obj-n := dummy.o
obj- :=

# Objects we always build independent of SoC choice

obj-y += init.o cpu.o
Expand Down
2 changes: 0 additions & 2 deletions arch/arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ AS += -EL
LD += -EL
endif

comma = ,

CHECKFLAGS += -D__aarch64__

# Default value
Expand Down
2 changes: 0 additions & 2 deletions drivers/clk/shmobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o
obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o
# for emply built-in.o
obj-n := dummy
4 changes: 0 additions & 4 deletions drivers/net/wimax/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@

obj-$(CONFIG_WIMAX_I2400M) += i2400m/

# (from Sam Ravnborg) force kbuild to create built-in.o
obj- := dummy.o
2 changes: 1 addition & 1 deletion firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,6 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \

# Without this, built-in.o won't be created when it's empty, and the
# final vmlinux link will fail.
obj-n := dummy
obj- := dummy

hostprogs-y := ihex2fw
4 changes: 2 additions & 2 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
# $(Q)$(MAKE) $(build)=dir
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
build := -f $(srctree)/scripts/Makefile.build obj

###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
# Usage:
# $(Q)$(MAKE) $(modbuiltin)=dir
modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj

# Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter
Expand Down
Loading

0 comments on commit f33a3fa

Please sign in to comment.