win32 uses included uudecode utility

This commit is contained in:
nethack.allison
2002-03-01 05:06:48 +00:00
parent 75945c9056
commit 58c1d99bb8
5 changed files with 244 additions and 122 deletions

View File

@@ -72,6 +72,8 @@ static char sccsid[] = "@(#)uudecode.c 5.5 (Berkeley) 7/6/88";
# endif
# include <sys/types.h> /* MSDOS, WIN32, or UNIX */
# include <sys/stat.h>
# include <string.h>
# include <stdlib.h>
#endif
static void decode(FILE *, FILE *);
@@ -224,6 +226,7 @@ int n;
putc(c3, f);
}
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
/*
* Return the ptr in sp at which the character c appears;
* NULL if not found
@@ -243,4 +246,5 @@ register char *sp, c;
} while (*sp++);
return(NULL);
}
#endif

View File

@@ -1,4 +1,4 @@
# SCCS Id: @(#)Makefile.nt 3.4 2002/01/22
# SCCS Id: @(#)Makefile.nt 3.4 2002/02/28
# Copyright (c) NetHack PC Development Team 1993-2001
#
# NetHack 3.4.x Makefile for MS Visual C++ V6.x and above and MS NMAKE
@@ -137,23 +137,23 @@ PRECOMPHEAD = N # set to Y if you want to use precomp. headers
################################################
!IF "$(GRAPHICAL)" == "Y"
TILEGAME = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o \
$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
TILEDEF = -DTILES -DMSWIN_GRAPHICS
TILERES = $(O)winhack.res
TILEINCL = -I$(WIN32)
TILEHDR = $(WIN32)\mhaskyn.h $(WIN32)\mhdlg.h $(WIN32)\mhfont.h \
WINPFLAG = -DTILES -DMSWIN_GRAPHICS
NHRES = $(O)winhack.res
WINPINC = -I$(WIN32)
WINPHDR = $(WIN32)\mhaskyn.h $(WIN32)\mhdlg.h $(WIN32)\mhfont.h \
$(WIN32)\mhinput.h $(WIN32)\mhmain.h $(WIN32)\mhmap.h $(WIN32)\mhmenu.h \
$(WIN32)\mhmsg.h $(WIN32)\mhmsgwnd.h $(WIN32)\mhrip.h $(WIN32)\mhstatus.h \
$(WIN32)\mhtext.h $(WIN32)\resource.h $(WIN32)\winMS.h
!ELSE
TILEGAME = $(O)nttty.o
TILEDEF = -DWIN32CON
TILEHDR =
TILERES = $(O)console.res
TILEINCL =
WINPORT = $(O)nttty.o
WINPFLAG = -DWIN32CON
WINPHDR =
NHRES = $(O)console.res
WINPINC =
!ENDIF
TILEUTIL16 = $(UTIL)\tile2bmp.exe
@@ -183,7 +183,7 @@ DLBFLG =
# macros. All builds include the base ones.
#==========================================
CFLAGSBASE = -c $(cflags) $(cvarsmt) -I$(INCL) -nologo $(cdebug) $(TILEINCL)
CFLAGSBASE = -c $(cflags) $(cvarsmt) -I$(INCL) -nologo $(cdebug) $(WINPINC)
LFLAGSBASEC = $(linkdebug) $(conflags) $(conlibsmt)
LFLAGSBASEG = $(linkdebug) $(guiflags) $(guilibsmt) comctl32.lib
@@ -199,7 +199,7 @@ LFLAGSU = $(LFLAGSBASEC)
#==========================================
LFLAGSBASE = $(linkdebug) $(conflags) $(conlibsmt)
CFLAGS = $(CFLAGSBASE) $(TILEDEF) $(DLBFLG)
CFLAGS = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
NHLFLAGS1 = /NODEFAULTLIB /INCREMENTAL:NO /PDB:"$(GAME).PDB" /RELEASE /NOLOGO
NHLFLAGS2 = /MAP:"$(GAME).MAP" /MACHINE:$(CPU) -IGNORE:505
!IF ("$(GRAPHICAL)"=="Y")
@@ -384,11 +384,11 @@ OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
$(VOBJ26) $(VOBJ27)
TILOBJ = $(TILEGAME)
WINPOBJ = $(WINPORT)
VVOBJ = $(O)version.o
ALLOBJ = $(TILOBJ) $(SOBJ) $(DLBOBJ) $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
ALLOBJ = $(WINPOBJ) $(SOBJ) $(DLBOBJ) $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
#==========================================
# Header file macros
@@ -527,10 +527,12 @@ tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
@echo Optional tile development utilities are up to date.
!IF "$(GRAPHICAL)"=="Y"
$(TILERES): $(TILEBMP16) $(WIN32)\winhack.rc
$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp $(WIN32)\petmark.bmp \
$(WIN32)\NetHack.ico
@$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
!ELSE
$(TILERES): $(NTSYS)\console.rc
$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc
!ENDIF
@@ -563,12 +565,12 @@ $(TILERES): $(NTSYS)\console.rc
# DO NOT INDENT THE << below!
#
$(GAMEFILE) : $(ALLOBJ) $(TILERES)
$(GAMEFILE) : $(ALLOBJ) $(NHRES)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@echo Linking....
@$(link) $(LFLAGS) -out:$@ @<<$(GAME).lnk
$(ALLOBJ:^ =^
) $(TILERES)
) $(NHRES)
<<
@if exist $(O)install.tag del $(O)install.tag
@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak
@@ -617,6 +619,45 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe
$(SRC)\vis_tab.c: $(U)makedefs.exe
$(U)makedefs -z
#==========================================
# uudecode utility and uuencoded targets
#==========================================
$(U)uudecode.exe: $(O)uudecode.o
@$(link) $(LFLAGSU) -out:$@ $(O)\uudecode.o
$(O)uudecode.o: $(SSYS)\uudecode.c
$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
chdir $(NTSYS)
..\..\util\uudecode.exe nhico.uu
chdir ..\..\src
$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
chdir $(WIN32)
..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
chdir ..\..\src
$(WIN32)\mnsel.bmp: $(U)uudecode.exe $(WIN32)\mnsel.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnsel.uu
chdir ..\..\src
$(WIN32)\mnselcnt.bmp: $(U)uudecode.exe $(WIN32)\mnselcnt.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnselcnt.uu
chdir ..\..\src
$(WIN32)\mnunsel.bmp: $(U)uudecode.exe $(WIN32)\mnunsel.uu
chdir $(WIN32)
..\..\util\uudecode.exe mnunsel.uu
chdir ..\..\src
$(WIN32)\petmark.bmp: $(U)uudecode.exe $(WIN32)\petmark.uu
chdir $(WIN32)
..\..\util\uudecode.exe petmark.uu
chdir ..\..\src
#==========================================
# Level Compiler Stuff
#==========================================
@@ -990,7 +1031,7 @@ clean:
if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
if exist $(SRC)\*.map del $(SRC)\*.map
! IF ("$(TILEDEF)"!="")
! IF ("$(WINPFLAG)"!="")
if exist $(TILEBMP16) del $(TILEBMP16)
if exist $(TILEBMP32) del $(TILEBMP32)
! ENDIF

View File

@@ -1,11 +1,10 @@
@REM SCCS Id: @(#)nhsetup.bat 2002/01/25
@REM SCCS Id: @(#)nhsetup.bat 2002/02/28
@REM Copyright (c) NetHack PC Development Team 1993, 1996, 2002
@REM NetHack may be freely redistributed. See license for details.
@REM Win32 setup batch file, see Install.nt for details
@REM
@echo off
set err_nouu=
set err_copy=
set opt=
@@ -27,13 +26,6 @@ goto err_set
:do_tty
set opt=NetHack for NT Console
if exist .\nethack.ico goto hasicon
if exist .\nhico.uu uudecode nhico.uu >nul
if exist .\nethack.ico goto hasicon
set err_nouu=Y
goto done
:hasicon
echo NetHack icon exists ok.
echo "Copying Makefile.NT to ..\..\src\Makefile"
copy makefile.NT ..\..\src\Makefile >nul
echo Makefile copied ok.
@@ -68,72 +60,9 @@ copy ..\..\win\win32\tile2bmp.dsp ..\..\build >nul
copy ..\..\win\win32\tiles.dsp ..\..\build >nul
copy ..\..\win\win32\tiles.mak ..\..\build >nul
copy ..\..\win\win32\tilemap.dsp ..\..\build >nul
copy ..\..\win\win32\uudecode.dsp ..\..\build >nul
copy ..\..\win\win32\nethackw.dsp ..\..\build >nul
echo.
echo "Decoding/Copying a couple of bitmaps"
if exist ..\..\win\win32\mnsel.bmp goto hasmnsel2
if exist .\mnsel.bmp goto hasmnsel1
if exist ..\..\win\win32\mnsel.uu uudecode ..\..\win\win32\mnsel.uu >nul
if exist .\mnsel.bmp goto hasmnsel1
echo Error - No UUDECODE utility to decode ..\..\win\win32\mnsel.uu
goto hasmnsel2
:hasmnsel1
echo copy .\mnsel.bmp ..\..\win\win32
copy .\mnsel.bmp ..\..\win\win32
:hasmnsel2
if NOT exist ..\..\win\win32\mnsel.bmp set err_nouu=Y
if exist ..\..\win\win32\mnunsel.bmp goto hasmnuns2
if exist .\mnunsel.bmp goto hasmnuns1
if exist ..\..\win\win32\mnunsel.uu uudecode ..\..\win\win32\mnunsel.uu >nul
if exist .\mnunsel.bmp goto hasmnuns1
echo Error - No UUDECODE utility to decode ..\..\win\win32\mnunsel.uu
goto hasmnuns2
:hasmnuns1
echo copy .\mnunsel.bmp ..\..\win\win32
copy .\mnunsel.bmp ..\..\win\win32
:hasmnuns2
if NOT exist ..\..\win\win32\mnunsel.bmp set err_nouu=Y
if exist ..\..\win\win32\mnselcnt.bmp goto hasmnselcnt2
if exist .\mnselcnt.bmp goto hasmnselcnt1
if exist ..\..\win\win32\mnselcnt.uu uudecode ..\..\win\win32\mnselcnt.uu >nul
if exist .\mnselcnt.bmp goto hasmnselcnt1
echo Error - No UUDECODE utility to decode ..\..\win\win32\mnselcnt.uu
goto hasmnselcnt2
:hasmnselcnt1
echo copy .\mnselcnt.bmp ..\..\win\win32
copy .\mnselcnt.bmp ..\..\win\win32
:hasmnselcnt2
if NOT exist ..\..\win\win32\mnselcnt.bmp set err_nouu=Y
if exist ..\..\win\win32\petmark.bmp goto haspm2
if exist .\petmark.bmp goto haspm1
if exist ..\..\win\win32\petmark.uu uudecode ..\..\win\win32\petmark.uu >nul
if exist .\petmark.bmp goto haspm1
echo Error - No UUDECODE utility to decode ..\..\win\win32\petmark.uu
goto haspm2
:haspm1
echo copy .\petmark.bmp ..\..\win\win32
copy .\petmark.bmp ..\..\win\win32
:haspm2
if NOT exist ..\..\win\win32\petmark.bmp set err_nouu=Y
echo "Decoding/Copying ICONS"
if exist ..\..\win\win32\nethack.ico goto hasicon2
if exist .\nethack.ico goto hasicon1
if exist .\nhico.uu uudecode nhico.uu >nul
if exist .\nethack.ico goto hasicon1
echo Error - No UUDECODE utility to decode nhico.uu
goto hasicon2
:hasicon1
echo.
echo copy .\nethack.ico ..\..\win\win32
copy .\nethack.ico ..\..\win\win32
:hasicon2
if NOT exist ..\..\win\win32\nethack.ico set err_nouu=Y
goto done
:err_win
@@ -176,14 +105,9 @@ goto end
:done
echo done!
echo.
if "%err_nouu%"=="" echo Proceed with the next step documented in Install.nt
if "%err_nouu%"=="" echo for building %opt%.
echo Proceed with the next step documented in Install.nt
echo for building %opt%.
echo.
if "%err_nouu%"=="" goto fini
echo Apparently you have no UUDECODE utility in your path.
echo You need a UUDECODE utility in order to turn several .uu files
echo into their decoded binary versions.
echo Check "Install.nt" for a list of prerequisites for building NetHack.
:fini
:end