Skip to content

Commit

Permalink
kbuild: pkg: clean up package files/dirs from the top Makefile
Browse files Browse the repository at this point in the history
I am not a big fan of the $(objtree)/ hack for clean-files/clean-dirs.

These are created in the top of $(objtree), so let's clean them up
from the top Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
  • Loading branch information
masahir0y committed Aug 24, 2019
1 parent cdfca82 commit 46a63d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1386,12 +1386,14 @@ CLEAN_FILES += modules.builtin.modinfo

# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include/generated \
arch/$(SRCARCH)/include/generated .tmp_objdiff
arch/$(SRCARCH)/include/generated .tmp_objdiff \
debian/ snap/ tar-install/
MRPROPER_FILES += .config .config.old .version \
Module.symvers \
signing_key.pem signing_key.priv signing_key.x509 \
x509.genkey extra_certificates signing_key.x509.keyid \
signing_key.x509.signer vmlinux-gdb.py
signing_key.x509.signer vmlinux-gdb.py \
*.spec

# Directories & files removed with 'make distclean'
DISTCLEAN_DIRS +=
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-$(CONFIG_SECURITY_SELINUX) += selinux

# Let clean descend into subdirs
subdir- += basic dtc gdb kconfig mod package
subdir- += basic dtc gdb kconfig mod
9 changes: 0 additions & 9 deletions scripts/package/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ binrpm-pkg: FORCE
+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
$(UTS_MACHINE) -bb $(objtree)/binkernel.spec

clean-files += $(objtree)/*.spec

deb-pkg: FORCE
$(MAKE) clean
$(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
Expand All @@ -82,8 +80,6 @@ bindeb-pkg: FORCE
intdeb-pkg: FORCE
+$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb

clean-dirs += $(objtree)/debian/

# snap-pkg
# ---------------------------------------------------------------------------
snap-pkg: FORCE
Expand All @@ -98,17 +94,12 @@ snap-pkg: FORCE
cd $(objtree)/snap && \
snapcraft --target-arch=$(UTS_MACHINE)

clean-dirs += $(objtree)/snap/

# tarball targets
# ---------------------------------------------------------------------------
tar%pkg: FORCE
$(MAKE) -f $(srctree)/Makefile
+$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@

clean-dirs += $(objtree)/tar-install/


# perf-pkg - generate a source tarball with perf source
# ---------------------------------------------------------------------------

Expand Down

0 comments on commit 46a63d4

Please sign in to comment.