Skip to content

Commit f33a3fa

Browse files
committed
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/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
2 parents 1b5a5f5 + 3014223 commit f33a3fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+76
-181
lines changed

Makefile

Lines changed: 40 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ NAME = Shuffling Zombie Juror
1010
# Comments in this file are targeted only to the developer, do not
1111
# expect to learn how to build the kernel reading this file.
1212

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

1917
# Avoid funny character set dependencies
2018
unexport LC_ALL
@@ -97,34 +95,6 @@ endif
9795

9896
export quiet Q KBUILD_VERBOSE
9997

100-
# Call a source code checker (by default, "sparse") as part of the
101-
# C compilation.
102-
#
103-
# Use 'make C=1' to enable checking of only re-compiled files.
104-
# Use 'make C=2' to enable checking of *all* source files, regardless
105-
# of whether they are re-compiled or not.
106-
#
107-
# See the file "Documentation/sparse.txt" for more details, including
108-
# where to get the "sparse" utility.
109-
110-
ifeq ("$(origin C)", "command line")
111-
KBUILD_CHECKSRC = $(C)
112-
endif
113-
ifndef KBUILD_CHECKSRC
114-
KBUILD_CHECKSRC = 0
115-
endif
116-
117-
# Use make M=dir to specify directory of external module to build
118-
# Old syntax make ... SUBDIRS=$PWD is still supported
119-
# Setting the environment variable KBUILD_EXTMOD take precedence
120-
ifdef SUBDIRS
121-
KBUILD_EXTMOD ?= $(SUBDIRS)
122-
endif
123-
124-
ifeq ("$(origin M)", "command line")
125-
KBUILD_EXTMOD := $(M)
126-
endif
127-
12898
# kbuild supports saving output files in a separate directory.
12999
# To locate output files in a separate directory two syntaxes are supported.
130100
# In both cases the working directory must be the root of the kernel src.
@@ -140,7 +110,6 @@ endif
140110
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
141111
# variable.
142112

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

175-
# Fake the "Entering directory" message once, so that IDEs/editors are
176-
# able to understand relative filenames.
177-
echodir := @echo
178-
quiet_echodir := @echo
179-
silent_echodir := @:
180144
sub-make: FORCE
181-
$($(quiet)echodir) "make[1]: Entering directory \`$(KBUILD_OUTPUT)'"
182-
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
183-
KBUILD_SRC=$(CURDIR) \
184-
KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile \
185-
$(filter-out _all sub-make,$(MAKECMDGOALS))
145+
$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
146+
-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
186147

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

156+
# Do not print "Entering directory ...",
157+
# but we want to display it when entering to the output directory
158+
# so that IDEs/editors are able to understand relative filenames.
159+
MAKEFLAGS += --no-print-directory
160+
161+
# Call a source code checker (by default, "sparse") as part of the
162+
# C compilation.
163+
#
164+
# Use 'make C=1' to enable checking of only re-compiled files.
165+
# Use 'make C=2' to enable checking of *all* source files, regardless
166+
# of whether they are re-compiled or not.
167+
#
168+
# See the file "Documentation/sparse.txt" for more details, including
169+
# where to get the "sparse" utility.
170+
171+
ifeq ("$(origin C)", "command line")
172+
KBUILD_CHECKSRC = $(C)
173+
endif
174+
ifndef KBUILD_CHECKSRC
175+
KBUILD_CHECKSRC = 0
176+
endif
177+
178+
# Use make M=dir to specify directory of external module to build
179+
# Old syntax make ... SUBDIRS=$PWD is still supported
180+
# Setting the environment variable KBUILD_EXTMOD take precedence
181+
ifdef SUBDIRS
182+
KBUILD_EXTMOD ?= $(SUBDIRS)
183+
endif
184+
185+
ifeq ("$(origin M)", "command line")
186+
KBUILD_EXTMOD := $(M)
187+
endif
188+
195189
# If building an external module we do not care about the all: rule
196190
# but instead _all depend on modules
197191
PHONY += all
@@ -889,9 +883,7 @@ vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
889883
$(net-y) $(net-m) $(libs-y) $(libs-m)))
890884

891885
vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \
892-
$(init-n) $(init-) \
893-
$(core-n) $(core-) $(drivers-n) $(drivers-) \
894-
$(net-n) $(net-) $(libs-n) $(libs-))))
886+
$(init-) $(core-) $(drivers-) $(net-) $(libs-))))
895887

896888
init-y := $(patsubst %/, %/built-in.o, $(init-y))
897889
core-y := $(patsubst %/, %/built-in.o, $(core-y))
@@ -1591,7 +1583,7 @@ endif
15911583
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
15921584
# Usage:
15931585
# $(Q)$(MAKE) $(clean)=dir
1594-
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
1586+
clean := -f $(srctree)/scripts/Makefile.clean obj
15951587

15961588
endif # skip-makefile
15971589

arch/arm/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ AS += -EL
5050
LD += -EL
5151
endif
5252

53-
comma = ,
54-
5553
# This selects which instruction set is used.
5654
# Note that GCC does not numerically define an architecture version
5755
# macro, but instead defines a whole series of macros which makes

arch/arm/mach-at91/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#
44

55
obj-y := gpio.o setup.o sysirq_mask.o
6-
obj-m :=
7-
obj-n :=
8-
obj- :=
96

107
obj-$(CONFIG_OLD_IRQ_AT91) += irq.o
118
obj-$(CONFIG_OLD_CLK_AT91) += clock.o

arch/arm/mach-ebsa110/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@
55
# Object file lists.
66

77
obj-y := core.o io.o leds.o
8-
obj-m :=
9-
obj-n :=
10-
obj- :=

arch/arm/mach-ep93xx/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# Makefile for the linux kernel.
33
#
44
obj-y := core.o clock.o
5-
obj-m :=
6-
obj-n :=
7-
obj- :=
85

96
obj-$(CONFIG_EP93XX_DMA) += dma.o
107

arch/arm/mach-exynos/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

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

10-
obj-y :=
11-
obj-m :=
12-
obj-n :=
13-
obj- :=
14-
1510
# Core
1611

1712
obj-$(CONFIG_ARCH_EXYNOS) += exynos.o pmu.o exynos-smc.o firmware.o

arch/arm/mach-footbridge/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
# Object file lists.
66

77
obj-y := common.o dma.o isa-irq.o
8-
obj-m :=
9-
obj-n :=
10-
obj- :=
118

129
pci-y += dc21285.o
1310
pci-$(CONFIG_ARCH_CATS) += cats-pci.o

arch/arm/mach-iop13xx/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
obj-y :=
2-
obj-m :=
3-
obj-n :=
4-
obj- :=
5-
61
obj-$(CONFIG_ARCH_IOP13XX) += setup.o
72
obj-$(CONFIG_ARCH_IOP13XX) += irq.o
83
obj-$(CONFIG_ARCH_IOP13XX) += pci.o

arch/arm/mach-iop32x/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#
44

55
obj-y := irq.o
6-
obj-m :=
7-
obj-n :=
8-
obj- :=
96

107
obj-$(CONFIG_MACH_GLANTANK) += glantank.o
118
obj-$(CONFIG_ARCH_IQ80321) += iq80321.o

arch/arm/mach-iop33x/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#
44

55
obj-y := irq.o uart.o
6-
obj-m :=
7-
obj-n :=
8-
obj- :=
96

107
obj-$(CONFIG_ARCH_IQ80331) += iq80331.o
118
obj-$(CONFIG_MACH_IQ80332) += iq80332.o

0 commit comments

Comments
 (0)