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

Diff for: Makefile

+40-48
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

Diff for: arch/arm/Makefile

-2
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

Diff for: arch/arm/mach-at91/Makefile

-3
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

Diff for: arch/arm/mach-ebsa110/Makefile

-3
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- :=

Diff for: arch/arm/mach-ep93xx/Makefile

-3
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

Diff for: arch/arm/mach-exynos/Makefile

-5
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

Diff for: arch/arm/mach-footbridge/Makefile

-3
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

Diff for: arch/arm/mach-iop13xx/Makefile

-5
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

Diff for: arch/arm/mach-iop32x/Makefile

-3
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

Diff for: arch/arm/mach-iop33x/Makefile

-3
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

Diff for: arch/arm/mach-ks8695/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#
55

66
obj-y := cpu.o irq.o time.o devices.o
7-
obj-m :=
8-
obj-n :=
9-
obj- :=
107

118
# PCI support is optional
129
obj-$(CONFIG_PCI) += pci.o

Diff for: arch/arm/mach-rpc/Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@
55
# Object file lists.
66

77
obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o
8-
obj-m :=
9-
obj-n :=
10-
obj- :=
11-

Diff for: arch/arm/mach-s3c24xx/Makefile

-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
#
88
# Licensed under GPLv2
99

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

1712
obj-y += common.o

Diff for: arch/arm/mach-s3c64xx/Makefile

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
#
66
# Licensed under GPLv2
77

8-
obj-y :=
9-
obj-m :=
10-
obj-n :=
11-
obj- :=
12-
138
# Core
149

1510
obj-y += common.o

Diff for: arch/arm/mach-s5pv210/Makefile

-5
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_PM_SLEEP) += pm.o sleep.o

Diff for: arch/arm/mach-sa1100/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
# Common support
66
obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o
7-
obj-m :=
8-
obj-n :=
9-
obj- :=
107

118
# Specific board support
129
obj-$(CONFIG_SA1100_ASSABET) += assabet.o

Diff for: arch/arm/mach-u300/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#
44

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

107
obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o
118
obj-$(CONFIG_REGULATOR_AB3100) += regulator.o

Diff for: arch/arm/plat-iop/Makefile

-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Makefile for the linux kernel.
33
#
44

5-
obj-y :=
6-
75
# IOP32X
86
obj-$(CONFIG_ARCH_IOP32X) += i2c.o
97
obj-$(CONFIG_ARCH_IOP32X) += pci.o
@@ -27,7 +25,3 @@ obj-$(CONFIG_ARCH_IOP33X) += restart.o
2725
# IOP13XX
2826
obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
2927
obj-$(CONFIG_ARCH_IOP13XX) += time.o
30-
31-
obj-m :=
32-
obj-n :=
33-
obj- :=

Diff for: arch/arm/plat-omap/Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include
66

77
# Common support
88
obj-y := sram.o dma.o counter_32k.o
9-
obj-m :=
10-
obj-n :=
11-
obj- :=
129

1310
# omap_device support (OMAP2+ only at the moment)
1411

Diff for: arch/arm/plat-samsung/Makefile

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

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

9-
obj-y :=
10-
obj-m :=
11-
obj-n := dummy.o
12-
obj- :=
13-
149
# Objects we always build independent of SoC choice
1510

1611
obj-y += init.o cpu.o

Diff for: arch/arm64/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ AS += -EL
3030
LD += -EL
3131
endif
3232

33-
comma = ,
34-
3533
CHECKFLAGS += -D__aarch64__
3634

3735
# Default value

Diff for: drivers/clk/shmobile/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o
77
obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o
88
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o
99
obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-mstp.o
10-
# for emply built-in.o
11-
obj-n := dummy

Diff for: drivers/net/wimax/Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
21
obj-$(CONFIG_WIMAX_I2400M) += i2400m/
3-
4-
# (from Sam Ravnborg) force kbuild to create built-in.o
5-
obj- := dummy.o

Diff for: firmware/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,6 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
232232

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

237237
hostprogs-y := ihex2fw

Diff for: scripts/Kbuild.include

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
171171
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
172172
# Usage:
173173
# $(Q)$(MAKE) $(build)=dir
174-
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
174+
build := -f $(srctree)/scripts/Makefile.build obj
175175

176176
###
177177
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
178178
# Usage:
179179
# $(Q)$(MAKE) $(modbuiltin)=dir
180-
modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
180+
modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
181181

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

0 commit comments

Comments
 (0)