Skip to content

Commit

Permalink
Add distclean and maintainer-clean
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ydahhrk committed Dec 23, 2023
1 parent 44f1cea commit aed966a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/usr/iptables/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit aed966a

Please sign in to comment.