home *** CD-ROM | disk | FTP | other *** search
- @echo off
- rem =======================================================================
- rem
- rem BUILD.BAT
- rem
- rem Builds demo application
- rem
- rem "Syntax: build [debug16 | ndebug16 | debug32 | ndebug32] [borland]"
- rem
- rem =======================================================================
- rem
-
-
- rem --- Check for environment space ---
- set bcc=N
- set typ=d16
- set ok=N
-
- if NOT "%ok%" == "N" goto err_env
-
-
- rem --- Parse arguments ---
- :parse
- if "%1" == "" goto check
- if "%1" == "borland" set bcc=Y
- if "%1" == "debug16" goto debug16
- if "%1" == "debug32" goto debug32
- if "%1" == "ndebug16" goto ndebug16
- if "%1" == "ndebug32" goto ndebug32
- shift
- goto parse
-
- rem --- Handle "debug16" ---
- :debug16
- if "%ok%" == "Y" goto err_usage
- set ok=Y
- set typ=d16
- shift
- goto parse
-
- rem --- Handle "debug32" ---
- :debug32
- if "%ok%" == "Y" goto err_usage
- if not '%OS%' == 'Windows_NT' goto err_ops
- set ok=Y
- set typ=d32
- shift
- goto parse
-
- rem --- Handle "ndebug16" ---
- :ndebug16
- if "%ok%" == "Y" goto err_usage
- set ok=Y
- set typ=n16
- shift
- goto parse
-
- rem --- Handle "ndebug32" ---
- :ndebug32
- if "%ok%" == "Y" goto err_usage
- if not '%OS%' == 'Windows_NT' goto err_ops
- set ok=Y
- set typ=n32
- shift
- goto parse
-
-
- rem --- Verify correctness of everything ---
- :check
- if NOT "%ok%" == "Y" goto err_usage
- if NOT "%bcc%" == "Y" goto doit
- if "%typ%" == "d32" goto err_borland
- if "%typ%" == "n32" goto err_borland
- goto borland
-
-
- rem --- Make the demo ---
- :doit
- if "%typ%" == "n16" nmake
- if "%typ%" == "d16" nmake DEBUG=YES
- if "%typ%" == "n32" nmake WIN32=YES
- if "%typ%" == "d32" nmake WIN32=YES DEBUG=YES
- goto end
-
-
- rem --- Borland make ---
- :borland
- if "%typ%" == "n16" make -f bccmake
- if "%typ%" == "d16" make -f bccmake DEBUG=YES
- goto end
-
-
- rem --- Out of environment space ---
- :err_env
- echo.
- echo Error: out of environment space
- echo.
- goto end
-
-
- rem --- Invalid operating system environment ---
- :err_ops
- echo.
- echo Error: Windows/NT required to build debug32 or ndebug32
- echo.
- goto end
-
-
- rem --- Usage message ---
- :err_usage
- echo.
- echo "Usage: BUILD [debug16 | ndebug16 | debug32 | ndebug32] [borland]"
- echo.
- echo Note that the 'borland' option can not be used with either
- echo the 'debug32' or the 'ndebug32' option.
- echo.
- goto end
-
-
- rem --- Borland-specific error ---
- :err_borland
- echo.
- echo Error: the 'borland' option cannot be used with either the
- echo 'debug32' or the 'ndebug32' option.
- echo.
- goto end
-
-
- rem --- Clear environment variables ---
- :end
- set bcc=
- set typ=
- set ok=
-