home *** CD-ROM | disk | FTP | other *** search
- @echo OFF
- cls
- ECHO ***************************************************************************
- ECHO * SAMPLE PROGRAM 01: SAMPLE01.C *
- ECHO * *
- ECHO * COPYRIGHT: *
- ECHO * ---------- *
- ECHO * Copyright (C) International Business Machines Corp., 1991,1992. *
- ECHO * *
- ECHO * STATUS: VERSION 1, RELEASE 0, MODIFICATION 0 *
- ECHO * *
- ECHO * DISCLAIMER OF WARRANTIES: *
- ECHO * ------------------------- *
- ECHO * The following [enclosed] code is sample code created by IBM *
- ECHO * Corporation. This sample code is not part of any standard IBM product *
- ECHO * and is provided to you solely for the purpose of assisting you in the *
- ECHO * development of your applications. The code is provided "AS IS", *
- ECHO * without warranty of any kind. IBM shall not be liable for any damages *
- ECHO * arising out of your use of the sample code, even if they have been *
- ECHO * advised of the possibility of such damages. *
- ECHO * *
- ECHO * ----------------------------------------------------------------------- *
- ECHO * *
- ECHO * Routine to demonstrate a SAA program *
- ECHO * *
- ECHO * This program conforms to the SAA standard, which means it *
- ECHO * can be compiled on any SAA platform without modification. *
- ECHO * *
- ECHO * File list: *
- ECHO * *
- ECHO * SAMPLE01.C - source code to create the EXE *
- ECHO * SAMPLE01.H - header file for SAMPLE01.C *
- ECHO * SAMPLE01.DEF - module definition file for SAMPLE01.C *
- ECHO * BUILD01D.CMD - command file to link the program dynamically *
- ECHO * BUILD01S.CMD - command file to link the program statically *
- ECHO ***************************************************************************
- PAUSE
- SETLOCAL
- ECHO ************************************************************************
- ECHO Call CSETENV.CMD to set up the IBM C Set/2 environment
- ECHO ************************************************************************
- :ENV
- IF NOT EXIST ..\..\BIN\CSETENV.CMD GOTO ERROR1
- CALL ..\..\BIN\CSETENV.CMD
- GOTO CHECK
- :ERROR1
- ECHO ERROR: Failed to locate CSETENV.CMD command file
- ECHO REMEDY: Verify that CSETENV.CMD is in the \BIN directory and try again
- PAUSE
- GOTO END
- :CHECK
- ECHO ************************************************************************
- ECHO Check that all required files exist
- ECHO ************************************************************************
- IF NOT EXIST ..\..\LIB\DDE4SBSI.LIB GOTO ERROR2
- GOTO EXEC
- :ERROR2
- ECHO ERROR: One or more libraries are missing
- ECHO REMEDY: Make sure that you have installed the correct libraries
- ECHO and try again
- PAUSE
- GOTO END
- :EXEC
- ECHO **************************************************************************
- ECHO * Building program *
- ECHO * *
- ECHO * icc /c /Gd+ /Ge /Gm- /Re /S2 SAMPLE01.C *
- ECHO * *
- ECHO * compiler options: *
- ECHO * *
- ECHO * /c : perform compile only, no link *
- ECHO * /Gd+ : dynamically link the run-time library *
- ECHO * /Ge : build a .EXE file *
- ECHO * /Gm- : use single thread library *
- ECHO * /Re : the .EXE is compatible with the run-time environment *
- ECHO * /S2 : allow only language constructs which conform to the SAA *
- ECHO * Level 2 standard *
- ECHO * *
- ECHO **************************************************************************
- icc /c /Gd+ /Ge /Gm- /Re /S2 SAMPLE01.C
- IF NOT ERRORLEVEL 1 GOTO LINK
- ECHO ERROR: Failed to compile SAMPLE01.C
- ECHO REMEDY: Make sure that you have installed the correct components,
- ECHO and try again
- PAUSE
- GOTO END
- :LINK
- ECHO ***************************************************************************
- ECHO * Linking program *
- ECHO * *
- ECHO * link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBSI+OS2386,SAMPLE01.def *
- ECHO * *
- ECHO * link options: *
- ECHO * *
- ECHO * /NOE - no extra dictionary *
- ECHO * /NOD - ignore default libraries *
- ECHO * /NOI - differentiate between cases *
- ECHO * NUL - do not create mapping file *
- ECHO * *
- ECHO * LIBRARIES: *
- ECHO * DDE4SBSI - Dynamically bound, single thread, standard import library *
- ECHO * OS2386 - OS/2 import library *
- ECHO * *
- ECHO * SAMPLE01.DEF - module definition file *
- ECHO * *
- ECHO ***************************************************************************
- link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBSI+OS2386,SAMPLE01.def;
- IF NOT ERRORLEVEL 1 GOTO RUN
- ECHO ERROR: Failed to create SAMPLE01.EXE
- ECHO REMEDY: Make sure that you have installed the correct components,
- ECHO and try again
- PAUSE
- GOTO END
- :RUN
- ECHO ************************************************************************
- ECHO Running SAMPLE01.EXE
- ECHO ************************************************************************
- SAMPLE01
- PAUSE
- ECHO ************************************************************************
- ECHO Clean up files and environment
- ECHO ************************************************************************
- :CLEANUP
- IF EXIST SAMPLE01.EXE ERASE SAMPLE01.EXE
- IF EXIST SAMPLE01.OBJ ERASE SAMPLE01.OBJ
- :END
- ENDLOCAL