diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index e077aad23..7d5de09f0 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -670,35 +670,18 @@ objects.o: $(CC) $(CFLAGS) -c -o $@ objects.c @rm -f $(MAKEDEFS) -# Qt 3 windowport meta-object-compiler output +# outdated Qt 3 windowport meta-object-compiler output qt3_kde0.moc: ../win/Qt3/qt3_kde0.h $(QTDIR)/bin/moc -o qt3kde0.moc ../win/Qt3/qt3_kde0.h qt3_win.moc: ../win/Qt3/qt3_win.h $(QTDIR)/bin/moc -o qt3win.moc ../win/Qt3/qt3_win.h qt3tableview.moc: ../win/Qt3/qt3tableview.h - $(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt/qt3tableview.h + $(QTDIR)/bin/moc -o qt3tableview.moc ../win/Qt3/qt3tableview.h -# Qt 4 windowport meta-object-compiler output -qt_kde0.moc : ../win/Qt/qt_kde0.h - $(MOCPATH) -o qt_kde0.moc ../win/Qt/qt_kde0.h -qt_main.moc : ../win/Qt/qt_main.h - $(MOCPATH) -o qt_main.moc ../win/Qt/qt_main.h -qt_map.moc : ../win/Qt/qt_map.h - $(MOCPATH) -o qt_map.moc ../win/Qt/qt_map.h -qt_menu.moc : ../win/Qt/qt_menu.h - $(MOCPATH) -o qt_menu.moc ../win/Qt/qt_menu.h -qt_msg.moc : ../win/Qt/qt_msg.h - $(MOCPATH) -o qt_msg.moc ../win/Qt/qt_msg.h -qt_plsel.moc : ../win/Qt/qt_plsel.h - $(MOCPATH) -o qt_plsel.moc ../win/Qt/qt_plsel.h -qt_set.moc : ../win/Qt/qt_set.h - $(MOCPATH) -o qt_set.moc ../win/Qt/qt_set.h -qt_stat.moc : ../win/Qt/qt_stat.h - $(MOCPATH) -o qt_stat.moc ../win/Qt/qt_stat.h -qt_xcmd.moc : ../win/Qt/qt_xcmd.h - $(MOCPATH) -o qt_xcmd.moc ../win/Qt/qt_xcmd.h -qt_yndlg.moc : ../win/Qt/qt_yndlg.h - $(MOCPATH) -o qt_yndlg.moc ../win/Qt/qt_yndlg.h +# for Qt 5 and 6, template rules to build qt_xyz.moc from corresponding +# ../win/Qt/qt_xyz.h are in sys/unix/hints/compiler.370 and get added +# to src/Makefile if the appropriate hints file gets used with setup.sh; +# so, build support for the Qt interface requires the use of hints... # build monst.o and objects.o before executing '$(MAKE) makedefs' $(MAKEDEFS): $(FIRSTOBJ) \ @@ -775,7 +758,7 @@ spotless: clean -rm -f ../include/nhlua.h -rm -f ../include/date.h #created but no longer used, at least by core -rm -f ../include/onames.h ../include/pm.h #obsolete generated files - -rm -f tile.c *.moc + -rm -f tile.c *.moc moc.qt* -rm -f ../win/gnome/gn_rip.h package: diff --git a/sys/unix/hints/include/compiler.370 b/sys/unix/hints/include/compiler.370 index e9f56d0df..3d2bf3aa1 100755 --- a/sys/unix/hints/include/compiler.370 +++ b/sys/unix/hints/include/compiler.370 @@ -114,5 +114,27 @@ endif # clang-specific ends here CFLAGS+=-DGCC_WARN CCXXFLAGS+=-DGCC_WARN +ifdef MAKEFILE_SRC +ifdef WANT_WIN_QT +# when switching from Qt5 to Qt6 or vice versa, any old .moc files will be +# incompatible; get rid of them in case user hasn't run 'make spotless'; +# moc.qt5 and moc.qt6 are empty timestamp files and at most one should exist +ifdef WANT_WIN_QT6 +# Qt 6 builds and runs (with a couple of warnings) but needs more testing +MOCSTAMP=moc.qt6 +else +# Qt 5 is currently the default version for nethack 3.7.x's Qt interface +MOCSTAMP=moc.qt5 +endif +# rule to build src/qt_foo.moc from win/Qt/qt_foo.h +%.moc : ../win/Qt/%.h $(MOCSTAMP) + $(MOCPATH) -o $@ $< +moc.qt5:: + @if test ! -f moc.qt5; then ( rm -f *.moc moc.qt6; touch $@ ); fi; +moc.qt6:: + @if test ! -f moc.qt6; then ( rm -f *.moc moc.qt5; touch $@ ); fi; +endif #WANT_WIN_QT +endif #MAKFILE_SRC + #end of compiler.370 #------------------------------------------------------------------------------