.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:
Bart Oldeman 2004-03-27 01:42:33 +00:00
parent 66a756f1a3
commit 3fe15616e7
7 changed files with 181 additions and 197 deletions

168
build.bat
View File

@ -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= 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! call config
@if not exist config.bat goto end
@if not \%1 == \-r goto norebuild :-----------------------------------------------------------------------
call clobber :- following is command line handling
:norebuild :- options on the commandline overwrite default settings
:-----------------------------------------------------------------------
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]
:*
:**********************************************************************
:loop_commandline :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" == "msc" set COMPILER=MSCL8
if %1 == fat16 set XFAT=16 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" == "86" set XCPU=86
if %1 == wc set COMPILER=WATCOM if "%1" == "186" set XCPU=186
if %1 == tc set COMPILER=TC2 if "%1" == "386" set XCPU=386
if %1 == tcpp set COMPILER=TURBOCPP
if %1 == 86 set XCPU=86
if %1 == 186 set XCPU=186
if %1 == 386 set XCPU=386
shift 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 call default
if \%COMPILER% == \ goto end
:-----------------------------------------------------------------------
:- finally - we are going to compile
:-----------------------------------------------------------------------
@if not "%XLINK%" == "" goto link_set echo.
echo Process UTILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@if \%COMPILER% == \TC2 set XLINK=%TC2_BASE%\tlink /m/c echo.
@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
:************************************************************************
cd utils cd utils
%MAKE% production %MAKE% production
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
echo.
echo Process LIB ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
cd ..\lib cd ..\lib
%MAKE% %MAKE%
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
echo.
echo Process DRIVERS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
cd ..\drivers cd ..\drivers
%MAKE% production %MAKE% production
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
echo.
echo Process BOOT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
cd ..\boot cd ..\boot
%MAKE% production %MAKE% production
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
echo.
echo Process SYS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
cd ..\sys cd ..\sys
%MAKE% production %MAKE% production
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
:start
echo.
echo Process KERNEL +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
cd ..\kernel cd ..\kernel
%MAKE% production %MAKE% production
if errorlevel 1 goto abort if errorlevel 1 goto abort-cd
cd .. cd ..
@ -120,31 +96,17 @@ cd ..
if exist build2.bat call build2 if exist build2.bat call build2
@goto end echo.
echo Processing is done.
goto end
:abort :-----------------------------------------------------------------------
:abort-cd
cd .. cd ..
:abort
echo Compilation was aborted!
set XERROR=1 set XERROR=1
:end :end
:***** cleanup ****** default clearset
@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=

View File

