tools/elfutils: add maintainer-clean to clean target
authorMichael Pratt <mcpratt@pm.me>
Tue, 24 Sep 2024 22:50:15 +0000 (18:50 -0400)
committerRobert Marko <robimarko@gmail.com>
Sat, 26 Jul 2025 12:38:08 +0000 (14:38 +0200)
commitc83941d288408308126a6f6bda12eca06a43253c
treecc42b2b33a2b34bcc97f13f84a6e434f686434bd
parentc16ed51e0606833f9094f0d9b44f7db7f85b2988
tools/elfutils: add maintainer-clean to clean target

Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does delete itself or libtool.

In order to enable rules for building what is removed,
maintainer mode is required for configuring.

Building from tracked sources only with maintainer mode
requires a lexical analyzer, so add dependency for bison.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

The function obstack_printf() is not present on macOS,
so use the available gnulib module and their dependencies.

Many more modules from gnulib are now needed,
and some replacements of some functions must be skipped
to prevent build errors at link time.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
tools/Makefile
tools/elfutils/Makefile