From: Steven Sistare <steven.sistare@oracle.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH] make: clean after distclean deletes source files
Date: Tue, 9 May 2023 13:58:28 -0400 [thread overview]
Message-ID: <5fa2859e-df65-2300-25a9-66c9c3c8689e@oracle.com> (raw)
In-Reply-To: <1681909700-94095-1-git-send-email-steven.sistare@oracle.com>
Any takers? I believe this patch is correct and clean.
Examples, run in the top level of a git tree:
$ configure ...
$ make clean
... cleans ...
$ make clean
... cleans ...
$ make distclean
... cleans ...
$ make distclean
Makefile:180: *** Please call configure before running make. Stop.
$ make clean
Makefile:180: *** Please call configure before running make. Stop.
# unchecked goals still work
$ make cscope
cscope Remove old cscope files
cscope Create file list
cscope Re-index .
$ configure ...
$ make clean
... cleans ...
- Steve
On 4/19/2023 9:08 AM, Steve Sistare wrote:
> Run 'make distclean' in a tree, and GNUmakefile is removed.
> But, GNUmakefile is where we change directory to build.
> Run 'make distclean' or 'make clean' again, and Makefile applies
> the clean actions, such as this one, at the top level of the tree.
> For example, it removes the .d source files in 'meson/test cases/d/*/*.d'.
>
> find . \( -name '*.so' -o -name '*.dll' -o \
> -name '*.[oda]' -o -name '*.gcno' \) -type f \
> ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
> ! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
> -exec rm {} +
>
> To fix, remove clean and distclean from UNCHECKED_GOALS, so those targets
> are "checked", meaning that configure must be run before make. However,
> the check action does not trigger, because clean does not depend on
> config-host.mak, so change the action to simply throw an error.
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> ---
> Makefile | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index e421f8a..30d61f8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -26,7 +26,7 @@ quiet-command-run = $(if $(V),,$(if $2,printf " %-7s %s\n" $2 $3 && ))$1
> quiet-@ = $(if $(V),,@)
> quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
>
> -UNCHECKED_GOALS := %clean TAGS cscope ctags dist \
> +UNCHECKED_GOALS := TAGS cscope ctags dist \
> help check-help print-% \
> docker docker-% vm-help vm-test vm-build-%
>
> @@ -176,10 +176,8 @@ plugins:
> endif # $(CONFIG_PLUGIN)
>
> else # config-host.mak does not exist
> -config-host.mak:
> ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
> - @echo "Please call configure before running make!"
> - @exit 1
> +$(error Please call configure before running make)
> endif
> endif # config-host.mak does not exist
>
next prev parent reply other threads:[~2023-05-09 17:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 13:08 [PATCH] make: clean after distclean deletes source files Steve Sistare
2023-05-09 17:58 ` Steven Sistare [this message]
2023-05-10 16:27 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5fa2859e-df65-2300-25a9-66c9c3c8689e@oracle.com \
--to=steven.sistare@oracle.com \
--cc=alex.bennee@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).