Skip to contentSkip to conversation

kbuild: Add "make headers" to "make help" output

PATCH In review Xin Li (Intel) 4 participants 16 messages Mar 8, 2025 – Mar 11, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Add "make headers" to "make help" output

Meanwhile explicitly state that the headers are uapi headers.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 70bdbf2218fc..8f5aa710105e 100644
@@ -1659,7 +1659,8 @@ help:
 	@echo  '  kernelrelease	  - Output the release version string (use with make -s)'
 	@echo  '  kernelversion	  - Output the version stored in Makefile (use with make -s)'
 	@echo  '  image_name	  - Output the image name (use with make -s)'
-	@echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+	@echo  '  headers	  - Install sanitised kernel uapi headers to usr/include'
+	@echo  '  headers_install - Install sanitised kernel uapi headers to INSTALL_HDR_PATH'; \
 	 echo  '                    (default: $(INSTALL_HDR_PATH))'; \
 	 echo  ''
 	@echo  'Static analysers:'

base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6

Signature · 1 line
2.48.1
#1 lore raw
Quoted 13 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index 70bdbf2218fc..8f5aa710105e 100644

Makefile help: · line 1662

Quoted 5 lines
Makefile +1 -1
@@ -1659,7 +1659,8 @@ help:
 	@echo  '  kernelrelease	  - Output the release version string (use with make -s)'
 	@echo  '  kernelversion	  - Output the version stored in Makefile (use with make -s)'
 	@echo  '  image_name	  - Output the image name (use with make -s)'
-	@echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+	@echo  '  headers	  - Install sanitised kernel uapi headers to usr/include'
									     ^^^^^^^^^^^

It is INSTALL_HDR_PATH too, try:

make O=/tmp/b/ headers

for example.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 22 lines · Borislav Petkov
Quoted 13 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +0 -0
index 70bdbf2218fc..8f5aa710105e 100644

Makefile help: · line 1662

Quoted 5 lines
Makefile +1 -1
@@ -1659,7 +1659,8 @@ help:
      @echo  '  kernelrelease   - Output the release version string (use with make -s)'
      @echo  '  kernelversion   - Output the version stored in Makefile (use with make -s)'
      @echo  '  image_name      - Output the image name (use with make -s)'
-     @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+     @echo  '  headers         - Install sanitised kernel uapi headers to usr/include'
                                                                             ^^^^^^^^^^^
Quoted 5 lines

It is INSTALL_HDR_PATH too, try:

make O=/tmp/b/ headers

for example.

No. usr/include

--
Best Regards
Masahiro Yamada

#3 lore raw
Quoted 7 lines · Masahiro Yamada
Quoted 5 lines

It is INSTALL_HDR_PATH too, try:

make O=/tmp/b/ headers

for example.

No. usr/include

Yes, ok, "usr/include" is a relative path but it should at least say *relative* to the current output directory so that it is perfectly clear.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw
In reply to Xin Li (Intel)
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

Quoted 21 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 70bdbf2218fc..8f5aa710105e 100644
@@ -1659,7 +1659,8 @@ help:
        @echo  '  kernelrelease   - Output the release version string (use with make -s)'
        @echo  '  kernelversion   - Output the version stored in Makefile (use with make -s)'
        @echo  '  image_name      - Output the image name (use with make -s)'
-       @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+       @echo  '  headers         - Install sanitised kernel uapi headers to usr/include'
+       @echo  '  headers_install - Install sanitised kernel uapi headers to INSTALL_HDR_PATH'; \
         echo  '                    (default: $(INSTALL_HDR_PATH))'; \
         echo  ''
        @echo  'Static analysers:'
Quoted 4 lines

base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6 --
2.48.1

--
Best Regards
Masahiro Yamada

#5 lore raw
Quoted 36 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

Quoted 21 lines
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 70bdbf2218fc..8f5aa710105e 100644
@@ -1659,7 +1659,8 @@ help:
        @echo  '  kernelrelease   - Output the release version string (use with make -s)'
        @echo  '  kernelversion   - Output the version stored in Makefile (use with make -s)'
        @echo  '  image_name      - Output the image name (use with make -s)'
-       @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+       @echo  '  headers         - Install sanitised kernel uapi headers to usr/include'
+       @echo  '  headers_install - Install sanitised kernel uapi headers to INSTALL_HDR_PATH'; \
         echo  '                    (default: $(INSTALL_HDR_PATH))'; \
         echo  ''
        @echo  'Static analysers:'
Quoted 10 lines
Quoted 4 lines

base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6 --
2.48.1

--
Best Regards
Masahiro Yamada

Unfortunately it seems users haven't been following that :(

#6 lore raw
Quoted 1 line · H. Peter Anvin

