Skip to content

Commit

Permalink
kbuild: move .SECONDARY special target to Kbuild.include
Browse files Browse the repository at this point in the history
In commit 54a702f ("kbuild: mark $(targets) as .SECONDARY and
remove .PRECIOUS markers"), I missed one important feature of the
.SECONDARY target:

    .SECONDARY with no prerequisites causes all targets to be
    treated as secondary.

... which agrees with the policy of Kbuild.

Let's move it to scripts/Kbuild.include, with no prerequisites.

Note:
If an intermediate file is generated by $(call if_changed,...), you
still need to add it to "targets" so its .*.cmd file is included.

The arm/arm64 crypto files are generated by $(call cmd,shipped),
so they do not need to be added to "targets", but need to be added
to "clean-files" so "make clean" can properly clean them away.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
  • Loading branch information
masahir0y committed Dec 2, 2018
1 parent 5439f09 commit 8e9b61b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arch/arm/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
$(call cmd,perl)
endif

targets += sha256-core.S sha512-core.S
clean-files += sha256-core.S sha512-core.S
2 changes: 1 addition & 1 deletion arch/arm64/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ $(src)/sha512-core.S_shipped: $(src)/sha512-armv8.pl
$(call cmd,perlasm)
endif

targets += sha256-core.S sha512-core.S
clean-files += sha256-core.S sha512-core.S
3 changes: 3 additions & 0 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,6 @@ endef

# delete partially updated (i.e. corrupted) files on error
.DELETE_ON_ERROR:

# do not delete intermediate files automatically
.SECONDARY:
4 changes: 0 additions & 4 deletions scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,4 @@ $(shell mkdir -p $(obj-dirs))
endif
endif

# Some files contained in $(targets) are intermediate artifacts.
# We never want them to be removed automatically.
.SECONDARY: $(targets)

.PHONY: $(PHONY)

0 comments on commit 8e9b61b

Please sign in to comment.