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] [thread | nothread]"
- rem
- rem =======================================================================
- rem
-
-
- rem --- Check for environment space ---
- set typ=d16
- set ok=N
-
- if NOT "%ok%" == "N" goto err_env
-
- set THREAD=NO
- if "%2" == "thread" set THREAD=YES
-
- rem --- Parse arguments ---
- :parse
- if "%1" == "" goto check
- 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
- goto doit
-
-
- 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 --- 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] [thread | nothread]"
- echo.
- goto end
-
-
- rem --- Clear environment variables ---
- :end
- set typ=
- set ok=
-