u-boot/scripts
Masahiro Yamada c16b137e49 kbuild: add .SECONDARY special target to scripts/Kbuild.include
Based on the following Linux commits:

 - 54a702f70589 ("kbuild: mark $(targets) as .SECONDARY and remove
   .PRECIOUS markers")

 - 8e9b61b293d9 ("kbuild: move .SECONDARY special target to
   Kbuild.include")

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.

.SECONDARY with no prerequisites causes all targets to be treated as
secondary. This agrees the policy of Kbuild.

scripts/Kbuild.include seems a suitable place to add it because it is
included from almost all sub-makes.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-01-15 15:28:53 -05:00
..
basic SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
coccinelle scripts/coccinelle: add some more coccinelle tests 2018-03-09 12:31:07 -05:00
dtc pylibfdt: Use Python 2 in Makefile 2019-01-15 15:28:45 -05:00
kconfig kconfig: Avoid format overflow warning from GCC 8.1 2018-07-25 08:47:52 +09:00
.gitignore docproc: Remove 2018-08-03 19:53:54 -04:00
bin2c.c scripts: import bin2c.c from Linux 4.10-rc6 2017-02-08 15:56:19 -05:00
binutils-version.sh scripts: fix binutils-version.sh for 'as' without a package. 2015-01-08 11:00:45 -05:00
build-whitelist.sh sunxi: Fix CONFIG_SUNXI_GMAC references 2017-09-01 20:48:27 +05:30
check-config.sh scripts/check-config.sh: Add usage() 2018-12-26 18:24:26 -05:00
checkpatch.pl checkpatch.pl: update from Linux kernel v4.16 2018-04-10 15:19:15 -04:00
checkstack.pl avr32: Retire AVR32 for good 2017-07-06 16:17:19 -04:00
cleanpatch Makefile: Move some scripts imported from Linux 2013-12-13 09:18:45 -05:00
coccicheck Makefile: add coccicheck target 2017-11-20 20:18:38 -05:00
config_whitelist.txt configs: Resync with savedefconfig 2019-01-07 18:11:00 -05:00
const_structs.checkpatch checkpatch: update from Linux v4.13-rc6 2017-09-14 21:33:00 -04:00
coreboot.sed SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
decodecode scripts: add decodecode from Linux 2018-05-23 22:06:41 -04:00
dtc-version.sh Makefile: Update minimum dtc version to 1.4.3 2017-09-22 07:40:05 -04:00
fill_scrapyard.py SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gcc-stack-usage.sh SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gcc-version.sh kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
get_default_envs.sh script: Make get_default_envs.sh script exclude tools/env 2018-06-07 20:06:29 -04:00
get_maintainer.pl get_maintainer.pl: update from Linux kernel v4.16 2018-04-10 15:19:14 -04:00
Kbuild.include kbuild: add .SECONDARY special target to scripts/Kbuild.include 2019-01-15 15:28:53 -05:00
kernel-doc doc: Replace DocBook with sphinx-based docs 2018-07-23 14:33:21 -04:00
ld-version.sh scripts/ld-version.sh: regular expression compile fails 2017-11-20 20:18:37 -05:00
Lindent scripts/Lindent: import from Linux 3.16 2014-08-21 12:01:29 -04:00
mailmapper scripts: mailmapper: SPDX license identifier 2018-06-04 11:25:30 -04:00
Makefile docproc: Remove 2018-08-03 19:53:54 -04:00
Makefile.autoconf SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile.build kbuild: add .SECONDARY special target to scripts/Kbuild.include 2019-01-15 15:28:53 -05:00
Makefile.clean SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile.extrawarn SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile.host SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Makefile.lib kbuild: add .SECONDARY special target to scripts/Kbuild.include 2019-01-15 15:28:53 -05:00
Makefile.spl Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as CONFIG_SPL_USB_GADGET 2019-01-10 18:52:55 +01:00
Makefile.uncmd_spl SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mkmakefile kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
objdiff scripts: objdiff: Ignore debug info when comparing 2017-08-26 14:56:14 -04:00
setlocalversion scripts: setlocalversion: safely extract variables from auto.conf using awk 2017-08-13 17:15:08 +02:00
show-gnu-make SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spelling.txt scripts/spelling.txt: Sync script with kernel 4.16-rc4 2018-03-05 10:16:30 -05:00