depend.awk: bugfix for commented out replacement text

This commit is contained in:
nhkeni
2024-03-13 22:04:19 -04:00
parent 31a8b44312
commit ab6d7cdc3b
2 changed files with 5 additions and 2 deletions

View File

@@ -1171,8 +1171,8 @@ $(TARGETPFX)engrave.o: engrave.c $(HACK_H)
$(TARGETPFX)exper.o: exper.c $(HACK_H)
$(TARGETPFX)explode.o: explode.c $(HACK_H)
$(TARGETPFX)extralev.o: extralev.c $(HACK_H)
$(TARGETPFX)files.o: files.c #zlib.h $(HACK_H) ../include/dlb.h \
../include/wintty.h
$(TARGETPFX)files.o: files.c $(HACK_H) ../include/dlb.h ../include/wintty.h \
#zlib.h
$(TARGETPFX)fountain.o: fountain.c $(HACK_H)
$(TARGETPFX)getpos.o: getpos.c $(HACK_H)
$(TARGETPFX)hack.o: hack.c $(HACK_H)

View File

@@ -250,6 +250,9 @@ function nhsort(list, first, last, cmpid, i,j,temp)
function nhcmp(a,b,cmpid)
{
if(cmpid == 0){ # sort dependencies
# commented out entry (there can be only one) MUST be last
if (a ~ /^#/){ return 1}
if (b ~ /^#/){ return 0}
# 2 .c or .cpp files
if (a ~ /\.c(pp)?$/ && b ~ /\.c(pp)?$/ ){ return a > b }
# a .c or .cpp file and anything else