Skip to contentSkip to conversation

Revert "kbuild: merge scripts/mkmakefile to top Makefile"

PATCH In review Michal Suchanek 2 participants 11 messages May 26, 2021 – Jun 17, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "kbuild: merge scripts/mkmakefile to top Makefile"

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

---
 Makefile           | 15 +++------------
 scripts/mkmakefile | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 12 deletions(-)
 create mode 100755 scripts/mkmakefile
Makefile +3 -12
index 58b086b30144..462899c1b5d7 100644
@@ -573,24 +573,14 @@ scripts_basic:
 	$(Q)rm -f .tmp_quiet_recordmcount
 
 PHONY += outputmakefile
-ifdef building_out_of_srctree
 # Before starting out-of-tree build, make sure the source tree is clean.
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
 # output directory.
 # At the same time when output Makefile generated, generate .gitignore to
 # ignore whole output directory
-
-quiet_cmd_makefile = GEN     $@
-      cmd_makefile = { \
-	echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \
-	echo "include $(srctree)/Makefile"; \
-	} > $@
-
-Makefile: FORCE
-	$(call cmd,makefile)
-
-outputmakefile: Makefile
+outputmakefile:
+ifdef building_out_of_srctree
 	$(Q)if [ -f $(srctree)/.config -o \
 		 -d $(srctree)/include/config -o \
 		 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
@@ -601,6 +591,7 @@ outputmakefile: Makefile
 		false; \
 	fi
 	$(Q)ln -fsn $(srctree) source
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
 	$(Q)test -e .gitignore || \
 	{ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
scripts/mkmakefile new file +17 -0
new file mode 100755
index 000000000000..1cb174751429
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# Generates a small Makefile used in the root of the output
+# directory, to allow make to be started from there.
+# The Makefile also allow for more convinient build of external modules
+
+# Usage
+# $1 - Kernel src directory
+
+if [ "${quiet}" != "silent_" ]; then
+	echo "  GEN     Makefile"
+fi
+
+cat << EOF > Makefile
+# Automatically generated by $0: don't edit
+include $1/Makefile
+EOF
Signature · 1 line
2.26.2
#1 lore raw
Quoted 9 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

Makefile +4 -6
index 54bb019a7da3..504327207d66 100644
@@ -552,16 +552,13 @@ ifdef building_out_of_srctree
 # At the same time when output Makefile generated, generate .gitignore to
 # ignore whole output directory
 
-quiet_cmd_makefile = GEN     $@
+quiet_cmd_makefile = GEN     Makefile
       cmd_makefile = { \
        echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \
        echo "include $(srctree)/Makefile"; \
-       } > $@
+       } > Makefile
 
-Makefile: FORCE
-       $(call cmd,makefile)
-
-outputmakefile: Makefile
+outputmakefile:
        $(Q)if [ -f $(srctree)/.config -o \
                 -d $(srctree)/include/config -o \
                 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
@@ -572,6 +569,7 @@ outputmakefile: Makefile
                false; \
        fi
        $(Q)ln -fsn $(srctree) source
+       $(call cmd,makefile)
        $(Q)test -e .gitignore || \
        { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
Quoted 71 lines
---
 Makefile           | 15 +++------------
 scripts/mkmakefile | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 12 deletions(-)
 create mode 100755 scripts/mkmakefile
Makefile +3 -12
index 58b086b30144..462899c1b5d7 100644
@@ -573,24 +573,14 @@ scripts_basic:
        $(Q)rm -f .tmp_quiet_recordmcount
 
 PHONY += outputmakefile
-ifdef building_out_of_srctree
 # Before starting out-of-tree build, make sure the source tree is clean.
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
 # output directory.
 # At the same time when output Makefile generated, generate .gitignore to
 # ignore whole output directory
-
-quiet_cmd_makefile = GEN     $@
-      cmd_makefile = { \
-       echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \
-       echo "include $(srctree)/Makefile"; \
-       } > $@
-
-Makefile: FORCE
-       $(call cmd,makefile)
-
-outputmakefile: Makefile
+outputmakefile:
+ifdef building_out_of_srctree
        $(Q)if [ -f $(srctree)/.config -o \
                 -d $(srctree)/include/config -o \
                 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
@@ -601,6 +591,7 @@ outputmakefile: Makefile
                false; \
        fi
        $(Q)ln -fsn $(srctree) source
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
        $(Q)test -e .gitignore || \
        { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
scripts/mkmakefile new file +17 -1
new file mode 100755
index 000000000000..1cb174751429
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# Generates a small Makefile used in the root of the output
+# directory, to allow make to be started from there.
+# The Makefile also allow for more convinient build of external modules
+
+# Usage
+# $1 - Kernel src directory
+
+if [ "${quiet}" != "silent_" ]; then
+       echo "  GEN     Makefile"
+fi
+
+cat << EOF > Makefile
+# Automatically generated by $0: don't edit
+include $1/Makefile
+EOF
--

2.26.2

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 125 lines
Makefile +4 -6
index 54bb019a7da3..504327207d66 100644
@@ -552,16 +552,13 @@ ifdef building_out_of_srctree
 # At the same time when output Makefile generated, generate .gitignore to
 # ignore whole output directory
 
-quiet_cmd_makefile = GEN     $@
+quiet_cmd_makefile = GEN     Makefile
       cmd_makefile = { \
        echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \
        echo "include $(srctree)/Makefile"; \
-       } > $@
+       } > Makefile
 
-Makefile: FORCE
-       $(call cmd,makefile)
-
-outputmakefile: Makefile
+outputmakefile:
        $(Q)if [ -f $(srctree)/.config -o \
                 -d $(srctree)/include/config -o \
                 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
@@ -572,6 +569,7 @@ outputmakefile: Makefile
                false; \
        fi
        $(Q)ln -fsn $(srctree) source
+       $(call cmd,makefile)
        $(Q)test -e .gitignore || \
        { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
Quoted 86 lines














---
 Makefile           | 15 +++------------
 scripts/mkmakefile | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 12 deletions(-)
 create mode 100755 scripts/mkmakefile
Makefile +3 -12
index 58b086b30144..462899c1b5d7 100644
@@ -573,24 +573,14 @@ scripts_basic:
        $(Q)rm -f .tmp_quiet_recordmcount
 
 PHONY += outputmakefile
-ifdef building_out_of_srctree
 # Before starting out-of-tree build, make sure the source tree is clean.
 # outputmakefile generates a Makefile in the output directory, if using a
 # separate output directory. This allows convenient use of make in the
 # output directory.
 # At the same time when output Makefile generated, generate .gitignore to
 # ignore whole output directory
-
-quiet_cmd_makefile = GEN     $@
-      cmd_makefile = { \
-       echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \
-       echo "include $(srctree)/Makefile"; \
-       } > $@
-
-Makefile: FORCE
-       $(call cmd,makefile)
-
-outputmakefile: Makefile
+outputmakefile:
+ifdef building_out_of_srctree
        $(Q)if [ -f $(srctree)/.config -o \
                 -d $(srctree)/include/config -o \
                 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
@@ -601,6 +591,7 @@ outputmakefile: Makefile
                false; \
        fi
        $(Q)ln -fsn $(srctree) source
+       $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
        $(Q)test -e .gitignore || \
        { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
 endif
scripts/mkmakefile new file +17 -1
new file mode 100755
index 000000000000..1cb174751429
@@ -0,0 +1,17 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# Generates a small Makefile used in the root of the output
+# directory, to allow make to be started from there.
+# The Makefile also allow for more convinient build of external modules
+
+# Usage
+# $1 - Kernel src directory
+
+if [ "${quiet}" != "silent_" ]; then
+       echo "  GEN     Makefile"
+fi
+
+cat << EOF > Makefile
+# Automatically generated by $0: don't edit
+include $1/Makefile
+EOF
--

2.26.2

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 21 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Quoted 8 lines

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
Quoted 29 lines · Masahiro Yamada
Quoted 28 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Quoted 7 lines
Quoted 1 line

Michal

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

During package build you have four directories

- the source directory
- the build directory
- the staging directory where files are installed to be included in the package
- the target directory where files will be installed on the target system once the package is installed by the user

The makefile is generated for the build directory, not the target directory. What is needed is a way to generate a makefile in the staging directory that will work when installed in the target directory. When mkmakefile is folded into makefile the makefile can no longer be regenerated because it is up-to-date, and it can no longer be specified that it should be generated for the target directory, not the staging directory.

Thanks

Michal

#5 lore raw
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Anyway, please try next-20210602
and see if you still have a problem.

Quoted 21 lines

During package build you have four directories

- the source directory
- the build directory
- the staging directory where files are installed to be included in the package
- the target directory where files will be installed on the target system once the package is installed by the user

The makefile is generated for the build directory, not the target directory. What is needed is a way to generate a makefile in the staging directory that will work when installed in the target directory. When mkmakefile is folded into makefile the makefile can no longer be regenerated because it is up-to-date, and it can no longer be specified that it should be generated for the target directory, not the staging directory.

Thanks

Michal

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw
Quoted 42 lines · Masahiro Yamada
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

Quoted 8 lines

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Anyway, please try next-20210602
and see if you still have a problem.

Yes, I still have a problem.

My packaging script calls mkmakefile which no longer exists.

Regardless of whther the new code works correctly or not in the usual case it removes the ability to regenearte the makefile for a specific target location.

Thanks

Michal

Quoted 27 lines
Quoted 21 lines

During package build you have four directories

- the source directory
- the build directory
- the staging directory where files are installed to be included in the package
- the target directory where files will be installed on the target system once the package is installed by the user

The makefile is generated for the build directory, not the target directory. What is needed is a way to generate a makefile in the staging directory that will work when installed in the target directory. When mkmakefile is folded into makefile the makefile can no longer be regenerated because it is up-to-date, and it can no longer be specified that it should be generated for the target directory, not the staging directory.

Thanks

Michal

Signature · 2 lines
Best Regards
Masahiro Yamada
#7 lore raw
Quoted 50 lines · Michal Suchánek
Quoted 48 lines · Masahiro Yamada
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Quoted 6 lines
Quoted 2 lines

Anyway, please try next-20210602
and see if you still have a problem.

Yes, I still have a problem.

My packaging script calls mkmakefile which no longer exists.

So, we are not talking about the functionality any more.

What is important for you is, you have a separate file.

You overwrite scripts/mkmakefile for doing
whatever hacks you like.

If the code is moved into the Makefile,
it will be more difficult to insert hacks.

This is what I understood from your statement.

Quoted 36 lines

Regardless of whther the new code works correctly or not in the usual case it removes the ability to regenearte the makefile for a specific target location.

Thanks

Michal

Quoted 27 lines
Quoted 18 lines

During package build you have four directories

- the source directory
- the build directory
- the staging directory where files are installed to be included in the package
- the target directory where files will be installed on the target system once the package is installed by the user

The makefile is generated for the build directory, not the target directory. What is needed is a way to generate a makefile in the staging directory that will work when installed in the target directory. When mkmakefile is folded into makefile the makefile can no longer be regenerated because it is up-to-date, and it can no longer be specified that it should be generated for the target directory, not the staging directory.

Quoted 3 lines

Thanks

Michal

--
Best Regards
Masahiro Yamada

Signature · 2 lines
Best Regards
Masahiro Yamada
#8 lore raw
Quoted 63 lines · Masahiro Yamada
Quoted 50 lines · Michal Suchánek
Quoted 48 lines · Masahiro Yamada
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Quoted 6 lines
Quoted 2 lines

Anyway, please try next-20210602
and see if you still have a problem.

Yes, I still have a problem.

My packaging script calls mkmakefile which no longer exists.

So, we are not talking about the functionality any more.

What is important for you is, you have a separate file.

Quoted 7 lines

You overwrite scripts/mkmakefile for doing
whatever hacks you like.

If the code is moved into the Makefile,
it will be more difficult to insert hacks.

This is what I understood from your statement.

I did not insert hacks. I called the script that your patch removes.

That's functionality that is lost.

Now without the script separate from the makefile inserting hacks will be required.

I would like to avoid that.

Thanks

Michal

Quoted 41 lines
Quoted 35 lines

Regardless of whther the new code works correctly or not in the usual case it removes the ability to regenearte the makefile for a specific target location.

Thanks

Michal

Quoted 27 lines
Quoted 18 lines

During package build you have four directories

- the source directory
- the build directory
- the staging directory where files are installed to be included in the package
- the target directory where files will be installed on the target system once the package is installed by the user

The makefile is generated for the build directory, not the target directory. What is needed is a way to generate a makefile in the staging directory that will work when installed in the target directory. When mkmakefile is folded into makefile the makefile can no longer be regenerated because it is up-to-date, and it can no longer be specified that it should be generated for the target directory, not the staging directory.

Quoted 3 lines

Thanks

Michal

--
Best Regards
Masahiro Yamada

Signature · 2 lines
Best Regards
Masahiro Yamada
#9 lore raw
Quoted 68 lines · Michal Suchánek
Quoted 66 lines · Masahiro Yamada
Quoted 50 lines · Michal Suchánek
Quoted 48 lines · Masahiro Yamada
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Quoted 6 lines
Quoted 2 lines

Anyway, please try next-20210602
and see if you still have a problem.

Yes, I still have a problem.

My packaging script calls mkmakefile which no longer exists.

So, we are not talking about the functionality any more.

What is important for you is, you have a separate file.

You overwrite scripts/mkmakefile for doing
whatever hacks you like.

Quoted 6 lines
Quoted 4 lines

If the code is moved into the Makefile,
it will be more difficult to insert hacks.

This is what I understood from your statement.

I did not insert hacks. I called the script that your patch removes.

You can copy scripts/mkmakefile
to your packaging project if it is needed.

It is a very short code that generates two lines.

cat << EOF > Makefile
# Automatically generated by $0: don't edit
include $1/Makefile
EOF

You can also copy-paste it to your packaging script.

Quoted 9 lines

That's functionality that is lost.

Now without the script separate from the makefile inserting hacks will be required.

I would like to avoid that.

Thanks

--
Best Regards
Masahiro Yamada

#10 lore raw
Quoted 80 lines · Masahiro Yamada
Quoted 68 lines · Michal Suchánek
Quoted 66 lines · Masahiro Yamada
Quoted 50 lines · Michal Suchánek
Quoted 48 lines · Masahiro Yamada
Quoted 33 lines · Michal Suchánek
Quoted 31 lines · Masahiro Yamada
Quoted 29 lines · Michal Suchánek
Quoted 9 lines · Masahiro Yamada
Quoted 8 lines · Michal Suchanek

This reverts commit 243b50c141d71fcf7b88e94474b3b9269f0b1f9d.

When packaging the kernel it is built in different place from the one in which it will be installed. After build the makefile needs to be regenerated with the target location but with mkmakefile merged into Makefile tehre is no way to do that.

Quoted 6 lines
Quoted 1 line

My patch was not working as expected
regardless of packaging.

Does the following fix-up work for you?

For the packaging I need some way to regenerate the Makefile and fake the directory where the Makefile will be on the user system (ie DESTDIR)

Without the mkmakefile I do not see any way to do it.

If the kernel makefile is no longer location dependent there is no need any more, of course.

Thanks

Michal

Quoted 7 lines
Quoted 5 lines

Sorry, I do not understand this.

IIUC, this patch does not change any functionality. The generated Makefile is still the same. Why is it a problem?

It cannot be regenerated.

This is an issue regardless of your packaging. That is why I suggested a patch in my previous reply.

https://lore.kernel.org/linux-kbuild/CAK7LNASEqKwQeLPXedyut+ykSJGPuq3CO1g_fS=sVDaZrwBPBQ@mail.gmail.com/

Quoted 6 lines
Quoted 2 lines

Anyway, please try next-20210602
and see if you still have a problem.

Yes, I still have a problem.

My packaging script calls mkmakefile which no longer exists.

So, we are not talking about the functionality any more.

What is important for you is, you have a separate file.

You overwrite scripts/mkmakefile for doing
whatever hacks you like.

Quoted 6 lines
Quoted 4 lines

If the code is moved into the Makefile,
it will be more difficult to insert hacks.

This is what I understood from your statement.

I did not insert hacks. I called the script that your patch removes.

You can copy scripts/mkmakefile
to your packaging project if it is needed.

Quoted 8 lines

It is a very short code that generates two lines.

cat << EOF > Makefile
# Automatically generated by $0: don't edit
include $1/Makefile
EOF

You can also copy-paste it to your packaging script.

Hello

In fact the mkmakefile script dropped support for the second argument that tells it where to genereate the makefile and thus became unusable for packaging some time ago already.

With simplification of the makefile to the point it is trivial no script to regenereate it is necessary. It can be generated with a simple echo command.

Thanks

Michal