From aed966aa4873af2d84fd445f49cf33f719539c9e Mon Sep 17 00:00:00 2001 From: Alberto Leiva Popper Date: Sat, 23 Dec 2023 16:24:14 -0600 Subject: [PATCH] Add distclean and maintainer-clean GNU defines `distclean` and `maintainer-clean` as standard Makefile targets employed for workspace cleanup. Jool's non-autogenerated Makefiles were sometimes missing them. Because `distclean` wasn't always defined, dpkg-buildpackage was falling back to `clean` during the `dh_auto_clean` preparation step. `clean` doesn't remove several build files (including Makefiles), so `dpkg-buildpackage` was giving up after finding the workspace contaminated. So... implement `distclean`. This fixes Debian#1046037. There are other GNU targets Jool is sometimes missing, but I'm pushing that outside of the scope of this patch. --- src/mod/Makefile | 4 +++- src/usr/iptables/Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod/Makefile b/src/mod/Makefile index 6c9cdcb64..6680a2e07 100644 --- a/src/mod/Makefile +++ b/src/mod/Makefile @@ -13,10 +13,12 @@ install: $(foreach dir, $(PROJECTS), $(MAKE) -C $(dir) modules_install;) /sbin/depmod +distclean maintainer-clean: clean + # This target is needed to generate the upstream tarball. # It's not a standard Kbuild target. distdir: mkdir -p ${distdir} cp -r * ${distdir} -.PHONY: $(PROJECTS) $(OTHER_TARGETS) install dist +.PHONY: $(PROJECTS) $(OTHER_TARGETS) install dist distclean maintainer-clean diff --git a/src/usr/iptables/Makefile b/src/usr/iptables/Makefile index d40534d2e..c2b28f09a 100644 --- a/src/usr/iptables/Makefile +++ b/src/usr/iptables/Makefile @@ -37,7 +37,7 @@ lib%.so: lib%.o ${CC} -shared -fPIC ${LDFLAGS} -o $@ $^; lib%.o: lib%.c ${CC} ${DEFAULT_CFLAGS} ${CPPFLAGS} ${CFLAGS} -D_INIT=lib$*_init -fPIC -c -o $@ $<; -clean distclean: +clean distclean maintainer-clean: rm -f *.so distdir: mkdir -p ${distdir}