OpenCloudOS-Kernel/drivers
Masahiro Yamada 54a702f705 kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers
GNU Make automatically deletes intermediate files that are updated
in a chain of pattern rules.

Example 1) %.dtb.o <- %.dtb.S <- %.dtb <- %.dts
Example 2) %.o <- %.c <- %.c_shipped

A couple of makefiles mark such targets as .PRECIOUS to prevent Make
from deleting them, but the correct way is to use .SECONDARY.

  .SECONDARY
    Prerequisites of this special target are treated as intermediate
    files but are never automatically deleted.

  .PRECIOUS
    When make is interrupted during execution, it may delete the target
    file it is updating if the file was modified since make started.
    If you mark the file as precious, make will never delete the file
    if interrupted.

Both can avoid deletion of intermediate files, but the difference is
the behavior when Make is interrupted; .SECONDARY deletes the target,
but .PRECIOUS does not.

The use of .PRECIOUS is relatively rare since we do not want to keep
partially constructed (possibly corrupted) targets.

Another difference is that .PRECIOUS works with pattern rules whereas
.SECONDARY does not.

  .PRECIOUS: $(obj)/%.lex.c

works, but

  .SECONDARY: $(obj)/%.lex.c

has no effect.  However, for the reason above, I do not want to use
.PRECIOUS which could cause obscure build breakage.

The targets specified as .SECONDARY must be explicit.  $(targets)
contains all targets that need to include .*.cmd files.  So, the
intermediates you want to keep are mostly in there.  Therefore, mark
$(targets) as .SECONDARY.  It means primary targets are also marked
as .SECONDARY, but I do not see any drawback for this.

