From: Sergei Trofimovich Subject: [PATCH 2/2] Makefile: fix infinite recursion by dropping non-existent `%.output` Date: Sun, 25 Sep 2022 11:42:03 +0100 Message-ID: <20220925104203.648449-2-slyich@gmail.com> References: <20220925104203.648449-1-slyich@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=UNa9FP2qbw+v+rnFhfdN2/bnXqmlgce73yy9PgBT7qw=; b=A/ipDDJxuMjoJ+wnuxd7wwvkBRQjhga2jprjTIgjdjDwmGmbnB4zJylqcLwfFFEygd n4rb0xdQBQFEETC9xSSrqkRqsRZjrO66QhHmsXwUgfcy9qBBb93GBiPlJvKA8yyGiJvl IbaiRqkWnHWAKvwc5DgufM89O3BCDpSsMU8PbQQku68LtbBxtMp1+6vQTGJynAs18qDG uP6s9o2++72fQu30RGCw+Npfno9BJI1Qnv+tsZgxCcOU3f6kljzsND0KWU96zRcxFJuf of+lMDw53pZYCsjUFdMVTXKjRzBgCcDTy3JpWPaKaNtT0OMcTSE5Wd6lOKgmXXQ127Qw ysfA== In-Reply-To: <20220925104203.648449-1-slyich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Sergei Trofimovich Without the change GNU `make-4.4` falls into infinite recursion of trying to generate %.output files (bison is not passed flags to generate debug output). This happens on GNU `make-4.4` only after GNU make change to more eagerly rebuild all target outputs in multiple targets: https://savannah.gnu.org/bugs/index.php?63098 The recursion here is the following: - Makefile depends on *.d files - *.d files depend on *.c files - *.c files are generated by bison - bison is triggered whenever some of it's multiple targets are missing In our case `%.output` is always missing and bison is always reran. *.d files are always regenerated on `make` run. And make is always restarted as *.d files are always regenerated. The fix removes infeasible `%.output`. Signed-off-by: Sergei Trofimovich --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7a0dcb..d4e7551 100644 --- a/Makefile +++ b/Makefile @@ -384,7 +384,7 @@ clean: libfdt_clean pylibfdt_clean tests_clean @$(VECHO) LEX $@ $(LEX) -o$@ $< -%.tab.c %.tab.h %.output: %.y +%.tab.c %.tab.h: %.y @$(VECHO) BISON $@ $(BISON) -b $(basename $(basename $@)) -d $< -- 2.37.2