Skip to contentSkip to conversation

kbuild: deb-pkg: specify targets in debian/rules as .PHONY

PATCH In review Masahiro Yamada 2 participants 3 messages Apr 25, 2023 – Apr 26, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: deb-pkg: specify targets in debian/rules as .PHONY

If a file with the same name exists, the target is not run.

For example, the following command fails.

  $ make O=build-arch bindeb-pkg
    [ snip ]
  sed: can't read modules.order: No such file or directory
  make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
  make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
  make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
  make[3]: *** [debian/rules:14: binary-arch] Error 2
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2

---

 scripts/package/mkdebian | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/mkdebian +2 -0
index a4c2c2276223..b6cb95473548 100755
@@ -269,6 +269,8 @@ cat <<EOF > debian/rules
 srctree ?= .
 KERNELRELEASE = ${KERNELRELEASE}
 
+.PHONY: clean build build-arch build-indep binary binary-arch binary-indep
+
 build-indep:
 build-arch:
 	\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
Signature · 1 line
2.37.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Masahiro Yamada

If a file with the same name exists, the target is not run.

For example, the following command fails.

  $ make O=build-arch bindeb-pkg
    [ snip ]
  sed: can't read modules.order: No such file or directory
  make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
  make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
  make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
  make[3]: *** [debian/rules:14: binary-arch] Error 2
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2
Quoted 1 line
Quoted 21 lines

---

 scripts/package/mkdebian | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/mkdebian +2 -0
index a4c2c2276223..b6cb95473548 100755
@@ -269,6 +269,8 @@ cat <<EOF > debian/rules
 srctree ?= .
 KERNELRELEASE = ${KERNELRELEASE}
 
+.PHONY: clean build build-arch build-indep binary binary-arch binary-indep
+
 build-indep:
 build-arch:
 	\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
Signature · 1 line
2.37.2
#2 lore raw
Quoted 16 lines · Nathan Chancellor
Quoted 14 lines · Masahiro Yamada

If a file with the same name exists, the target is not run.

For example, the following command fails.

  $ make O=build-arch bindeb-pkg
    [ snip ]
  sed: can't read modules.order: No such file or directory
  make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
  make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
  make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
  make[3]: *** [debian/rules:14: binary-arch] Error 2
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2
Quoted 3 lines
Quoted 1 line

Applied to linux-kbuild.

Quoted 22 lines
Quoted 22 lines

---

 scripts/package/mkdebian | 2 ++
 1 file changed, 2 insertions(+)
scripts/package/mkdebian +2 -1
index a4c2c2276223..b6cb95473548 100755
@@ -269,6 +269,8 @@ cat <<EOF > debian/rules
 srctree ?= .
 KERNELRELEASE = ${KERNELRELEASE}
 
+.PHONY: clean build build-arch build-indep binary binary-arch binary-indep
+
 build-indep:
 build-arch:
      \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
--

2.37.2

Signature · 2 lines
Best Regards
Masahiro Yamada