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.
This commit is contained in:
PatR
2022-09-18 14:25:33 -07:00
parent 2368c59f69
commit 4de71302a3
4 changed files with 26 additions and 15 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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))

View File

@@ -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))