diff mbox series

[1/5] kbuild: deb-pkg: move 'make headers' to build-arch

Message ID 20231230135200.1058873-1-masahiroy@kernel.org (mailing list archive)
State New
Headers show
Series [1/5] kbuild: deb-pkg: move 'make headers' to build-arch | expand

Commit Message

Masahiro Yamada Dec. 30, 2023, 1:51 p.m. UTC
Strictly speaking, 'make headers' should be a part of build-arch
instead of binary-arch.

'make headers' constructs read-to-copy UAPI headers in the kernel
directory.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/package/builddeb     | 1 -
 scripts/package/debian/rules | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

Masahiro Yamada Jan. 9, 2024, 4:38 a.m. UTC | #1
On Sat, Dec 30, 2023 at 10:52 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Strictly speaking, 'make headers' should be a part of build-arch
> instead of binary-arch.
>
> 'make headers' constructs read-to-copy UAPI headers in the kernel
> directory.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  scripts/package/builddeb     | 1 -
>  scripts/package/debian/rules | 4 ++--
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index cc8c7a807fcc..842ee4b40528 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -155,7 +155,6 @@ install_libc_headers () {
>
>         rm -rf $pdir
>
> -       $MAKE -f $srctree/Makefile headers
>         $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr
>
>         # move asm headers to /usr/include/<libc-machine>/asm to match the structure
> diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
> index cb084e387469..a686c37d0d02 100755
> --- a/scripts/package/debian/rules
> +++ b/scripts/package/debian/rules
> @@ -26,8 +26,8 @@ binary-arch: build-arch
>  build: build-arch build-indep
>  build-indep:
>  build-arch:
> -       $(MAKE) $(make-opts) \
> -       olddefconfig all
> +       $(MAKE) $(make-opts) olddefconfig
> +       $(MAKE) $(make-opts) headers all




To avoid a build error for ARCH=um,
I will apply the following fix-up.





diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index 1a18ca3c43db..098307780062 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -27,7 +27,7 @@ build: build-arch build-indep
 build-indep:
 build-arch:
        $(MAKE) $(make-opts) olddefconfig
-       $(MAKE) $(make-opts) headers all
+       $(MAKE) $(make-opts) $(if $(filter um,$(ARCH)),,headers) all

 .PHONY: clean
 clean:







>
>  .PHONY: clean
>  clean:
> --
> 2.40.1
>
Nicolas Schier Jan. 9, 2024, 1:24 p.m. UTC | #2
On Tue, Jan 09, 2024 at 01:38:07PM +0900, Masahiro Yamada wrote:
> On Sat, Dec 30, 2023 at 10:52 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Strictly speaking, 'make headers' should be a part of build-arch
> > instead of binary-arch.
> >
> > 'make headers' constructs read-to-copy UAPI headers in the kernel

s/read/ready/ ?

> > directory.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  scripts/package/builddeb     | 1 -
> >  scripts/package/debian/rules | 4 ++--
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index cc8c7a807fcc..842ee4b40528 100755
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -155,7 +155,6 @@ install_libc_headers () {
> >
> >         rm -rf $pdir
> >
> > -       $MAKE -f $srctree/Makefile headers
> >         $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr
> >
> >         # move asm headers to /usr/include/<libc-machine>/asm to match the structure
> > diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
> > index cb084e387469..a686c37d0d02 100755
> > --- a/scripts/package/debian/rules
> > +++ b/scripts/package/debian/rules
> > @@ -26,8 +26,8 @@ binary-arch: build-arch
> >  build: build-arch build-indep
> >  build-indep:
> >  build-arch:
> > -       $(MAKE) $(make-opts) \
> > -       olddefconfig all
> > +       $(MAKE) $(make-opts) olddefconfig
> > +       $(MAKE) $(make-opts) headers all
> 
> 
> 
> 
> To avoid a build error for ARCH=um,
> I will apply the following fix-up.
> 
> 
> 
> 
> 
> diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
> index 1a18ca3c43db..098307780062 100755
> --- a/scripts/package/debian/rules
> +++ b/scripts/package/debian/rules
> @@ -27,7 +27,7 @@ build: build-arch build-indep
>  build-indep:
>  build-arch:
>         $(MAKE) $(make-opts) olddefconfig
> -       $(MAKE) $(make-opts) headers all
> +       $(MAKE) $(make-opts) $(if $(filter um,$(ARCH)),,headers) all

Reviewed-by: Nicolas Schier <n.schier@avm.de>

I'm wondering if we might want to change the headers target in top-level
Makefile to not bail-out for ARCH=um but only show a warning that there
is nothing to export.

Kind regards,
Nicolas
Masahiro Yamada Jan. 9, 2024, 2:29 p.m. UTC | #3
On Tue, Jan 9, 2024 at 10:24 PM Nicolas Schier <n.schier@avm.de> wrote:
>
> On Tue, Jan 09, 2024 at 01:38:07PM +0900, Masahiro Yamada wrote:
> > On Sat, Dec 30, 2023 at 10:52 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > Strictly speaking, 'make headers' should be a part of build-arch
> > > instead of binary-arch.
> > >
> > > 'make headers' constructs read-to-copy UAPI headers in the kernel
>
> s/read/ready/ ?

Yes, thanks for catching it.




> I'm wondering if we might want to change the headers target in top-level
> Makefile to not bail-out for ARCH=um but only show a warning that there
> is nothing to export.


Yes, this is another way of fixing it, but
I do not even want to show a warning.

Having 'make ARCH=um headers' succeed silently
is another way.

I just stayed on a safer side.
diff mbox series

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index cc8c7a807fcc..842ee4b40528 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -155,7 +155,6 @@  install_libc_headers () {
 
 	rm -rf $pdir
 
-	$MAKE -f $srctree/Makefile headers
 	$MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr
 
 	# move asm headers to /usr/include/<libc-machine>/asm to match the structure
diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index cb084e387469..a686c37d0d02 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -26,8 +26,8 @@  binary-arch: build-arch
 build: build-arch build-indep
 build-indep:
 build-arch:
-	$(MAKE) $(make-opts) \
-	olddefconfig all
+	$(MAKE) $(make-opts) olddefconfig
+	$(MAKE) $(make-opts) headers all
 
 .PHONY: clean
 clean: