From 4de71302a30b05b5c80d2c48642ee8d4b58c68ed Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 18 Sep 2022 14:25:33 -0700 Subject: [PATCH] unix Makefile.src and hints Change the handling for windowing system specific files so that when building for more than one set, each gets compiled as a set instead of some being interspersed among rival window systems. Put differently, handle tile.o specially so that there's no need for the hints to sort the WINOBJ list in order to avoid tile.o duplication. So the order of compilation is common source files unix-specific files tty files curses files X11 files Qt files tile.c (if applicable), version.c, date.c Previously, some of the X11 files were scattered around among the others because of the spelling of their file names. Only matters if you're watching the progress of a build. --- sys/unix/Makefile.src | 17 ++++++++++------- sys/unix/hints/include/multiw-2.370 | 6 ++++++ sys/unix/hints/linux.370 | 2 +- sys/unix/hints/macOS.370 | 16 +++++++++------- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 8180fef3e..51170e3a7 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -207,9 +207,12 @@ REGEXOBJ = $(TARGETPFX)posixregex.o #REGEXOBJ = $(TARGETPFX)cppregex.o # Set the WINSRC, WINOBJ, and WINLIB lines to correspond to your desired -# combination of windowing systems. Also set windowing systems in config.h. -# Note that if you are including multiple tiled window systems, you don't -# want two copies of tile.o, so comment out all but the first. +# combination of windowing systems. Also set matching USE_x_GRAPHICS in +# config.h. Note that if you are building for any window system which +# uses tiles, uncomment '#$(TARGETPFX)tile.o' (by removing the '#') in that +# system's WINxOBJ (WINX11OBJ or WINQTOBJ or WINQT3OBJ). If you are building +# nethack with support for multiple window systems, only uncomment that for +# one of them to avoid duplicate tile.o. # # files for a straight tty port using no native windowing system WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \ @@ -236,14 +239,14 @@ WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \ WINX11OBJ = $(TARGETPFX)Window.o $(TARGETPFX)dialogs.o $(TARGETPFX)winX.o \ $(TARGETPFX)winmap.o $(TARGETPFX)winmenu.o $(TARGETPFX)winmesg.o \ $(TARGETPFX)winmisc.o $(TARGETPFX)winstat.o $(TARGETPFX)wintext.o \ - $(TARGETPFX)winval.o $(TARGETPFX)tile.o + $(TARGETPFX)winval.o #$(TARGETPFX)tile.o # # Files for a Qt 3 interface (renamed since nethack 3.6.x) # #WINQT3SRC = ../win/Qt3/qt3_win.cpp ../win/Qt3/qt3_clust.cpp \ # ../win/Qt3/qt3tableview.cpp #WINQT3OBJ = $(TARGETPFX)qt3_win.o $(TARGETPFX)qt3_clust.o \ - $(TARGETPFX)qt3tableview.o $(TARGETPFX)tile.o + $(TARGETPFX)qt3tableview.o #$(TARGETPFX)tile.o # empty values for 'make depend' WINQT3SRC = WINQT3OBJ = @@ -263,7 +266,7 @@ WINQTSRC = ../win/Qt/qt_bind.cpp ../win/Qt/qt_click.cpp \ ../win/Qt/qt_plsel.cpp ../win/Qt/qt_rip.cpp ../win/Qt/qt_set.cpp \ ../win/Qt/qt_stat.cpp ../win/Qt/qt_str.cpp ../win/Qt/qt_streq.cpp \ ../win/Qt/qt_svsel.cpp ../win/Qt/qt_win.cpp ../win/Qt/qt_xcmd.cpp \ - ../win/Qt/qt_yndlg.cpp $(WINQTMOC) + ../win/Qt/qt_yndlg.cpp $(WINQTMOC) tile.c WINQTOBJ = $(TARGETPFX)qt_bind.o $(TARGETPFX)qt_click.o \ $(TARGETPFX)qt_clust.o $(TARGETPFX)qt_delay.o \ $(TARGETPFX)qt_glyph.o $(TARGETPFX)qt_icon.o \ @@ -272,7 +275,7 @@ WINQTOBJ = $(TARGETPFX)qt_bind.o $(TARGETPFX)qt_click.o \ $(TARGETPFX)qt_msg.o $(TARGETPFX)qt_plsel.o $(TARGETPFX)qt_rip.o \ $(TARGETPFX)qt_set.o $(TARGETPFX)qt_stat.o $(TARGETPFX)qt_str.o \ $(TARGETPFX)qt_streq.o $(TARGETPFX)qt_svsel.o $(TARGETPFX)qt_win.o \ - $(TARGETPFX)qt_xcmd.o $(TARGETPFX)qt_yndlg.o $(TARGETPFX)tile.o + $(TARGETPFX)qt_xcmd.o $(TARGETPFX)qt_yndlg.o #$(TARGETPFX)tile.o # Files for Shim windowing interface for libnh -- doesn't do anything, # just passes along the API calls to the library diff --git a/sys/unix/hints/include/multiw-2.370 b/sys/unix/hints/include/multiw-2.370 index d708290bb..87a7fb737 100644 --- a/sys/unix/hints/include/multiw-2.370 +++ b/sys/unix/hints/include/multiw-2.370 @@ -78,6 +78,8 @@ endif WINCFLAGS= WINSRC = WINOBJ0 = +XTRASRC = +XTRAOBJ = ifdef WANT_WIN_TTY WINSRC += $(WINTTYSRC) @@ -96,12 +98,16 @@ ifdef WANT_WIN_X11 WINCFLAGS += -DX11_GRAPHICS WINSRC += $(WIINX11SRC) WINOBJ0 += $(WINX11OBJ) +XTRASRC += tile.c +XTRAOBJ += $(TARGETPFX)tile.o endif ifdef WANT_WIN_QT WINCFLAGS += -DQT_GRAPHICS WINSRC += $(WINQTSRC) WINOBJ0 += $(WINQTOBJ) +XTRASRC += tile.c +XTRAOBJ += $(TARGETPFX)tile.o endif #end of hints/include/multiw-2.370 diff --git a/sys/unix/hints/linux.370 b/sys/unix/hints/linux.370 index f1cfaa016..ac5ef89fb 100755 --- a/sys/unix/hints/linux.370 +++ b/sys/unix/hints/linux.370 @@ -252,7 +252,7 @@ LINK = $(CC) endif # !WANT_WIN_QT # prevent duplicate tile.o in WINOBJ -WINOBJ = $(sort $(WINOBJ0)) +WINOBJ = $(WINOBJ0) $(sort $(XTRAOBJ)) # prevent duplicates in VARDATND if both X11 and Qt are being supported VARDATND += $(sort $(VARDATND0)) diff --git a/sys/unix/hints/macOS.370 b/sys/unix/hints/macOS.370 index 7ad0f6d38..0bac622c6 100755 --- a/sys/unix/hints/macOS.370 +++ b/sys/unix/hints/macOS.370 @@ -235,17 +235,19 @@ ifdef WANT_WIN_QT LINK = $(CXX) ifdef WANT_WIN_QT5 # Qt5 requires C++11 -QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags)) -WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs) +QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig \ + pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags)) +WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig \ + pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs) endif # WANT_WIN_QT5 ifdef WANT_WIN_QT6 -QTCXXFLAGS += -std=c++17 -I $(QTDIR)/include -I $(QTDIR)/include/QtCore -I $(QTDIR)/include/QtMultimedia +QTCXXFLAGS += -std=c++17 -I $(QTDIR)/include -I $(QTDIR)/include/QtCore \ + -I $(QTDIR)/include/QtMultimedia MOC = moc MOCPATH = $(QTDIR)/share/qt/libexec/moc -WINLIB += -F $(QTDIR)/Frameworks -framework QtCore -framework QtGui -framework QtWidgets -framework QtMultimedia +WINLIB += -F $(QTDIR)/Frameworks -framework QtCore -framework QtGui \ + -framework QtWidgets -framework QtMultimedia endif # WANT_WIN_QT6 -WINSRC += $(WINQTSRC) -WINOBJ0 += $(WINQTOBJ) VARDATND0 += nhtiles.bmp rip.xpm nhsplash.xpm # XXX if /Developer/qt exists and QTDIR not set, use that ifndef QTDIR @@ -257,7 +259,7 @@ LINK=$(CC) endif # !WANT_WIN_QT # prevent duplicate tile.o in WINOBJ -WINOBJ = $(sort $(WINOBJ0)) +WINOBJ = $(WINOBJ0) $(sort $(XTRAOBJ)) # prevent duplicates in VARDATND if both X11 and Qt are being supported VARDATND += $(sort $(VARDATND0))