more MSDOS build

This commit is contained in:
nethack.allison
2003-02-17 02:55:46 +00:00
parent 3d96d214c6
commit 2a83f1b830
3 changed files with 26 additions and 12 deletions
+7 -7
View File
@@ -99,10 +99,6 @@
/* amiconf.h). In the future this will be the */ /* amiconf.h). In the future this will be the */
/* hook for mail reader implementation. */ /* hook for mail reader implementation. */
/*# define PC_LOCKING */ /* Allow confirmation before overwriting game */
/* that is in progress or aborted when another */
/* game is started with the same player name. */
/* The following is needed for prototypes of certain functions */ /* The following is needed for prototypes of certain functions */
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__) #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
@@ -160,12 +156,16 @@
#include "system.h" #include "system.h"
#endif #endif
#ifdef __GO32__ #ifdef __DJGPP__
#include <unistd.h> /* close(), etc. */ #include <unistd.h> /* close(), etc. */
/* setmode is in io.h but lock() in io.h interferes with lock[] in decl.h */ /* lock() in io.h interferes with lock[] in decl.h */
extern int FDECL(setmode, (int,int)); #define lock djlock
#include <io.h>
#undef lock
#include <pc.h> /* kbhit() */ #include <pc.h> /* kbhit() */
#define PC_LOCKING #define PC_LOCKING
#define HOLD_LOCKFILE_OPEN
#define SELF_RECOVER /* NetHack itself can recover games */
#endif #endif
# ifdef MSDOS # ifdef MSDOS
+17 -4
View File
@@ -380,6 +380,11 @@ DJ1 = $(dir $(DJGPP))
CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.* CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.*
endif endif
ifdef BUILDRECOVER
RECOVEREXE = $(U)RECOVER.EXE
RECOVEROBJ = $(O)RECOVER.O
endif
#========================================== #==========================================
# Primary Targets. # Primary Targets.
#========================================== #==========================================
@@ -397,7 +402,7 @@ util: $(O)utility.tag
$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \ $(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \
$(INCL)/pm.h monstr.c vis_tab.c \ $(INCL)/pm.h monstr.c vis_tab.c \
$(U)lev_comp.exe $(U)dgn_comp.exe $(U)recover.exe $(TILEUTIL) $(U)lev_comp.exe $(U)dgn_comp.exe $(RECOVEREXE) $(TILEUTIL)
$(subst /,\,echo utilities made > $@) $(subst /,\,echo utilities made > $@)
tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe
@@ -420,9 +425,13 @@ endif
@$(subst /,\,if exist $(DAT)/*.tib copy $(DAT)/*.tib $(GAMEDIR)) @$(subst /,\,if exist $(DAT)/*.tib copy $(DAT)/*.tib $(GAMEDIR))
@$(subst /,\,copy $(SSHR)/NetHack.cnf $(GAMEDIR)/defaults.nh) @$(subst /,\,copy $(SSHR)/NetHack.cnf $(GAMEDIR)/defaults.nh)
@$(subst /,\,copy $(MSYS)/NHAccess.nh $(GAMEDIR)) @$(subst /,\,copy $(MSYS)/NHAccess.nh $(GAMEDIR))
@$(subst /,\,copy $(U)recover.exe $(GAMEDIR)) ifdef BUILDRECOVER
@$(subst /,\,copy $(RECOVEREXE) $(GAMEDIR))
endif
@$(subst /,\,copy $(DOC)/guidebo*.txt $(GAMEDIR)) @$(subst /,\,copy $(DOC)/guidebo*.txt $(GAMEDIR))
ifdef BUILDRECOVER
@$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)) @$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR))
endif
@$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)) @$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR))
ifdef CWSDPMI ifdef CWSDPMI
@$(subst /,\,if exist $(CWSDPMI) copy $(CWSDPMI) $(GAMEDIR)) @$(subst /,\,if exist $(CWSDPMI) copy $(CWSDPMI) $(GAMEDIR))
@@ -435,7 +444,7 @@ endif
# The main target. # The main target.
#========================================== #==========================================
$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(O)$(GAME).lnk $(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk
$(LINK) $(LFLAGS) -o$(GAME).exe @$(O)$(GAME).lnk $(LIBRARIES) $(LINK) $(LFLAGS) -o$(GAME).exe @$(O)$(GAME).lnk $(LIBRARIES)
@$(subst /,\,stubedit $(GAME).exe minstack=2048K) @$(subst /,\,stubedit $(GAME).exe minstack=2048K)
@$(subst /,\,copy $(GAME).exe $(GAMEFILE)) @$(subst /,\,copy $(GAME).exe $(GAMEFILE))
@@ -495,7 +504,9 @@ spotless: clean
$(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe) $(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe)
$(subst /,\,if exist $(U)lev_comp.exe del $(U)lev_comp.exe) $(subst /,\,if exist $(U)lev_comp.exe del $(U)lev_comp.exe)
$(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe) $(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe)
$(subst /,\,if exist $(U)recover.exe del $(U)recover.exe) ifdef BUILDRECOVER
$(subst /,\,if exist $(RECOVEREXE) del $(RECOVEREXE))
endif
$(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe) $(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe)
$(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe) $(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe)
$(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe) $(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe)
@@ -705,11 +716,13 @@ endif
# Recover Utility # Recover Utility
#========================================== #==========================================
ifdef BUILDRECOVER
$(U)recover.exe: $(RECOVOBJS) $(U)recover.exe: $(RECOVOBJS)
$(LINK) $(LFLAGS) -o$@ $(O)recover.o $(LINK) $(LFLAGS) -o$@ $(O)recover.o
$(O)recover.o: $(CONFIG_H) $(U)recover.c $(O)recover.o: $(CONFIG_H) $(U)recover.c
$(CC) $(cflags) -o$@ $(U)recover.c $(CC) $(cflags) -o$@ $(U)recover.c
endif
#========================================== #==========================================
# Header file moves required for tile support # Header file moves required for tile support
+2 -1
View File
@@ -124,7 +124,7 @@ getlock()
# if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) # if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
chdirx(orgdir, 0); chdirx(orgdir, 0);
# endif # endif
# if defined(WIN32) # if defined(WIN32) || defined(HOLD_LOCKFILE_OPEN)
# if defined(HOLD_LOCKFILE_OPEN) # if defined(HOLD_LOCKFILE_OPEN)
if(errno == EACCES) { if(errno == EACCES) {
#define OOPS_BUFSZ 512 #define OOPS_BUFSZ 512
@@ -135,6 +135,7 @@ getlock()
Strcat(oops, " Is the other game still running?\n"); Strcat(oops, " Is the other game still running?\n");
if (strlen(fq_lock) < ((OOPS_BUFSZ -16) - strlen(oops))) if (strlen(fq_lock) < ((OOPS_BUFSZ -16) - strlen(oops)))
Sprintf(eos(oops), "Cannot open %s", fq_lock); Sprintf(eos(oops), "Cannot open %s", fq_lock);
Strcat(oops, "\n");
unlock_file(HLOCK); unlock_file(HLOCK);
error(oops); error(oops);
} else } else