From 9841830460a4bd8ae6f390e65cd858b5a232dc9f Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 18 May 2026 15:46:54 -0400 Subject: [PATCH] some more follow-up CROSS_TO_MSDOS build --- sys/unix/Makefile.src | 6 +++--- sys/unix/hints/include/cross-post.500 | 8 +++++++- sys/unix/hints/include/cross-pre2.500 | 11 +++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index c72ca9e71..74d3307f6 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -263,7 +263,7 @@ 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 $(TILEOFILE) + $(TARGETPFX)winval.o # # Files for a Qt 3 interface (renamed since nethack 3.6.x) # @@ -553,10 +553,10 @@ CHAINOBJ ?= $(TARGETPFX)wc_chainin.o $(TARGETPFX)wc_chainout.o \ $(TARGETPFX)wc_trace.o # .c files for this version (for date.h) -VERSOURCES ?= $(HACKCSRC) $(HACKLIBSRC) $(SYSSRC) $(WINSRC) $(CHAINSRC) $(GENCSRC) +VERSOURCES ?= $(HACKCSRC) $(HACKLIBSRC) $(SYSSRC) $(WINSRC) $(CHAINSRC) $(GENTILECFILE) # .c files for all versions using this Makefile (for lint and tags) -CSOURCES ?= $(HACKCSRC) $(HACKLIBSRC) $(SYSCSRC) $(WINCSRC) $(CHAINSRC) $(GENCSRC) +CSOURCES ?= $(HACKCSRC) $(HACKLIBSRC) $(SYSCSRC) $(WINCSRC) $(CHAINSRC) $(GENTILECFILE) # all .h files except date.h, which would diff --git a/sys/unix/hints/include/cross-post.500 b/sys/unix/hints/include/cross-post.500 index e01623002..d07d14f18 100644 --- a/sys/unix/hints/include/cross-post.500 +++ b/sys/unix/hints/include/cross-post.500 @@ -18,7 +18,9 @@ $(TARGETPFX)vidvesa.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \ ../win/share/tile.h ../include/tileset.h ../sys/msdos/font.h $(HACK_H) $(TARGETPFX)vidstub.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \ $(HACK_H) -$(TARGETPFX)tile.o : tile.c +$(TARGETPFX)tile.o : $(SRCDIR)/tile.c + $(TARGET_CC) $(TARGET_CFLAGS) -c -o $@ $(SRCDIR)/tile.c +$(SRCDIR)tile.c : tiletext $(TARGETPFX)exceptn.o : ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S $(TARGET_CC) -c -o $@ ../lib/djgpp/djgpp-patch/src/libc/go32/exceptn.S $(TARGET_AR) ru ../lib/djgpp/i586-pc-msdosdjgpp/lib/libc.a $(TARGETPFX)exceptn.o @@ -475,7 +477,11 @@ $(TARGETPFX)slk.o : $(PDCTOP)/pdcurses/slk.c $(TARGETPFX)termattr.o : $(PDCTOP)/pdcurses/termattr.c $(TARGETPFX)touch.o : $(PDCTOP)/pdcurses/touch.c $(TARGETPFX)util.o : $(PDCTOP)/pdcurses/util.c +# We need an explicit recipe for the creation of $(TARGETPFX)window.o +# because it will try and use the X11 version of window.c otherwise $(TARGETPFX)window.o : $(PDCTOP)/pdcurses/window.c + $(TARGET_CC) $(PDCINCL) $(PDC_TARGET_CFLAGS) \ + -Wno-sign-compare -o$@ $(PDCTOP)/pdcurses/window.c $(TARGETPFX)debug.o : $(PDCTOP)/pdcurses/debug.c $(TARGETPFX)pdcclip.o : $(PDCPORT)/pdcclip.c $(TARGETPFX)pdcdisp.o : $(PDCPORT)/pdcdisp.c diff --git a/sys/unix/hints/include/cross-pre2.500 b/sys/unix/hints/include/cross-pre2.500 index 297b17175..a7958855a 100644 --- a/sys/unix/hints/include/cross-pre2.500 +++ b/sys/unix/hints/include/cross-pre2.500 @@ -134,6 +134,7 @@ override TARGET_CC = $(TOOLTOP1)/i586-pc-msdosdjgpp-gcc override TARGET_CXX = $(TOOLTOP1)/i586-pc-msdosdjgpp-g++ override TARGET_AR = $(TOOLTOP1)/i586-pc-msdosdjgpp-gcc-ar override TARGET_STUBEDIT = ../lib/djgpp/i586-pc-msdosdjgpp/bin/stubedit +override GENTILEOFILE = $(TARGETPFX)tile.o ifdef MAKEFILE_SRC FLDR=../ endif @@ -176,7 +177,7 @@ MSDOS_GPP_CFLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wreturn-type \ -Wmissing-declarations -Wformat-nonliteral -Wunreachable-code \ -Wno-maybe-uninitialized MSDOS_TARGET_CFLAGS = -c -O $(DBGFLAGS) -I../include -I../sys/msdos -I../win/share \ - $(LUAINCL) -DDLB $(PDCURSESDEF) -DTILES_IN_GLYPHMAP \ + $(LUAINCL) -DDLB $(PDCURSESDEF) -DTILES_IN_GLYPHMAP -DUSE_TILES \ -DCROSSCOMPILE -DCROSSCOMPILE_TARGET -DCROSS_TO_MSDOS \ -D_NAIVE_DOS_REGS \ $(MSDOS_GCC_CFLAGS) $(SNDCFLAGS) @@ -225,11 +226,12 @@ override SYSOBJ= $(TARGETPFX)pcmain.o $(TARGETPFX)msdos.o \ $(TARGETPFX)vidvga.o $(TARGETPFX)vidvesa.o \ $(TARGETPFX)font.o \ $(TARGETPFX)bmptiles.o $(TARGETPFX)giftiles.o \ - $(TARGETPFX)tileset.o $(GENTILEOFILE) + $(TARGETPFX)tileset.o override WINLIB= override LUALIB= override LUALIBS= override TOPLUALIB= +override WINX11OBJ= override GAMEBIN = $(TARGETPFX)nethack.exe override RECOVERBIN = $(TARGETPFX)recover.exe override SFCTOOLBIN = $(TARGETPFX)sfctool.exe @@ -258,6 +260,11 @@ endif # WANT_WIN_CURSES # Rule for files in sys/msdos $(TARGETPFX)%.o : ../sys/msdos/%.c $(TARGET_CC) $(TARGET_CFLAGS) -o$@ $< +# +# Rule for files in util +$(TARGETPFX)%.o : ../util/%.c + $(TARGET_CC) $(TARGET_CFLAGS) -o$@ $< + endif # CROSS_TO_MSDOS #=================================================================