kbuild: deb-pkg: call more misc debhelper commands

Use dh_prep instead of removing old build directories manually.

Use dh_clean instead of removing build directories and debian/files
manually.

Call dh_testdir and dh_testroot for preliminary checks.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
This commit is contained in:
Masahiro Yamada
2024-01-13 19:43:39 +09:00
parent 1d7bae8f8c
commit f96beb84ef
2 changed files with 5 additions and 9 deletions

View File

@@ -42,6 +42,9 @@ package = $($(@:binary-%=%-package))
DH_OPTIONS = -p$(package)
define binary
$(Q)dh_testdir $(DH_OPTIONS)
$(Q)dh_testroot $(DH_OPTIONS)
$(Q)dh_prep $(DH_OPTIONS)
$(Q)+$(MAKE) $(make-opts) run-command KBUILD_RUN_COMMAND='+$$(srctree)/scripts/package/builddeb $(package)'
$(Q)dh_installdocs $(DH_OPTIONS)
$(Q)dh_installchangelogs $(DH_OPTIONS)
@@ -72,7 +75,8 @@ build-arch:
.PHONY: clean
clean:
$(Q)rm -rf debian/files debian/linux-* debian/deb-env.vars* debian/*.files
$(Q)dh_clean
$(Q)rm -rf debian/deb-env.vars* debian/*.files
$(Q)$(MAKE) ARCH=$(ARCH) clean
# If DEB_HOST_ARCH is empty, it is likely that debian/rules was executed