mirror of https://github.com/FDOS/kernel.git
.BAT file cleanups from Arkady
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@834 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
66a756f1a3
commit
3fe15616e7
168
build.bat
168
build.bat
|
@ -1,117 +1,93 @@
|
|||
:-@echo off
|
||||
@echo off
|
||||
|
||||
:- batch file to build everything
|
||||
:- batch file to build everything
|
||||
:- $Id$
|
||||
|
||||
:- $Id$
|
||||
:- Syntax: BUILD [-r] [fat32|fat16] [msc|wc|tc|tcpp] [86|186|386]
|
||||
:- option case is significant !!
|
||||
|
||||
if "%1" == "-r" call clobber
|
||||
if "%1" == "-r" shift
|
||||
|
||||
set XERROR=
|
||||
|
||||
if not exist config.bat echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
if not exist config.bat goto abort
|
||||
|
||||
@if not exist config.bat echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
@if not exist config.bat goto end
|
||||
call config
|
||||
|
||||
@if not \%1 == \-r goto norebuild
|
||||
call clobber
|
||||
:norebuild
|
||||
|
||||
|
||||
call config.bat
|
||||
call getmake.bat
|
||||
|
||||
|
||||
@set XERROR=
|
||||
|
||||
:**********************************************************************
|
||||
:* DONE with preferences - following is command line handling
|
||||
:*
|
||||
:* options on the commandline overwrite your default settings
|
||||
:*
|
||||
:* options handled ( case significant !! )
|
||||
:*
|
||||
:* BUILD [fat32|fat16] [msc|wc|tc|tcpp] [86|186|386]
|
||||
:*
|
||||
:**********************************************************************
|
||||
:-----------------------------------------------------------------------
|
||||
:- following is command line handling
|
||||
:- options on the commandline overwrite default settings
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
:loop_commandline
|
||||
|
||||
if \%1 == \ goto done_with_commandline
|
||||
if "%1" == "fat32" set XFAT=32
|
||||
if "%1" == "fat16" set XFAT=16
|
||||
|
||||
if %1 == fat32 set XFAT=32
|
||||
if %1 == fat16 set XFAT=16
|
||||
if "%1" == "msc" set COMPILER=MSCL8
|
||||
if "%1" == "wc" set COMPILER=WATCOM
|
||||
if "%1" == "tc" set COMPILER=TC2
|
||||
if "%1" == "tcpp" set COMPILER=TURBOCPP
|
||||
|
||||
if %1 == msc set COMPILER=MSCL8
|
||||
if %1 == wc set COMPILER=WATCOM
|
||||
if %1 == tc set COMPILER=TC2
|
||||
if %1 == tcpp set COMPILER=TURBOCPP
|
||||
|
||||
|
||||
if %1 == 86 set XCPU=86
|
||||
if %1 == 186 set XCPU=186
|
||||
if %1 == 386 set XCPU=386
|
||||
if "%1" == "86" set XCPU=86
|
||||
if "%1" == "186" set XCPU=186
|
||||
if "%1" == "386" set XCPU=386
|
||||
|
||||
shift
|
||||
goto loop_commandline
|
||||
if not "%1" == "" goto loop_commandline
|
||||
|
||||
:done_with_commandline
|
||||
if "%COMPILER%" == "" echo you MUST define a COMPILER variable in CONFIG.BAT
|
||||
if "%COMPILER%" == "" goto abort
|
||||
|
||||
if \%COMPILER% == \ echo you MUST define a COMPILER variable in CONFIG.BAT
|
||||
if \%COMPILER% == \ goto end
|
||||
call default
|
||||
|
||||
:-----------------------------------------------------------------------
|
||||
:- finally - we are going to compile
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
@if not "%XLINK%" == "" goto link_set
|
||||
|
||||
@if \%COMPILER% == \TC2 set XLINK=%TC2_BASE%\tlink /m/c
|
||||
@if \%COMPILER% == \TURBOCPP set XLINK=%TP1_BASE%\bin\tlink /m/c
|
||||
@if \%COMPILER% == \TC3 set XLINK=%TC3_BASE%\bin\tlink /m/c
|
||||
@if \%COMPILER% == \BC5 set XLINK=%BC5_BASE%\bin\tlink /m/c
|
||||
@if \%COMPILER% == \WATCOM set XLINK=..\utils\wlinker /ma/nologo
|
||||
@if \%COMPILER% == \MSCL8 set XLINK=%MS_BASE%\bin\link /ONERROR:NOEXE /ma /nologo
|
||||
goto link_set
|
||||
|
||||
:link_set
|
||||
|
||||
echo linker is %XLINK%
|
||||
|
||||
@if not "%XUPX%" == "" goto upx_set
|
||||
@set XUPX=@rem
|
||||
@set UPXOPT=
|
||||
goto compile
|
||||
|
||||
:upx_set
|
||||
@set UPXOPT=-U
|
||||
|
||||
:compile
|
||||
|
||||
:************************************************************************
|
||||
:* finally - we are going to compile
|
||||
:************************************************************************
|
||||
|
||||
echo.
|
||||
echo Process UTILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd utils
|
||||
%MAKE% production
|
||||
if errorlevel 1 goto abort
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
echo.
|
||||
echo Process LIB ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd ..\lib
|
||||
%MAKE%
|
||||
if errorlevel 1 goto abort
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
echo.
|
||||
echo Process DRIVERS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd ..\drivers
|
||||
%MAKE% production
|
||||
if errorlevel 1 goto abort
|
||||
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
echo.
|
||||
echo Process BOOT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd ..\boot
|
||||
%MAKE% production
|
||||
if errorlevel 1 goto abort
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
echo.
|
||||
echo Process SYS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd ..\sys
|
||||
%MAKE% production
|
||||
if errorlevel 1 goto abort
|
||||
|
||||
:start
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
echo.
|
||||
echo Process KERNEL +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
echo.
|
||||
cd ..\kernel
|
||||
%MAKE% production
|
||||
if errorlevel 1 goto abort
|
||||
if errorlevel 1 goto abort-cd
|
||||
|
||||
cd ..
|
||||
|
||||
|
@ -120,31 +96,17 @@ cd ..
|
|||
|
||||
if exist build2.bat call build2
|
||||
|
||||
@goto end
|
||||
echo.
|
||||
echo Processing is done.
|
||||
goto end
|
||||
|
||||
:abort
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
:abort-cd
|
||||
cd ..
|
||||
:abort
|
||||
echo Compilation was aborted!
|
||||
set XERROR=1
|
||||
|
||||
:end
|
||||
:***** cleanup ******
|
||||
@echo off
|
||||
|
||||
@if "%OLDPATH%" == "" goto no_path_change
|
||||
@set PATH=%OLDPATH%
|
||||
@set OLDPATH=
|
||||
:no_path_change
|
||||
|
||||
@set MAKE=
|
||||
@set COMPILER=
|
||||
@set XCPU=
|
||||
@set XFAT=
|
||||
@set XLINK=
|
||||
@set TC2_BASE=
|
||||
@set TP1_BASE=
|
||||
@set TC3_BASE=
|
||||
@set BC5_BASE=
|
||||
@set MS_BASE=
|
||||
@set XNASM=
|
||||
@set XERROR=
|
||||
@set XUPX=
|
||||
@set UPXOPT=
|
||||
default clearset
|
||||
|
|
79
buildall.bat
79
buildall.bat
|
@ -1,27 +1,21 @@
|
|||
:-@echo off
|
||||
|
||||
:-
|
||||
:- Revision 1.0 2001/09/05 tomehlert
|
||||
:-
|
||||
@echo off
|
||||
|
||||
:- $Id$
|
||||
|
||||
:----------------------------------------------------------
|
||||
:- batch file to build _many_ KERNELS, hope build works
|
||||
:-
|
||||
:- takes 3 minutes on my(TE) Win2K/P700. your milage may vary :-)
|
||||
:----------------------------------------------------------
|
||||
|
||||
if \%1 == \$SUMMARY goto summary
|
||||
if "%1" == "$SUMMARY" goto summary
|
||||
|
||||
:-goto xsummary
|
||||
set onerror=if not "%%XERROR%%" == "" goto daswarwohlnix
|
||||
|
||||
set onerror=if not \%XERROR% == \ goto daswarwohlnix
|
||||
|
||||
:***** some MSCL kernels
|
||||
:***** MSCL kernels
|
||||
|
||||
call config.bat
|
||||
|
||||
if \%MS_BASE% == \ goto no_ms
|
||||
if "%MS_BASE%" == "" goto no_ms
|
||||
call build -r msc 386 fat16
|
||||
%ONERROR%
|
||||
call build -r msc 186 fat16
|
||||
|
@ -36,9 +30,9 @@ call build -r msc 86 fat32
|
|||
%ONERROR%
|
||||
:no_ms
|
||||
|
||||
:***** some TC 2.01 kernels
|
||||
:***** TC 2.01 kernels
|
||||
|
||||
if \%TC2_BASE% == \ goto no_tc
|
||||
if "%TC2_BASE%" == "" goto no_tc
|
||||
call build -r tc 186 fat16
|
||||
%ONERROR%
|
||||
call build -r tc 86 fat16
|
||||
|
@ -49,60 +43,49 @@ call build -r tc 86 fat32
|
|||
%ONERROR%
|
||||
:no_tc
|
||||
|
||||
:wc
|
||||
:***** (Open) Watcom kernels
|
||||
|
||||
:***** some WATCOM kernels - just for fun !!!
|
||||
|
||||
:-
|
||||
:- this is definitively only for fun - now
|
||||
:- hope, this gets better
|
||||
:-
|
||||
if \%WATCOM% == \ goto no_wc
|
||||
if "%WATCOM%" == "" goto no_wc
|
||||
call build -r wc 386 fat32
|
||||
%ONERROR%
|
||||
call build -r wc 386 fat16
|
||||
%ONERROR%
|
||||
call build -r wc 86 fat32
|
||||
%ONERROR%
|
||||
call build -r wc 86 fat16
|
||||
%ONERROR%
|
||||
:no_wc
|
||||
|
||||
:- the watcom executables will currently NOT RUN
|
||||
@del bin\kwc*.sys >nul
|
||||
:***** now rebuild the default kernel
|
||||
|
||||
|
||||
:***** now rebuild the normal kernel !!
|
||||
call build -r
|
||||
|
||||
|
||||
:**************************************************************
|
||||
:* now we build a summary of all kernels HMA size + total size
|
||||
:* Yes, I know - "mit Linux waer das nicht passiert" :-)
|
||||
:* at least, it's possible with standard DOS tools
|
||||
:**************************************************************
|
||||
|
||||
:xsummary
|
||||
|
||||
set Sumfile=bin\ksummary.txt
|
||||
set TempSumfile=bin\tsummary.txt
|
||||
|
||||
:****@echo >%TempSumfile% Summary of all kernels build
|
||||
:****@echo.|date >>%TempSumfile%
|
||||
:****@echo.|time >>%TempSumfile%
|
||||
:****for %%i in (bin\k*.map) do call %0 $SUMMARY %%i
|
||||
:****for %%i in (bin\k*.map) do call %0 $SUMMARY %%i
|
||||
:****echo >%TempSumfile% Summary of all kernels build
|
||||
:****echo.|date >>%TempSumfile%
|
||||
:****echo.|time >>%TempSumfile%
|
||||
:****for %%i in (bin\k*.map) do call %0 $SUMMARY %%i
|
||||
|
||||
del %Sumfile%
|
||||
del %TempSumfile%
|
||||
del ktemp.bat
|
||||
if exist %Sumfile% del %Sumfile%
|
||||
if exist %TempSumfile% del %TempSumfile%
|
||||
>ktemp.bat
|
||||
for %%i in (bin\k*.map) do echo call %0 $SUMMARY %%i >>ktemp.bat
|
||||
sort <ktemp.bat >ktemps.bat
|
||||
call ktemps
|
||||
del ktemp.bat
|
||||
del ktemps.bat
|
||||
|
||||
|
||||
@echo >>%Sumfile% Summary of all kernels build
|
||||
@echo.|date >>%Sumfile%
|
||||
@echo.|time >>%Sumfile%
|
||||
echo >>%Sumfile% Summary of all kernels build
|
||||
echo.|date >>%Sumfile%
|
||||
echo.|time >>%Sumfile%
|
||||
find <%TempSumfile% "H" >>%Sumfile%
|
||||
del %TempSumfile%
|
||||
|
||||
|
@ -111,17 +94,15 @@ set Sumfile=
|
|||
goto end
|
||||
|
||||
:summary
|
||||
echo >>%TempSumfile% H************************************************* %2
|
||||
type %2| find " HMA_TEXT" |find /V "HMA_TEXT_START" |find /V "HMA_TEXT_END" >>%TempSumfile%
|
||||
type %2| find " STACK" >>%TempSumfile%
|
||||
echo H************************************************* %2 >>%TempSumfile%
|
||||
find<%2 " HMA_TEXT"|find/V "HMA_TEXT_START"|find/V "HMA_TEXT_END">>%TempSumfile%
|
||||
find<%2 " STACK">>%TempSumfile%
|
||||
goto end
|
||||
|
||||
:************* done with summary *********************************
|
||||
|
||||
|
||||
:daswarwohlnix
|
||||
@echo Sorry, something didn't work as expected :-(
|
||||
@set ONERROR=
|
||||
echo Sorry, something didn't work as expected :-(
|
||||
set ONERROR=
|
||||
|
||||
:end
|
||||
|
||||
|
||||
|
|
26
clean.bat
26
clean.bat
|
@ -1,19 +1,13 @@
|
|||
@echo off
|
||||
|
||||
rem batch file to clean everything
|
||||
:- batch file to clean everything
|
||||
:- $Id$
|
||||
|
||||
rem $Id$
|
||||
if not exist config.bat echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
if not exist config.bat goto end
|
||||
|
||||
if not exist config.bat goto noconfigbat
|
||||
goto start
|
||||
|
||||
:noconfigbat
|
||||
echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
goto end
|
||||
|
||||
:start
|
||||
call config.bat
|
||||
call getmake.bat
|
||||
call config
|
||||
call default
|
||||
|
||||
cd utils
|
||||
%MAKE% clean
|
||||
|
@ -34,12 +28,10 @@ cd ..\kernel
|
|||
%MAKE% clean
|
||||
|
||||
cd ..\hdr
|
||||
del *.bak
|
||||
if exist *.bak del *.bak
|
||||
|
||||
cd ..
|
||||
|
||||
del *.bak
|
||||
if exist *.bak del *.bak
|
||||
|
||||
:end
|
||||
set MAKE=
|
||||
set COMPILER=
|
||||
default clearset
|
||||
|
|
27
clobber.bat
27
clobber.bat
|
@ -1,18 +1,13 @@
|
|||
@echo off
|
||||
rem batch file to clobber everything
|
||||
|
||||
rem $Id$
|
||||
:- batch file to clobber everything
|
||||
:- $Id$
|
||||
|
||||
if not exist config.bat goto noconfigbat
|
||||
goto start
|
||||
if not exist config.bat echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
if not exist config.bat goto end
|
||||
|
||||
:noconfigbat
|
||||
echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
|
||||
goto end
|
||||
|
||||
:start
|
||||
call config.bat
|
||||
call getmake.bat
|
||||
call config
|
||||
call default
|
||||
|
||||
cd utils
|
||||
%MAKE% clobber
|
||||
|
@ -33,13 +28,11 @@ cd ..\kernel
|
|||
%MAKE% clobber
|
||||
|
||||
cd ..\hdr
|
||||
del *.bak
|
||||
if exist *.bak del *.bak
|
||||
|
||||
cd ..
|
||||
|
||||
del *.bak
|
||||
del status.me
|
||||
if exist *.bak del *.bak
|
||||
if exist status.me del status.me
|
||||
|
||||
:end
|
||||
set MAKE=
|
||||
set COMPILER=
|
||||
default clearset
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
@echo off
|
||||
|
||||
:- $Id$
|
||||
|
||||
if "%1" == "clearset" goto clearset
|
||||
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
if not "%MAKE%" == "" goto skip_make
|
||||
|
||||
if "%COMPILER%" == "TC2" set MAKE=%TC2_BASE%\make
|
||||
if "%COMPILER%" == "TURBOCPP" set MAKE=%TP1_BASE%\bin\make
|
||||
if "%COMPILER%" == "TC3" set MAKE=%TC3_BASE%\bin\make
|
||||
if "%COMPILER%" == "BC5" set MAKE=%BC5_BASE%\bin\make
|
||||
if "%COMPILER%" == "WATCOM" set MAKE=wmake/ms /h
|
||||
if "%COMPILER%" == "MSCL8" set MAKE=%MS_BASE%\bin\nmake/nologo
|
||||
|
||||
echo Make is %MAKE%.
|
||||
|
||||
:skip_make
|
||||
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
if not "%XLINK%" == "" goto skip_xlink
|
||||
|
||||
if "%COMPILER%" == "TC2" set XLINK=%TC2_BASE%\tlink/m/c
|
||||
if "%COMPILER%" == "TURBOCPP" set XLINK=%TP1_BASE%\bin\tlink/m/c
|
||||
if "%COMPILER%" == "TC3" set XLINK=%TC3_BASE%\bin\tlink/m/c
|
||||
if "%COMPILER%" == "BC5" set XLINK=%BC5_BASE%\bin\tlink/m/c
|
||||
if "%COMPILER%" == "WATCOM" set XLINK=..\utils\wlinker/ma/nologo
|
||||
if "%COMPILER%" == "MSCL8" set XLINK=%MS_BASE%\bin\link/ONERROR:NOEXE /ma /nologo
|
||||
|
||||
echo Linker is %XLINK%.
|
||||
|
||||
:skip_xlink
|
||||
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
if not "%XUPX%" == "" set UPXOPT=-U
|
||||
if "%XUPX%" == "" set UPXOPT=
|
||||
if "%XUPX%" == "" set XUPX=@rem
|
||||
|
||||
goto end
|
||||
|
||||
:-----------------------------------------------------------------------
|
||||
|
||||
:clearset
|
||||
|
||||
if not "%OLDPATH%" == "" set PATH=%OLDPATH%
|
||||
if not "%OLDPATH%" == "" set OLDPATH=
|
||||
|
||||
set MAKE=
|
||||
set COMPILER=
|
||||
set XCPU=
|
||||
set XFAT=
|
||||
set XLINK=
|
||||
set TC2_BASE=
|
||||
set TP1_BASE=
|
||||
set TC3_BASE=
|
||||
set BC5_BASE=
|
||||
set MS_BASE=
|
||||
set XNASM=
|
||||
set XUPX=
|
||||
set UPXOPT=
|
||||
|
||||
:end
|
2
filelist
2
filelist
|
@ -4,7 +4,7 @@
|
|||
*/*/clobber.bat
|
||||
*/*/config.b
|
||||
*/*/filelist
|
||||
*/*/getmake.bat
|
||||
*/*/default.bat
|
||||
*/*/makefile
|
||||
*/*/bin/autoexec.bat
|
||||
*/*/bin/config.sys
|
||||
|
|
10
getmake.bat
10
getmake.bat
|
@ -1,10 +0,0 @@
|
|||
@if not "%MAKE%" == "" goto make_set
|
||||
|
||||
@if \%COMPILER% == \TC2 set MAKE=%TC2_BASE%\make
|
||||
@if \%COMPILER% == \TURBOCPP set MAKE=%TP1_BASE%\bin\make
|
||||
@if \%COMPILER% == \TC3 set MAKE=%TC3_BASE%\bin\make
|
||||
@if \%COMPILER% == \BC5 set MAKE=%BC5_BASE%\bin\make
|
||||
@if \%COMPILER% == \WATCOM set MAKE=wmake /ms /h
|
||||
@if \%COMPILER% == \MSCL8 set MAKE=%MS_BASE%\bin\nmake /nologo
|
||||
|
||||
:make_set
|
Loading…
Reference in New Issue