- If you want to obtain the djgpp cross-compiler and tools/libs for MSDOS,
which is available for linux and macOS, you can use the following script
to obtain it:
sh sys/msdos/fetch-cross-compiler.sh
That script won't install anything, it is just file fetches. It will
store the cross-compiler in subfolders of lib and the hints files are
configured to find it appropriately there.
Note: Both the fetch and the msdos cross-compile package target require
unzip and zip to be available on your host build system.
Cross-compiler bits:
https://github.com/andrewwutw/build-djgpp
and the pre-built binary for your platform from:
https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/
and a DOS-extender (for including in msdos packaging) from
http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
and pdcurses from:
https://github.com/wmcbrine/PDCurses.git
The MSDOS cross-compile can then be carried out by specifying
CROSS_TO_MSDOS=1 on the make command line.
For example:
make CROSS_TO_MSDOS=1 all
make CROSS_TO_MSDOS=1 package
You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build:
make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 all
Also note that building the msdos targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_MSDOS=1 from the make
command line.
The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.
157 lines
6.5 KiB
Plaintext
157 lines
6.5 KiB
Plaintext
#===============-=================================================
|
|
# NetHack 3.7 include/cross-post $NHDT-Date: 1597332785 2020/08/13 15:33:05 $ $NHDT-Branch: NetHack-3.7 $
|
|
#
|
|
# Cross-compiling -POST section
|
|
|
|
ifdef CROSS_TO_MSDOS
|
|
#
|
|
$(TARGETDIR)/msdos.o : ../sys/msdos/msdos.c $(HACK_H)
|
|
$(TARGETDIR)/pckeys.o : ../sys/msdos/pckeys.c $(HACK_H)
|
|
$(TARGETDIR)/pctiles.o : ../sys/msdos/pctiles.c ../sys/msdos/portio.h $(HACK_H)
|
|
$(TARGETDIR)/video.o : ../sys/msdos/video.c ../sys/msdos/portio.h $(HACK_H)
|
|
$(TARGETDIR)/vidtxt.o : ../sys/msdos/vidtxt.c ../sys/msdos/portio.h \
|
|
../win/share/tile.h ../include/tileset.h $(HACK_H)
|
|
$(TARGETDIR)/vidvga.o : ../sys/msdos/vidvga.c ../sys/msdos/portio.h \
|
|
../win/share/tile.h ../include/tileset.h $(HACK_H)
|
|
$(TARGETDIR)/vidvesa.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \
|
|
../win/share/tile.h ../include/tileset.h $(HACK_H)
|
|
$(TARGETDIR)/vidstub.o : ../sys/msdos/vidvesa.c ../sys/msdos/portio.h \
|
|
$(HACK_H)
|
|
$(TARGETDIR)/tile.o : tile.c
|
|
#
|
|
#.PHONY: dospkg
|
|
dospkg: $(GAMEBIN) $(TARGETDIR)/recover.exe ../dat/nhtiles.bmp
|
|
$(TARGET_STUBEDIT) $(GAMEBIN) minstack=2048K
|
|
mkdir -p $(TARGETDIR)/pkg
|
|
cp $(GAMEBIN) $(TARGETDIR)/pkg/NETHACK.EXE
|
|
cp ../dat/nhdat $(TARGETDIR)/pkg/NHDAT
|
|
cp ../dat/license $(TARGETDIR)/pkg/LICENSE
|
|
cp ../dat/nhtiles.bmp $(TARGETDIR)/pkg/NHTILES.BMP
|
|
cp ../dat/symbols $(TARGETDIR)/pkg/SYMBOLS
|
|
cp ../sys/share/NetHack.cnf $(TARGETDIR)/pkg/NETHACK.CNF
|
|
cp ../sys/msdos/sysconf $(TARGETDIR)/pkg/SYSCONF
|
|
cp ../doc/nethack.txt $(TARGETDIR)/pkg/NETHACK.TXT
|
|
cp ../lib/djgpp/cwsdpmi/bin/CWSDPMI.EXE $(TARGETDIR)/pkg/CWSDPMI.EXE
|
|
-touch $(TARGETDIR)/pkg/RECORD
|
|
zip -9 $(TARGETDIR)/NH370DOS.ZIP $(TARGETDIR)/pkg/*
|
|
@echo msdos package zip file $(TARGETDIR)/NH370DOS.ZIP
|
|
endif # CROSS_TO_MSDOS
|
|
|
|
#
|
|
# shared file dependencies
|
|
#
|
|
$(TARGETDIR)/pcmain.o : ../sys/share/pcmain.c $(HACK_H)
|
|
$(TARGETDIR)/pcsys.o : ../sys/share/pcsys.c $(HACK_H)
|
|
$(TARGETDIR)/pctty.o : ../sys/share/pctty.c $(HACK_H)
|
|
$(TARGETDIR)/pcunix.o : ../sys/share/pcunix.c $(HACK_H)
|
|
$(TARGETDIR)/tileset.o : ../win/share/tileset.c
|
|
$(TARGETDIR)/bmptiles.o : ../win/share/bmptiles.c
|
|
$(TARGETDIR)/giftiles.o : ../win/share/giftiles.c
|
|
$(TARGETDIR)/recover.exe : $(TARGETDIR)/recover.o
|
|
|
|
#
|
|
# Lua lib
|
|
$(LUACROSSLIB): $(LUALIBOBJS)
|
|
if [ -f $@ ]; then rm $@; fi;
|
|
$(TARGET_AR) rcS $@ $(LUAOBJFILES1)
|
|
$(TARGET_AR) rcS $@ $(LUAOBJFILES2)
|
|
$(TARGET_AR) rcS $@ $(LUAOBJFILES3)
|
|
$(TARGET_AR) rcs $@ $(LUAOBJFILES4)
|
|
ifdef WANT_WIN_CURSES
|
|
$(TARGETDIR)/pdclib.a : $(PDCLIBOBJS) $(PDCOBJS)
|
|
if [ -f $@ ]; then rm $@; fi;
|
|
$(TARGET_AR) rcs $@ $(PDCLIBOBJS) $(PDCOBJS)
|
|
endif
|
|
#
|
|
# Lua src
|
|
$(TARGETDIR)/lapi.o : $(LUATOP)/src/lapi.c
|
|
$(TARGETDIR)/lauxlib.o : $(LUATOP)/src/lauxlib.c
|
|
$(TARGETDIR)/lbaselib.o : $(LUATOP)/src/lbaselib.c
|
|
$(TARGETDIR)/lbitlib.o : $(LUATOP)/src/lbitlib.c
|
|
$(TARGETDIR)/lcode.o : $(LUATOP)/src/lcode.c
|
|
$(TARGETDIR)/lcorolib.o : $(LUATOP)/src/lcorolib.c
|
|
$(TARGETDIR)/lctype.o : $(LUATOP)/src/lctype.c
|
|
$(TARGETDIR)/ldblib.o : $(LUATOP)/src/ldblib.c
|
|
$(TARGETDIR)/ldebug.o : $(LUATOP)/src/ldebug.c
|
|
$(TARGETDIR)/ldo.o : $(LUATOP)/src/ldo.c
|
|
$(TARGETDIR)/ldump.o : $(LUATOP)/src/ldump.c
|
|
$(TARGETDIR)/lfunc.o : $(LUATOP)/src/lfunc.c
|
|
$(TARGETDIR)/lgc.o : $(LUATOP)/src/lgc.c
|
|
$(TARGETDIR)/linit.o : $(LUATOP)/src/linit.c
|
|
$(TARGETDIR)/liolib.o : $(LUATOP)/src/liolib.c
|
|
$(TARGETDIR)/llex.o : $(LUATOP)/src/llex.c
|
|
$(TARGETDIR)/lmathlib.o : $(LUATOP)/src/lmathlib.c
|
|
$(TARGETDIR)/lmem.o : $(LUATOP)/src/lmem.c
|
|
$(TARGETDIR)/loadlib.o : $(LUATOP)/src/loadlib.c
|
|
$(TARGETDIR)/lobject.o : $(LUATOP)/src/lobject.c
|
|
$(TARGETDIR)/lopcodes.o : $(LUATOP)/src/lopcodes.c
|
|
$(TARGETDIR)/loslib.o : $(LUATOP)/src/loslib.c
|
|
$(TARGETDIR)/lparser.o : $(LUATOP)/src/lparser.c
|
|
$(TARGETDIR)/lstate.o : $(LUATOP)/src/lstate.c
|
|
$(TARGETDIR)/lstring.o : $(LUATOP)/src/lstring.c
|
|
$(TARGETDIR)/lstrlib.o : $(LUATOP)/src/lstrlib.c
|
|
$(TARGETDIR)/ltable.o : $(LUATOP)/src/ltable.c
|
|
$(TARGETDIR)/ltablib.o : $(LUATOP)/src/ltablib.c
|
|
$(TARGETDIR)/ltm.o : $(LUATOP)/src/ltm.c
|
|
$(TARGETDIR)/lundump.o : $(LUATOP)/src/lundump.c
|
|
$(TARGETDIR)/lutf8lib.o : $(LUATOP)/src/lutf8lib.c
|
|
$(TARGETDIR)/lvm.o : $(LUATOP)/src/lvm.c
|
|
$(TARGETDIR)/lzio.o : $(LUATOP)/src/lzio.c
|
|
#
|
|
# PDCurses src
|
|
#
|
|
$(TARGETDIR)/addch.o : $(PDCTOP)/pdcurses/addch.c
|
|
$(TARGETDIR)/addchstr.o : $(PDCTOP)/pdcurses/addchstr.c
|
|
$(TARGETDIR)/addstr.o : $(PDCTOP)/pdcurses/addstr.c
|
|
$(TARGETDIR)/attr.o : $(PDCTOP)/pdcurses/attr.c
|
|
$(TARGETDIR)/beep.o : $(PDCTOP)/pdcurses/beep.c
|
|
$(TARGETDIR)/bkgd.o : $(PDCTOP)/pdcurses/bkgd.c
|
|
$(TARGETDIR)/border.o : $(PDCTOP)/pdcurses/border.c
|
|
$(TARGETDIR)/clear.o : $(PDCTOP)/pdcurses/clear.c
|
|
$(TARGETDIR)/color.o : $(PDCTOP)/pdcurses/color.c
|
|
$(TARGETDIR)/delch.o : $(PDCTOP)/pdcurses/delch.c
|
|
$(TARGETDIR)/deleteln.o : $(PDCTOP)/pdcurses/deleteln.c
|
|
$(TARGETDIR)/getch.o : $(PDCTOP)/pdcurses/getch.c
|
|
$(TARGETDIR)/getstr.o : $(PDCTOP)/pdcurses/getstr.c
|
|
$(TARGETDIR)/getyx.o : $(PDCTOP)/pdcurses/getyx.c
|
|
$(TARGETDIR)/inch.o : $(PDCTOP)/pdcurses/inch.c
|
|
$(TARGETDIR)/inchstr.o : $(PDCTOP)/pdcurses/inchstr.c
|
|
$(TARGETDIR)/initscr.o : $(PDCTOP)/pdcurses/initscr.c
|
|
$(TARGETDIR)/inopts.o : $(PDCTOP)/pdcurses/inopts.c
|
|
$(TARGETDIR)/insch.o : $(PDCTOP)/pdcurses/insch.c
|
|
$(TARGETDIR)/insstr.o : $(PDCTOP)/pdcurses/insstr.c
|
|
$(TARGETDIR)/instr.o : $(PDCTOP)/pdcurses/instr.c
|
|
$(TARGETDIR)/kernel.o : $(PDCTOP)/pdcurses/kernel.c
|
|
$(TARGETDIR)/keyname.o : $(PDCTOP)/pdcurses/keyname.c
|
|
$(TARGETDIR)/mouse.o : $(PDCTOP)/pdcurses/mouse.c
|
|
$(TARGETDIR)/move.o : $(PDCTOP)/pdcurses/move.c
|
|
$(TARGETDIR)/outopts.o : $(PDCTOP)/pdcurses/outopts.c
|
|
$(TARGETDIR)/overlay.o : $(PDCTOP)/pdcurses/overlay.c
|
|
$(TARGETDIR)/pad.o : $(PDCTOP)/pdcurses/pad.c
|
|
$(TARGETDIR)/panel.o : $(PDCTOP)/pdcurses/panel.c
|
|
$(TARGETDIR)/printw.o : $(PDCTOP)/pdcurses/printw.c
|
|
$(TARGETDIR)/refresh.o : $(PDCTOP)/pdcurses/refresh.c
|
|
$(TARGETDIR)/scanw.o : $(PDCTOP)/pdcurses/scanw.c
|
|
$(TARGETDIR)/scr_dump.o : $(PDCTOP)/pdcurses/scr_dump.c
|
|
$(TARGETDIR)/scroll.o : $(PDCTOP)/pdcurses/scroll.c
|
|
$(TARGETDIR)/slk.o : $(PDCTOP)/pdcurses/slk.c
|
|
$(TARGETDIR)/termattr.o : $(PDCTOP)/pdcurses/termattr.c
|
|
$(TARGETDIR)/touch.o : $(PDCTOP)/pdcurses/touch.c
|
|
$(TARGETDIR)/util.o : $(PDCTOP)/pdcurses/util.c
|
|
$(TARGETDIR)/window.o : $(PDCTOP)/pdcurses/window.c
|
|
$(TARGETDIR)/debug.o : $(PDCTOP)/pdcurses/debug.c
|
|
$(TARGETDIR)/pdcclip.o : $(PDCTOP)/dos/pdcclip.c
|
|
$(TARGETDIR)/pdcdisp.o : $(PDCTOP)/dos/pdcdisp.c
|
|
$(TARGETDIR)/pdcgetsc.o : $(PDCTOP)/dos/pdcgetsc.c
|
|
$(TARGETDIR)/pdckbd.o : $(PDCTOP)/dos/pdckbd.c
|
|
$(TARGETDIR)/pdcscrn.o : $(PDCTOP)/dos/pdcscrn.c
|
|
$(TARGETDIR)/pdcsetsc.o : $(PDCTOP)/dos/pdcsetsc.c
|
|
$(TARGETDIR)/pdcutil.o : $(PDCTOP)/dos/pdcutil.c
|
|
|
|
|
|
#
|
|
# End of cross-compiling -POST section
|
|
#===============-=================================================
|
|
|
|
|