home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / samples / sam01l / build01s.cm_ / BUILD01S.CMD
Encoding:
Text File  |  1992-04-01  |  7.5 KB  |  129 lines

  1. @echo OFF
  2. cls
  3. ECHO ***************************************************************************
  4. ECHO * SAMPLE PROGRAM 01: SAMPLE01.C                                           *
  5. ECHO *                                                                         *
  6. ECHO * COPYRIGHT:                                                              *
  7. ECHO * ----------                                                              *
  8. ECHO * Copyright (C) International Business Machines Corp., 1991,1992.         *
  9. ECHO *                                                                         *
  10. ECHO * STATUS: VERSION 1, RELEASE 0, MODIFICATION 0                            *
  11. ECHO *                                                                         *
  12. ECHO * DISCLAIMER OF WARRANTIES:                                               *
  13. ECHO * -------------------------                                               *
  14. ECHO * The following [enclosed] code is sample code created by IBM             *
  15. ECHO * Corporation.  This sample code is not part of any standard IBM product  *
  16. ECHO * and is provided to you solely for the purpose of assisting you in the   *
  17. ECHO * development of your applications.  The code is provided "AS IS",        *
  18. ECHO * without warranty of any kind.  IBM shall not be liable for any damages  *
  19. ECHO * arising out of your use of the sample code, even if they have been      *
  20. ECHO * advised of the possibility of such damages.                             *
  21. ECHO *                                                                         *
  22. ECHO * ----------------------------------------------------------------------- *
  23. ECHO *                                                                         *
  24. ECHO *  Routine to demonstrate a SAA program                                   *
  25. ECHO *                                                                         *
  26. ECHO *  This program conforms to the SAA standard, which means it              *
  27. ECHO *  can be compiled on any SAA platform without modification.              *
  28. ECHO *                                                                         *
  29. ECHO *  File list:                                                             *
  30. ECHO *                                                                         *
  31. ECHO *   SAMPLE01.C    - source code to create the EXE                         *
  32. ECHO *   SAMPLE01.H    - header file for SAMPLE01.C                            *
  33. ECHO *   SAMPLE01.DEF  - module definition file for SAMPLE01.C                 *
  34. ECHO *   BUILD01D.CMD  - command file to link the program dynamically          *
  35. ECHO *   BUILD01S.CMD  - command file to link the program statically           *
  36. ECHO ***************************************************************************
  37. PAUSE
  38. SETLOCAL
  39. ECHO ************************************************************************
  40. ECHO Call CSETENV.CMD to set up the IBM C Set/2 environment
  41. ECHO ************************************************************************
  42. :ENV
  43. IF NOT EXIST ..\..\BIN\CSETENV.CMD GOTO ERROR1
  44. CALL ..\..\BIN\CSETENV.CMD
  45. GOTO CHECK
  46. :ERROR1
  47. ECHO ERROR:  Failed to locate CSETENV.CMD command file
  48. ECHO REMEDY: Verify that CSETENV.CMD is in the \BIN directory and try again
  49. PAUSE
  50. GOTO END
  51. :CHECK
  52. ECHO ************************************************************************
  53. ECHO Check that all required files exist
  54. ECHO ************************************************************************
  55. IF NOT EXIST ..\..\LIB\DDE4SBS.LIB GOTO ERROR2
  56. GOTO EXEC
  57. :ERROR2
  58. ECHO ERROR:  One or more libraries are missing
  59. ECHO REMEDY: Make sure that you have installed the correct libraries
  60. ECHO         and try again
  61. PAUSE
  62. GOTO END
  63. :EXEC
  64. ECHO ***************************************************************************
  65. ECHO * Building program                                                        *
  66. ECHO *                                                                         *
  67. ECHO * icc /c /Gd- /Ge /Gm- /Re /S2 SAMPLE01.C                                 *
  68. ECHO *                                                                         *
  69. ECHO * compiler options:                                                       *
  70. ECHO *                                                                         *
  71. ECHO *   /c    :  perform only compile, no link                                *
  72. ECHO *   /Gd-  :  statically link the run-time library                         *
  73. ECHO *   /Ge   :  build a .EXE file                                            *
  74. ECHO *   /Gm-  :  use single thread library                                    *
  75. ECHO *   /Re   :  the .EXE is compatible with the run-time environment         *
  76. ECHO *   /S2   :  allow only language constructs which conform to the SAA      *
  77. ECHO *            Level 2 standard                                             *
  78. ECHO *                                                                         *
  79. ECHO *                                                                         *
  80. ECHO ***************************************************************************
  81. icc /c /Gd- /Ge /Gm- /Re /S2 SAMPLE01.C
  82. IF NOT ERRORLEVEL 1 GOTO LINK
  83. ECHO ERROR:  Failed to compile SAMPLE01.C
  84. ECHO REMEDY: Make sure that you have installed the correct components,
  85. ECHO         and try again
  86. PAUSE
  87. GOTO END
  88. :LINK
  89. ECHO ***************************************************************************
  90. ECHO * Linking program                                                         *
  91. ECHO *                                                                         *
  92. ECHO * link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBS+OS2386,SAMPLE01.def        *
  93. ECHO *                                                                         *
  94. ECHO * link options:                                                           *
  95. ECHO *                                                                         *
  96. ECHO *   /NOE  - no extra dictionary                                           *
  97. ECHO *   /NOD  - ignore default libraries                                      *
  98. ECHO *   /NOI  - differentiate between cases                                   *
  99. ECHO *    NUL  - do not create mapping file                                    *
  100. ECHO *                                                                         *
  101. ECHO *  LIBRARIES:                                                             *
  102. ECHO *    DDE4SBS  - Statically bound, single thread, standard library         *
  103. ECHO *    OS2386   - OS/2 import library                                       *
  104. ECHO *                                                                         *
  105. ECHO *  SAMPLE01.DEF - module definition file                                  *
  106. ECHO *                                                                         *
  107. ECHO ***************************************************************************
  108. link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBS+os2386,SAMPLE01.def;
  109. IF NOT ERRORLEVEL 1 GOTO RUN
  110. ECHO ERROR:  Failed to create SAMPLE01.EXE
  111. ECHO REMEDY: Make sure that you have installed the correct components,
  112. ECHO         and try again
  113. PAUSE
  114. GOTO END
  115. :RUN
  116. ECHO ************************************************************************
  117. ECHO Running SAMPLE01.EXE
  118. ECHO ************************************************************************
  119. SAMPLE01
  120. PAUSE
  121. ECHO ************************************************************************
  122. REM Clean up files and environment
  123. ECHO ************************************************************************
  124. :CLEANUP
  125. IF EXIST SAMPLE01.EXE ERASE SAMPLE01.EXE
  126. IF EXIST SAMPLE01.OBJ ERASE SAMPLE01.OBJ
  127. :END
  128. ENDLOCAL
  129.