Skip to content

Commit

Permalink
configure: Make only once with pseudo-"in source tree" builds
Browse files Browse the repository at this point in the history
Pseudo-"in source tree" build used to run make in the build directory
as many times as goals. Worse, although .NOTPARALLEL is specified,
it does not work for patterns, and run make in parallel, which can break
things.

Add a new rule "build", and let it call make. The pattern rule only
needs to specify "build" as its prerequisite and have a no-op recipe so
that it does more than canceling built-in implicit rules.

Fixes: dedad02 ("configure: add support for pseudo-"in source tree" builds")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-ID: <20231119101604.47325-1-akihiko.odaki@daynix.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
akihikodaki authored and bonzini committed Nov 24, 2023
1 parent cd91136 commit 9abbb37
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,17 @@ then
# This file is auto-generated by configure to support in-source tree
# 'make' command invocation
ifeq ($(MAKECMDGOALS),)
recurse: all
endif
.NOTPARALLEL: %
%: force
build:
@echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...'
@$(MAKE) -C build -f Makefile $(MAKECMDGOALS)
@if test "$(MAKECMDGOALS)" = "distclean" && \
test -e build/auto-created-by-configure ; \
then \
rm -rf build GNUmakefile ; \
fi
force: ;
.PHONY: force
%: build
@
.PHONY: build
GNUmakefile: ;
EOF
Expand Down

0 comments on commit 9abbb37

Please sign in to comment.