From db48b92dd39fe15e325ac1b4d9cf7d0b47814d5e Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 14 Oct 2023 13:48:47 -0700 Subject: [PATCH] avoid redundant unix dependency for tile.o --- sys/unix/Makefile.src | 3 +-- sys/unix/depend.awk | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 256be4bf2..3615da20c 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.7 Makefile.src $NHDT-Date: 1696193939 2023/10/01 20:58:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.163 $ +# NetHack 3.7 Makefile.src $NHDT-Date: 1697316523 2023/10/14 20:48:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.164 $ # Copyright (c) 2018 by Pasi Kallinen # NetHack may be freely redistributed. See license for details. @@ -1069,7 +1069,6 @@ qt_xcmd.moc: ../win/Qt/qt_xcmd.h $(QTn_H) $(MOCPATH) -o $@ ../win/Qt/qt_xcmd.h qt_yndlg.moc: ../win/Qt/qt_yndlg.h $(QTn_H) $(MOCPATH) -o $@ ../win/Qt/qt_yndlg.h -$(TARGETPFX)tile.o: tile.c $(HACK_H) $(TARGETPFX)wc_chainin.o: ../win/chain/wc_chainin.c $(HACK_H) $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ ../win/chain/wc_chainin.c $(TARGETPFX)wc_chainout.o: ../win/chain/wc_chainout.c $(HACK_H) diff --git a/sys/unix/depend.awk b/sys/unix/depend.awk index b62c4e02f..f28c6d363 100644 --- a/sys/unix/depend.awk +++ b/sys/unix/depend.awk @@ -1,6 +1,6 @@ # depend.awk -- awk script used to construct makefile dependencies # for nethack's source files (`make depend' support for Makefile.src). -# $NHDT-Date: 1612127123 2021/01/31 21:05:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.13 $ +# $NHDT-Date: 1697316508 2023/10/14 20:48:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.16 $ # # usage: # awk -f depend.awk ../include/*.h list-of-.c/.cpp-files @@ -90,7 +90,7 @@ function output_dep( base, targ, moc) if (moc || base ~ /(.+\/)*qt_.*[.]cpp$/) { deps[file] = deps[file] " $(QTn_H)" } - if (base ~ /[.]cp*$/ || moc) { + if ((base ~ /[.]cp*$/ || moc) && !(base in basedone)) { #prior to very first .c|.cpp file, handle some special header file cases if (!c_count++) output_specials() @@ -98,6 +98,9 @@ function output_dep( base, targ, moc) targ = base; sub("[.]cp*$", ".o", targ) #format and write the collected dependencies format_dep(targ, file) + #generated file tile.c can appear more than once in the list of files + #so track which files have already been handled; can't reuse done[] here + basedone[base]++; } }