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 | include $(srctree)/scripts/Makefile.lib | 5 | include $(srctree)/scripts/Makefile.lib |
| 6 | 6 | ||
| 7 | KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) | 7 | KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) |
| 8 | KBUILD_PKG_ROOTCMD ?="fakeroot -u" | ||
| 9 | # Include only those top-level files that are needed by make, plus the GPL copy | 8 | # Include only those top-level files that are needed by make, plus the GPL copy |
| 10 | TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \ | 9 | TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \ |
| 11 | include init io_uring ipc kernel lib mm net rust \ | 10 | include init io_uring ipc kernel lib mm net rust \ |
| @@ -86,6 +85,9 @@ binrpm-pkg: · 74 unmodified lines | |||
| 86 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ | 85 | +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ |
| 87 | $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec | 86 | $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec |
| 88 | 87 | ||
| 88 | # deb-pkg srcdeb-pkg bindeb-pkg | ||
| 89 | # --------------------------------------------------------------------------- | ||
| 90 | |||
| 89 | quiet_cmd_debianize = GEN $@ | 91 | quiet_cmd_debianize = GEN $@ |
| 90 | cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts) | 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 | cp $< ../$(orig-name); \ | 106 | cp $< ../$(orig-name); \ |
| 105 | fi | 107 | fi |
| 106 | 108 | ||
| 107 | PHONY += deb-pkg | 109 | KBUILD_PKG_ROOTCMD ?= 'fakeroot -u' |
| 108 | deb-pkg: debian-orig | 110 | |
| 109 | +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \ | 111 | PHONY += deb-pkg srcdeb-pkg bindeb-pkg |
| 110 | --build=source,binary -nc -us -uc | 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 | bindeb-pkg: debian | 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 | PHONY += intdeb-pkg | 129 | PHONY += intdeb-pkg |
| 117 | intdeb-pkg: | 130 | intdeb-pkg: |
| @@ -208,6 +221,7 @@ help: · 90 unmodified lines | |||
| 208 | @echo ' srcrpm-pkg - Build only the source kernel RPM package' | 221 | @echo ' srcrpm-pkg - Build only the source kernel RPM package' |
| 209 | @echo ' binrpm-pkg - Build only the binary kernel RPM package' | 222 | @echo ' binrpm-pkg - Build only the binary kernel RPM package' |
| 210 | @echo ' deb-pkg - Build both source and binary deb kernel packages' | 223 | @echo ' deb-pkg - Build both source and binary deb kernel packages' |
| 224 | @echo ' srcdeb-pkg - Build only the source kernel deb package' | ||
| 211 | @echo ' bindeb-pkg - Build only the binary kernel deb package' | 225 | @echo ' bindeb-pkg - Build only the binary kernel deb package' |
| 212 | @echo ' snap-pkg - Build only the binary kernel snap package' | 226 | @echo ' snap-pkg - Build only the binary kernel snap package' |
| 213 | @echo ' (will connect to external hosts)' | 227 | @echo ' (will connect to external hosts)' |