From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 83D8B383E426; Tue, 13 Dec 2022 14:31:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83D8B383E426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670941861; bh=IeDbp6I8YXQ2fP3+H0rdZadShBtlYxRSF8MNRL/OM1I=; h=From:To:Subject:Date:From; b=NioDx7yeqvY7mcUDvfy/g9SMTcAXgRVY/CPWlLoCweFExvooaveovvmKhYvVIYaWk uuktEUqrZeUgTZKxqwfq+dP3wXO8QeyuLsOAZxJLdKUMEEl27F/lrC95KAEmyFg+3H 7LI/yEb5LLdq4mPkseXo0cwOhdJFt+o9uRy3FmYM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_4-branch] Cygwin: Makefile: only regenerate cygwin_version.c if it changes X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/cygwin-3_4-branch X-Git-Oldrev: b199be101d006ee214e295b13cc320f3c43990e4 X-Git-Newrev: e454ca3ec585793728632070befd28959f1377b6 Message-Id: <20221213143101.83D8B383E426@sourceware.org> Date: Tue, 13 Dec 2022 14:31:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3De454ca3ec58= 5793728632070befd28959f1377b6 commit e454ca3ec585793728632070befd28959f1377b6 Author: Corinna Vinschen AuthorDate: Tue Dec 13 13:25:06 2022 +0100 Commit: Corinna Vinschen CommitDate: Tue Dec 13 15:25:06 2022 +0100 Cygwin: Makefile: only regenerate cygwin_version.c if it changes =20 Make sure to create a new cygwin_version.c if it either doesn't exist yet, or if it would be different from the former file. This avoids unnecessary DLL rebuilding. =20 Fixes: 97eb64b909bc ("Cygwin: uname: generate default release string fr= om git as well") Fixes: 4949a82cde98 ("Cygwin: uname: fix building in non-git source dir= ") Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/Makefile.am | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/Makefile.am b/winsup/cygwin/Makefile.am index e61f72716e10..cf12b97f838a 100644 --- a/winsup/cygwin/Makefile.am +++ b/winsup/cygwin/Makefile.am @@ -419,12 +419,20 @@ dirs =3D $(srcdir) $(srcdir)/fhandler $(srcdir)/lib $= (srcdir)/libc $(srcdir)/math find_src_files =3D $(wildcard $(dir)/*.[chS]) $(wildcard $(dir)/*.cc) src_files :=3D $(foreach dir,$(dirs),$(find_src_files)) =20 +# Regenerate uname_version.c only if it doesn't exist or if it differs +# from the former uname_version.c uname_version.c: .FORCE $(AM_V_GEN)cd $(srcdir) && \ echo "const char *uname_dev_version =3D \ \"$$(git rev-parse --git-dir >/dev/null 2>&1 && \ git describe --dirty | sed -e 's/cygwin-//')\";" \ - > $(abs_builddir)/uname_version.c + > $(abs_builddir)/uname_version-pre.c && \ + if [ -f $(abs_builddir)/uname_version.c ] && \ + cmp $(abs_builddir)/uname_version.c \ + $(abs_builddir)/uname_version-pre.c >/dev/null 2>&1 ; \ + then :; else \ + mv $(abs_builddir)/uname_version-pre.c \ + $(abs_builddir)/uname_version.c; fi .FORCE: =20 # mkvers.sh creates version.cc in the first place, winver.o always