I replaced some .SECONDARY / .PRECIOUS markers with 'targets'.  This
will make Kbuild search for non-existing .*.cmd files, but this is
not a noticeable performance issue.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Frank Rowand <frowand.list@gmail.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
2018-04-07 19:04:02 +09:00
..
accessibility
acpi pci-v4.17-changes 2018-04-06 18:31:06 -07:00
amba
android
ata Merge branch 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2018-04-03 17:42:25 -07:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-04-01 19:49:34 -04:00
auxdisplay
base mm/memory_hotplug: optimize memory hotplug 2018-04-05 21:36:25 -07:00
bcma
block Merge branch 'akpm' (patches from Andrew) 2018-04-06 14:19:26 -07:00
bluetooth Bluetooth: Set HCI_QUIRK_SIMULTANEOUS_DISCOVERY for BTUSB_QCA_ROME 2018-04-01 21:43:02 +03:00
bus pci-v4.17-changes 2018-04-06 18:31:06 -07:00
cdrom
char kernel.h: Retain constant expression output for max()/min() 2018-04-05 14:17:16 -07:00
clk ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
clocksource ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
connector
cpufreq ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
cpuidle cpuidle: poll_state: Avoid invoking local_clock() too often 2018-03-29 13:06:08 +02:00
crypto .gitignore: move *-asn1.[ch] patterns to the top-level .gitignore 2018-04-07 19:04:02 +09:00
dax device-dax: implement ->pagesize() for smaps to report MMUPageSize 2018-04-05 21:36:26 -07:00
dca
devfreq
dio
dma dmaengine: stm32-dmamux: fix a potential buffer overflow 2018-03-22 10:51:35 +05:30
dma-buf
edac * Add NVDIMM support to EDAC (Tony Luck) 2018-04-05 14:21:13 -07:00
eisa
extcon Char/Misc patches for 4.17-rc1 2018-04-04 20:07:20 -07:00
firewire
firmware fw_cfg, vhost: features fixes 2018-04-06 19:21:41 -07:00
fmc treewide: Fix typos in printk 2018-03-27 09:51:22 +02:00
fpga PCI: Add Altera vendor ID 2018-03-19 14:18:22 -05:00
fsi
gpio DeviceTree updates for 4.17: 2018-04-05 21:03:42 -07:00
gpu pci-v4.17-changes 2018-04-06 18:31:06 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2018-04-05 11:53:34 -07:00
hsi HSI: hsi_char: Delete an error message for a failed memory allocation in hsc_probe() 2018-03-19 16:31:07 +01:00
hv hv: add SPDX license id to Kconfig 2018-03-28 13:24:56 +02:00
hwmon ARM SCMI fixes/cleanups for v4.17 2018-03-27 15:57:19 +02:00
hwspinlock
hwtracing Char/Misc patches for 4.17-rc1 2018-04-04 20:07:20 -07:00
i2c arch: remove obsolete architecture ports 2018-04-02 20:20:12 -07:00
ide for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
idle
iio This is the bulk of GPIO changes for the v4.17 kernel cycle: 2018-04-05 09:51:41 -07:00
infiniband Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2018-04-05 13:21:57 -07:00
iommu headers: untangle kmemleak.h from mm.h 2018-04-05 21:36:27 -07:00
ipack
irqchip Staging/IIO patches for 4.17-rc1 2018-04-04 18:56:27 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-04-03 14:04:18 -07:00
leds leds: Fix wrong dmi_match on PC Engines APU LEDs 2018-03-20 20:28:00 +01:00
lightnvm lightnvm: pblk: remove some unnecessary NULL checks 2018-03-29 17:29:09 -06:00
macintosh macintosh/via-pmu68k: Initialize PMU driver with setup_arch and arch_initcall 2018-03-19 10:22:59 +01:00
mailbox mailbox: Add support for Hi3660 mailbox 2018-03-20 11:15:54 +08:00
mcb mcb: Add Altera PCI ID to mcb-pci 2018-03-19 14:20:24 -05:00
md - DM core passthrough ioctl fix to retain reference to DM table, and 2018-04-06 11:50:19 -07:00
media Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-04-06 11:07:08 -07:00
memory
memstick
message treewide: Align function definition open/close braces 2018-03-26 11:13:09 +02:00
mfd
misc pci-v4.17-changes 2018-04-06 18:31:06 -07:00
mmc for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
mtd MTD changes: 2018-04-06 12:15:41 -07:00
mux
net pci-v4.17-changes 2018-04-06 18:31:06 -07:00
nfc
ntb
nubus
nvdimm for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
nvme for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
nvmem Char/Misc patches for 4.17-rc1 2018-04-04 20:07:20 -07:00
of kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers 2018-04-07 19:04:02 +09:00
opp
oprofile oprofilefs: don't oops on allocation failure 2018-03-29 15:07:48 -04:00
parisc parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode 2018-03-27 18:52:22 +02:00
parport Char/Misc patches for 4.17-rc1 2018-04-04 20:07:20 -07:00
pci pci-v4.17-changes 2018-04-06 18:31:06 -07:00
pcmcia Power management updates for 4.17-rc1 2018-04-03 10:45:39 -07:00
perf ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
phy ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
pinctrl This is the bulk of GPIO changes for the v4.17 kernel cycle: 2018-04-05 09:51:41 -07:00
platform Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2018-04-05 11:56:35 -07:00
pnp
power ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
powercap
pps
ps3
ptp
pwm ARM: SoC platform updates for 4.17 2018-04-05 21:21:08 -07:00
rapidio
ras
regulator Merge remote-tracking branches 'regulator/topic/88pg86x', 'regulator/topic/dt', 'regulator/topic/formatting' and 'regulator/topic/gpio' into regulator-next 2018-03-28 10:33:53 +08:00
remoteproc
reset Merge branch 'reset/lookup' into reset/next 2018-03-27 11:03:43 +02:00
rpmsg
rtc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2018-04-05 11:56:35 -07:00
s390 for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
sbus sparc64: Properly range check DAX completion index 2018-04-01 20:07:00 -04:00
scsi SCSI for-linus on 20180404 2018-04-05 15:05:53 -07:00
sfi
sh
siox
slimbus
sn
soc ARM: SoC driver updates for 4.17 2018-04-05 21:29:35 -07:00
soundwire
spi spi: SPI updates for v4.17 2018-04-03 12:06:21 -07:00
spmi
ssb
staging Merge branch 'akpm' (patches from Andrew) 2018-04-06 14:19:26 -07:00
target for-4.17/block-20180402 2018-04-05 14:27:02 -07:00
tc
tee
thermal
thunderbolt
tty TTY/Serial driver patches for 4.17-rc1 2018-04-04 18:43:49 -07:00
uio
usb TTY/Serial driver patches for 4.17-rc1 2018-04-04 18:43:49 -07:00
uwb
vfio VFIO updates for v4.17-rc1 2018-04-06 19:44:27 -07:00
vhost fw_cfg, vhost: features fixes 2018-04-06 19:21:41 -07:00
video TTY/Serial driver patches for 4.17-rc1 2018-04-04 18:43:49 -07:00
virt
virtio headers: untangle kmemleak.h from mm.h 2018-04-05 21:36:27 -07:00
visorbus
vlynq
vme
w1
watchdog This is the bulk of GPIO changes for the v4.17 kernel cycle: 2018-04-05 09:51:41 -07:00
xen x86/dma: Remove dma_alloc_coherent_mask() 2018-03-20 10:01:56 +01:00
zorro zorro: Set up z->dev.dma_mask for the DMA API 2018-03-19 10:26:46 +01:00
Kconfig hwtracing: Add HW tracing support menu 2018-03-29 13:38:10 +03:00
Makefile