OpenCloudOS-Kernel/arch/arm
Masahiro Yamada 54b8ae66ae kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)
Kbuild provides per-file compiler flag addition/removal:

  CFLAGS_<basetarget>.o
  CFLAGS_REMOVE_<basetarget>.o
  AFLAGS_<basetarget>.o
  AFLAGS_REMOVE_<basetarget>.o
  CPPFLAGS_<basetarget>.lds
  HOSTCFLAGS_<basetarget>.o
  HOSTCXXFLAGS_<basetarget>.o

The <basetarget> is the filename of the target with its directory and
suffix stripped.

This syntax comes into a trouble when two files with the same basename
appear in one Makefile, for example:

  obj-y += foo.o
  obj-y += dir/foo.o
  CFLAGS_foo.o := <some-flags>

Here, the <some-flags> applies to both foo.o and dir/foo.o

The real world problem is:

  scripts/kconfig/util.c
  scripts/kconfig/lxdialog/util.c

Both files are compiled into scripts/kconfig/mconf, but only the
latter should be given with the ncurses flags.

It is more sensible to use the relative path to the Makefile, like this:

  obj-y += foo.o
  CFLAGS_foo.o := <some-flags>
  obj-y += dir/foo.o
  CFLAGS_dir/foo.o := <other-flags>

At first, I attempted to replace $(basetarget) with $*. The $* variable
is replaced with the stem ('%') part in a pattern rule. This works with
most of cases, but does not for explicit rules.

For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own
explicit rules, so $* will be empty, resulting in ignoring the per-file
AFLAGS.

I introduced a new variable, target-stem, which can be used also from
explicit rules.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Marc Zyngier <maz@kernel.org>
2019-09-04 23:12:50 +09:00
..
boot i.MX fixes for 5.3: 2019-07-23 10:13:24 -07:00
common docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
configs ARM: defconfig: u8500: Add new drivers 2019-07-23 10:13:13 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
include arm: use swiotlb for bounce buffering on LPAE configs 2019-07-24 17:29:01 +02:00
kernel ARM: signal: Mark expected switch fall-through 2019-08-09 19:47:15 -05:00
kvm kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
lib ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-actions
mach-alpine
mach-artpec treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-asm9260
mach-aspeed
mach-at91 ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-axxia treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-bcm ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-berlin
mach-clps711x
mach-cns3xxx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 418 2019-06-05 17:37:15 +02:00
mach-davinci ARM: davinci: fix sleep.S build error on ARMv4 2019-07-23 10:12:53 -07:00
mach-digicolor treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-dove
mach-ebsa110 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-efm32
mach-ep93xx ARM: ep93xx: Mark expected switch fall-through 2019-08-09 19:53:35 -05:00
mach-exynos ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-footbridge treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-gemini
mach-highbank ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-hisi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-imx ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-integrator treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-iop13xx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
mach-iop32x Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
mach-iop33x treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-ixp4xx docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
mach-keystone ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-ks8695 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 506 2019-06-19 17:11:22 +02:00
mach-moxart
mach-mv78xx0
mach-mvebu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 406 2019-06-05 17:37:13 +02:00
mach-mxs treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-nomadik
mach-npcm
mach-nspire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-omap1 Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
mach-omap2 ARM: SoC-related driver updates 2019-07-19 17:13:56 -07:00
mach-orion5x
mach-oxnas treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-picoxcell treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-prima2
mach-pxa ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-qcom treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-rda
mach-realview treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-rockchip Another missing of_node_put 2019-06-17 05:14:24 -07:00
mach-rpc ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-s3c24xx docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
mach-s3c64xx Merge branch 'regulator-5.3' into regulator-next 2019-07-04 17:34:32 +01:00
mach-s5pv210
mach-sa1100 ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-shmobile ARM: mach-shmobile: Don't init CNTVOFF/counter if PSCI is available 2019-05-31 11:38:01 +02:00
mach-socfpga treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-spear treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-sti treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-stm32 ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
mach-sunxi
mach-tango ARM: use arch_extension directive instead of arch argument 2019-06-19 09:44:25 -07:00
mach-tegra ARM: tegra: Mark expected switch fall-through 2019-08-09 19:45:22 -05:00
mach-u300
mach-uniphier
mach-ux500 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-versatile Versatile platform updates for the v5.3 kernel cycle: 2019-06-17 05:11:53 -07:00
mach-vexpress treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-vt8500
mach-w90x900 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-zx treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mach-zynq treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mm Wimplicit-fallthrough patches for 5.3-rc4 2019-08-10 10:10:33 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-06-17 20:20:36 -07:00
nwfpe
oprofile
plat-iop Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
plat-omap ARM: OMAP: dma: Mark expected switch fall-throughs 2019-08-09 19:45:41 -05:00
plat-orion
plat-pxa treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
plat-samsung docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
plat-versatile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
probes treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tools docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
vdso kbuild: add --hash-style= and --build-id unconditionally 2019-07-17 22:37:51 +09:00
vfp treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
xen
Kconfig ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
Kconfig-nommu
Kconfig.debug ARM: Delete netx a second time 2019-07-21 20:03:11 -07:00
Makefile kbuild: rebuild modules when module linker scripts are updated 2019-08-21 21:05:21 +09:00