From 0edfb577f796e01872fa178e13652fa22bf23bb5 Mon Sep 17 00:00:00 2001 From: nhkeni Date: Sun, 10 Mar 2024 19:39:33 -0400 Subject: [PATCH] Two more bug fixes: split depend target so "make depend" and "make updatedepend" get the right dependencies (this puts back the previously temporarily removed dependencies) deterministically pull out the right source so moc rules are correct --- sys/unix/Makefile.src | 30 +++++++++++++++--------------- sys/unix/depend.awk | 6 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index a58257a60..5961270e9 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -831,7 +831,7 @@ package: # cd sys/unix ; make -f Makefile.src updatedepend updatedepend: updatedepend-setup cp Makefile.src ../../src && \ - make -C ../../src MAKEFILE_NAME=Makefile.src -f Makefile.src depend && \ + make -C ../../src MAKEFILE_NAME=Makefile.src -f Makefile.src depend2 && \ mv ../../src/Makefile.src . @rm -f ../$(HACK_H) @@ -857,10 +857,10 @@ updatedepend-setup: @echo "#include \"hack.h\"" >> ../../src/tile.c MAKEFILE_NAME=Makefile -#depend: ../sys/unix/depend.awk \ -# $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ -# $(CHAINSRC) $(GENCSRC) $(HACKCSRC) -depend: +depend: ../sys/unix/depend.awk \ + $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ + $(CHAINSRC) $(GENCSRC) $(HACKCSRC) +depend2: $(WINQTMOC) $(AWK) -f ../sys/unix/depend.awk ../include/*.h ../win/*/*.h \ $(SYSCSRC) $(WINCSRC) $(SYSCXXSRC) $(WINCXXSRC) \ $(CHAINSRC) $(GENCSRC) $(HACKCSRC) >makedep @@ -1279,27 +1279,27 @@ $(TARGETPFX)worn.o: worn.c $(HACK_H) $(TARGETPFX)write.o: write.c $(HACK_H) $(TARGETPFX)zap.o: zap.c $(HACK_H) qt_kde0.moc: $(QTn_H) ../win/Qt/qt_kde0.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_kde0.h qt_main.moc: $(QTn_H) ../win/Qt/qt_kde0.h ../win/Qt/qt_main.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_main.h qt_map.moc: $(QTn_H) ../win/Qt/qt_clust.h ../win/Qt/qt_map.h ../win/Qt/qt_win.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_map.h qt_menu.moc: $(QTn_H) ../win/Qt/qt_menu.h ../win/Qt/qt_rip.h ../win/Qt/qt_win.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_menu.h qt_msg.moc: $(QTn_H) ../win/Qt/qt_msg.h ../win/Qt/qt_win.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_msg.h qt_plsel.moc: $(QTn_H) ../win/Qt/qt_plsel.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_plsel.h qt_set.moc: $(QTn_H) ../win/Qt/qt_bind.h ../win/Qt/qt_kde0.h \ ../win/Qt/qt_main.h ../win/Qt/qt_set.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_set.h qt_stat.moc: $(QTn_H) ../win/Qt/qt_icon.h ../win/Qt/qt_stat.h \ ../win/Qt/qt_win.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_stat.h qt_xcmd.moc: $(QTn_H) ../win/Qt/qt_xcmd.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_xcmd.h qt_yndlg.moc: $(QTn_H) ../win/Qt/qt_yndlg.h - $(MOCPATH) -o $@ $(QTn_H) + $(MOCPATH) -o $@ ../win/Qt/qt_yndlg.h # DEPENDENCIES MUST END AT END OF FILE # IF YOU PUT STUFF HERE IT WILL GO AWAY # see make depend above diff --git a/sys/unix/depend.awk b/sys/unix/depend.awk index 0d4704a7f..6b9bc5ebd 100644 --- a/sys/unix/depend.awk +++ b/sys/unix/depend.awk @@ -172,7 +172,8 @@ function format_dep(target, source, col, n, i, list, prefix, moc) #first: leading whitespace yields empty 1st element; not sure why moc #files duplicate the target as next element but we need to skip that too first = moc ? 3 : 2 - if (dosort ){ + source = list[first] + if (dosort){ nhsort(list, first, n, 0) } for (i = first; i <= n; i++) { @@ -185,7 +186,6 @@ function format_dep(target, source, col, n, i, list, prefix, moc) } printf("\n") #terminate #write build command if first source entry has non-include path prefix - source = list[first] if (moc) { print "\t$(MOCPATH) -o $@ " source } else if (source ~ /\// && substr(source, 1, 11) != "../include/") { @@ -249,7 +249,7 @@ function nhsort(list, first, last, cmpid, i,j,temp) function nhcmp(a,b,cmpid) { - if(cmpid == 0){ # sort dependencies + if(cmpid == 0){ # sort dependencies # 2 .c or .cpp files if (a ~ /\.c(pp)?$/ && b ~ /\.c(pp)?$/ ){ return a > b } # a .c or .cpp file and anything else