@ -1,27 +1,21 @@
:-@echo off @echo off
:-
:- Revision 1.0 2001/09/05 tomehlert
:-
:- $Id$
:---------------------------------------------------------- :----------------------------------------------------------
:- batch file to build _many_ KERNELS, hope build works :- batch file to build _many_ KERNELS, hope build works
:-
:- takes 3 minutes on my(TE) Win2K/P700. your milage may vary :-) :- 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 :***** MSCL kernels
:***** some MSCL kernels
call config.bat call config.bat
if \%MS_BASE% == \ goto no_ms if "%MS_BASE%" == "" goto no_ms
call build -r msc 386 fat16 call build -r msc 386 fat16
%ONERROR% %ONERROR%
call build -r msc 186 fat16 call build -r msc 186 fat16
@ -36,9 +30,9 @@ call build -r msc 86 fat32
%ONERROR% %ONERROR%
:no_ms :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 call build -r tc 186 fat16
%ONERROR% %ONERROR%
call build -r tc 86 fat16 call build -r tc 86 fat16
@ -49,60 +43,49 @@ call build -r tc 86 fat32
%ONERROR% %ONERROR%
:no_tc :no_tc
:wc :***** (Open) Watcom kernels
:***** some WATCOM kernels - just for fun !!! if "%WATCOM%" == "" goto no_wc
:-
:- this is definitively only for fun - now
:- hope, this gets better
:-
if \%WATCOM% == \ goto no_wc
call build -r wc 386 fat32 call build -r wc 386 fat32
%ONERROR%
call build -r wc 386 fat16 call build -r wc 386 fat16
%ONERROR%
call build -r wc 86 fat32 call build -r wc 86 fat32
%ONERROR%
call build -r wc 86 fat16 call build -r wc 86 fat16
%ONERROR%
:no_wc :no_wc
:- the watcom executables will currently NOT RUN :***** now rebuild the default kernel
@del bin\kwc*.sys >nul
:***** now rebuild the normal kernel !!
call build -r call build -r
:************************************************************** :**************************************************************
:* now we build a summary of all kernels HMA size + total size :* now we build a summary of all kernels HMA size + total size
:* Yes, I know - "mit Linux waer das nicht passiert" :-) :* Yes, I know - "mit Linux waer das nicht passiert" :-)
:* at least, it's possible with standard DOS tools :* at least, it's possible with standard DOS tools
:************************************************************** :**************************************************************
:xsummary
set Sumfile=bin\ksummary.txt set Sumfile=bin\ksummary.txt
set TempSumfile=bin\tsummary.txt set TempSumfile=bin\tsummary.txt
:****@echo >%TempSumfile% Summary of all kernels build :****echo >%TempSumfile% Summary of all kernels build
:****@echo.|date >>%TempSumfile% :****echo.|date >>%TempSumfile%
:****@echo.|time >>%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
:****for %%i in (bin\k*.map) do call %0 $SUMMARY %%i :****for %%i in (bin\k*.map) do call %0 $SUMMARY %%i
del %Sumfile% if exist %Sumfile% del %Sumfile%
del %TempSumfile% if exist %TempSumfile% del %TempSumfile%
del ktemp.bat >ktemp.bat
for %%i in (bin\k*.map) do echo call %0 $SUMMARY %%i >>ktemp.bat for %%i in (bin\k*.map) do echo call %0 $SUMMARY %%i >>ktemp.bat
sort <ktemp.bat >ktemps.bat sort <ktemp.bat >ktemps.bat
call ktemps call ktemps
del ktemp.bat del ktemp.bat
del ktemps.bat del ktemps.bat
echo >>%Sumfile% Summary of all kernels build
@echo >>%Sumfile% Summary of all kernels build echo.|date >>%Sumfile%
@echo.|date >>%Sumfile% echo.|time >>%Sumfile%
@echo.|time >>%Sumfile%
find <%TempSumfile% "H" >>%Sumfile% find <%TempSumfile% "H" >>%Sumfile%
del %TempSumfile% del %TempSumfile%
@ -111,17 +94,15 @@ set Sumfile=
goto end goto end
:summary :summary
echo >>%TempSumfile% H************************************************* %2 echo H************************************************* %2 >>%TempSumfile%
type %2| find " HMA_TEXT" |find /V "HMA_TEXT_START" |find /V "HMA_TEXT_END" >>%TempSumfile% find<%2 " HMA_TEXT"|find/V "HMA_TEXT_START"|find/V "HMA_TEXT_END">>%TempSumfile%
type %2| find " STACK" >>%TempSumfile% find<%2 " STACK">>%TempSumfile%
goto end goto end
:************* done with summary ********************************* :************* done with summary *********************************
:daswarwohlnix :daswarwohlnix
@echo Sorry, something didn't work as expected :-( echo Sorry, something didn't work as expected :-(
@set ONERROR= set ONERROR=
:end :end

View File

@ -1,19 +1,13 @@
@echo off @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 call config
goto start call default
: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
cd utils cd utils
%MAKE% clean %MAKE% clean
@ -34,12 +28,10 @@ cd ..\kernel
%MAKE% clean %MAKE% clean
cd ..\hdr cd ..\hdr
del *.bak if exist *.bak del *.bak
cd .. cd ..
if exist *.bak del *.bak
del *.bak
:end :end
set MAKE= default clearset
set COMPILER=

View File

@ -1,18 +1,13 @@
@echo off @echo off
rem batch file to clobber everything
rem $Id$ :- batch file to clobber everything
:- $Id$
if not exist config.bat goto noconfigbat if not exist config.bat echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup!
goto start if not exist config.bat goto end
:noconfigbat call config
echo You must copy CONFIG.B to CONFIG.BAT and edit it to reflect your setup! call default
goto end
:start
call config.bat
call getmake.bat
cd utils cd utils
%MAKE% clobber %MAKE% clobber
@ -33,13 +28,11 @@ cd ..\kernel
%MAKE% clobber %MAKE% clobber
cd ..\hdr cd ..\hdr
del *.bak if exist *.bak del *.bak
cd .. cd ..
if exist *.bak del *.bak
del *.bak if exist status.me del status.me
del status.me
:end :end
set MAKE= default clearset
set COMPILER=

66
default.bat Normal file
View File

@ -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

View File

@ -4,7 +4,7 @@
*/*/clobber.bat */*/clobber.bat
*/*/config.b */*/config.b
*/*/filelist */*/filelist
*/*/getmake.bat */*/default.bat
*/*/makefile */*/makefile
*/*/bin/autoexec.bat */*/bin/autoexec.bat
*/*/bin/config.sys */*/bin/config.sys

View File

@ -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