This new target builds only the debian source package. Unify the build rules of deb-pkg, srcdeb-pkg, bindeb-pkg to avoid code duplication. --no-check-builddeps is added to srcdeb-pkg so that build dependencies will not be checked.
Unified · Split
| @@ -5,7 +5,6 @@ include $(srctree)/scripts/Kbuild.include · 4 unmodified lines | ||
| 5 | 5 | include $(srctree)/scripts/Makefile.lib |
| 6 | 6 | |
| 7 | 7 | KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) |
| 8 | −KBUILD_PKG_ROOTCMD ?="fakeroot -u" | |
| 9 | 8 | # Include only those top-level files that are needed by make, plus the GPL copy |
| 10 | 9 | TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \ |
| 11 | 10 | include init io_uring ipc kernel lib mm net rust \ |
| @@ -86,6 +85,9 @@ binrpm-pkg: · 74 unmodified lines | ||
| 86 | 85 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
| 87 | 86 | $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec |
| 88 | 87 | |
| 88 | +# deb-pkg srcdeb-pkg bindeb-pkg | |
| 89 | +# --------------------------------------------------------------------------- | |
| 90 | + | |
| 89 | 91 | quiet_cmd_debianize = GEN $@ |
| 90 | 92 | cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts) |
| 91 | 93 | |
| @@ -104,14 +106,25 @@ debian-orig: linux.tar.gz debian · 12 unmodified lines | ||
| 104 | 106 | cp $< ../$(orig-name); \ |
| 105 | 107 | fi |
| 106 | 108 | |
| 107 | −PHONY += deb-pkg | |
| 108 | −deb-pkg: debian-orig | |
| 109 | − +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \ | |
| 110 | − --build=source,binary -nc -us -uc | |
| 109 | +KBUILD_PKG_ROOTCMD ?= 'fakeroot -u' | |
| 110 | + | |
| 111 | +PHONY += deb-pkg srcdeb-pkg bindeb-pkg | |
| 112 | + | |
| 113 | +deb-pkg: private build-type := source,binary | |
| 114 | +srcdeb-pkg: private build-type := source | |
| 115 | +bindeb-pkg: private build-type := binary | |
| 111 | 116 | |
| 112 | −PHONY += bindeb-pkg | |
| 117 | +deb-pkg srcdeb-pkg: debian-orig | |
| 113 | 118 | bindeb-pkg: debian |
| 114 | − +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc | |
| 119 | +deb-pkg srcdeb-pkg bindeb-pkg: | |
| 120 | + +$(strip dpkg-buildpackage \ | |
| 121 | + --build=$(build-type) --no-pre-clean --unsigned-changes \ | |
| 122 | + $(if $(findstring source, $(build-type)), \ | |
| 123 | + --unsigned-source) \ | |
| 124 | + $(if $(findstring binary, $(build-type)), \ | |
| 125 | + -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \ | |
| 126 | + --no-check-builddeps) \ | |
| 127 | + $(DPKG_FLAGS)) | |
| 115 | 128 | |
| 116 | 129 | PHONY += intdeb-pkg |
| 117 | 130 | intdeb-pkg: |
| @@ -208,6 +221,7 @@ help: · 90 unmodified lines | ||
| 208 | 221 | @echo ' srcrpm-pkg - Build only the source kernel RPM package' |
| 209 | 222 | @echo ' binrpm-pkg - Build only the binary kernel RPM package' |
| 210 | 223 | @echo ' deb-pkg - Build both source and binary deb kernel packages' |
| 224 | + @echo ' srcdeb-pkg - Build only the source kernel deb package' | |
| 211 | 225 | @echo ' bindeb-pkg - Build only the binary kernel deb package' |
| 212 | 226 | @echo ' snap-pkg - Build only the binary kernel snap package' |
| 213 | 227 | @echo ' (will connect to external hosts)' |