Unfortunately it seems users haven't been following that :(

If by "users haven't been following that" you mean they've been doing

make kselftest

in order to run selftests and *that* thing builds headers, then yes, you're right.

Oh look:

PHONY += kselftest
kselftest: headers

	   ^^^^^^^^
        $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests

:-P

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#7 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 1 line · H. Peter Anvin

Unfortunately it seems users haven't been following that :(

If by "users haven't been following that" you mean they've been doing

make kselftest

in order to run selftests and *that* thing builds headers, then yes, you're right.

Quoted 9 lines

Oh look:

PHONY += kselftest
kselftest: headers

	   ^^^^^^^^
       $(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests

:-P

That's not the only one. Point being that users have been using it so it is better to make it official than breaking it.

#8 lore raw
Quoted 2 lines · H. Peter Anvin

That's not the only one. Point being that users have been using it so it is better to make it official than breaking it.

Yap, it ain't internal anymore - that's for sure.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author
#9 lore raw
In reply to Masahiro Yamada
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Thanks!
Xin

Quoted 35 lines
Quoted 24 lines
---
  Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 70bdbf2218fc..8f5aa710105e 100644
@@ -1659,7 +1659,8 @@ help:
         @echo  '  kernelrelease   - Output the release version string (use with make -s)'
         @echo  '  kernelversion   - Output the version stored in Makefile (use with make -s)'
         @echo  '  image_name      - Output the image name (use with make -s)'
-       @echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+       @echo  '  headers         - Install sanitised kernel uapi headers to usr/include'
+       @echo  '  headers_install - Install sanitised kernel uapi headers to INSTALL_HDR_PATH'; \
          echo  '                    (default: $(INSTALL_HDR_PATH))'; \
          echo  ''
         @echo  'Static analysers:'
Quoted 4 lines

base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6 --
2.48.1

--
Best Regards
Masahiro Yamada

#10 lore raw
Quoted 15 lines · Xin Li
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

Quoted 8 lines

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Thanks!
Xin

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

Signature · 2 lines
Best Regards
Masahiro Yamada
#11 lore raw
Quoted 23 lines · Masahiro Yamada
Quoted 21 lines · Xin Li
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Quoted 7 lines
Quoted 2 lines

Thanks!
Xin

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

For clarification, the following is the rationale.

Build Installation
-------------------------------------

vmlinux               install
modules               modules_install
dtbs                  dtbs_install
headers               headers_install

In Kbuild, the Build and Installation are separate steps, since the latter usually requires the root permission.

Signature · 2 lines
Best Regards
Masahiro Yamada
author
#12 lore raw
Quoted 47 lines · Masahiro Yamada
Quoted 23 lines · Masahiro Yamada
Quoted 21 lines · Xin Li
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Quoted 7 lines
Quoted 2 lines

Thanks!
Xin

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

For clarification, the following is the rationale.

Build Installation
-------------------------------------

vmlinux               install
modules               modules_install
dtbs                  dtbs_install
headers               headers_install
Quoted 3 lines

In Kbuild, the Build and Installation are separate steps, since the latter usually requires the root permission.

Oh, I didn't realize, thanks for making it clear.
Xin

author
#13 lore raw
In reply to Masahiro Yamada
Quoted 22 lines · Masahiro Yamada
Quoted 21 lines · Xin Li
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Quoted 8 lines
Quoted 2 lines

Thanks!
Xin

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

LGTM.

I guess you will make the change right now?

Thanks!
Xin

#14 lore raw
Quoted 28 lines · Xin Li
Quoted 26 lines · Masahiro Yamada
Quoted 23 lines · Xin Li
Quoted 12 lines · Masahiro Yamada
Quoted 2 lines · Xin Li (Intel)

Meanwhile explicitly state that the headers are uapi headers.

There are many internal-use targets, which are not documented in the help message.
I assume this one is the case.

If users want to install UAPI headers, 'headers_install' is the user-visible interface and it is already documented.

hpa and Boris prefer to add it, which I also agree. But ofc it's your call :)

If you don't want to add help for "headers", it probably still makes sense to explicitly state that the headers are uapi headers, no?

Thanks!
Xin

Quoted 9 lines
Quoted 4 lines

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

LGTM.

I guess you will make the change right now?

I will not do it myself, but I just suggested a change for v2.

Signature · 2 lines
Best Regards
Masahiro Yamada
author
#15 lore raw
Quoted 5 lines · Masahiro Yamada
Quoted 5 lines
Quoted 4 lines

If a help message for "headers" is desired, how about this?

headers - Build read-to-install uapi headers in usr/include

Quoted 7 lines
Quoted 4 lines

LGTM.

I guess you will make the change right now?

I will not do it myself, but I just suggested a change for v2.

I will take care of it then.