Thread (15 messages) 15 messages, 3 authors, 2021-09-28
STALE1826d

[PATCH 3/3] Makefile: make the "hdr-check" target non-.PHONY

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-09-21 22:55:25
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

For the same reason as the preceding commit (which made "sparse"
non-.PHONY), let's make the "hdr-check" target non-.PHONY.

We could also change this to do "-o $@" instead of creating an empty
file, but there would be no point, and it would just waste I/O and
disk space, we're not interested in the compilation output, just
whether or not we had an error.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 .gitignore | 1 +
 Makefile   | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
index b02250a50c4..4579985e2f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -220,6 +220,7 @@
 /cscope*
 /compile_commands.json
 *.hcc
+*.hco
 *.obj
 *.lib
 *.res
diff --git a/Makefile b/Makefile
index ce4063a031a..7980e69955a 100644
--- a/Makefile
+++ b/Makefile
@@ -2919,10 +2919,11 @@ HCC = $(HCO:hco=hcc)
 		echo '#include "$<"'; \
 	} >$@
 
-$(HCO): %.hco: %.hcc FORCE
-	$(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
+$(HCO): %.hco: %.hcc
+	$(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $< && \
+	>$@
 
-.PHONY: hdr-check $(HCO)
+.PHONY: hdr-check
 hdr-check: $(HCO)
 
 .PHONY: style
-- 
2.33.0.1098.gf02a64c1a2d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help