home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / samples / sam01l / build01d.cm_ / BUILD01D.CMD
Encoding:
Text File  |  1992-04-01  |  7.4 KB  |  128 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\DDE4SBSI.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 compile only, no link                               *
  72. ECHO *   /Gd+  :  dynamically 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. icc /c /Gd+ /Ge /Gm- /Re /S2 SAMPLE01.C
  81. IF NOT ERRORLEVEL 1 GOTO LINK
  82. ECHO ERROR:  Failed to compile SAMPLE01.C
  83. ECHO REMEDY: Make sure that you have installed the correct components,
  84. ECHO         and try again
  85. PAUSE
  86. GOTO END
  87. :LINK
  88. ECHO ***************************************************************************
  89. ECHO * Linking program                                                         *
  90. ECHO *                                                                         *
  91. ECHO * link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBSI+OS2386,SAMPLE01.def       *
  92. ECHO *                                                                         *
  93. ECHO * link options:                                                           *
  94. ECHO *                                                                         *
  95. ECHO *   /NOE  - no extra dictionary                                           *
  96. ECHO *   /NOD  - ignore default libraries                                      *
  97. ECHO *   /NOI  - differentiate between cases                                   *
  98. ECHO *    NUL  - do not create mapping file                                    *
  99. ECHO *                                                                         *
  100. ECHO *  LIBRARIES:                                                             *
  101. ECHO *    DDE4SBSI - Dynamically bound, single thread, standard import library *
  102. ECHO *    OS2386   - OS/2 import library                                       *
  103. ECHO *                                                                         *
  104. ECHO *  SAMPLE01.DEF - module definition file                                  *
  105. ECHO *                                                                         *
  106. ECHO ***************************************************************************
  107. link386 /NOE /NOD /NOI SAMPLE01,,NUL,DDE4SBSI+OS2386,SAMPLE01.def;
  108. IF NOT ERRORLEVEL 1 GOTO RUN
  109. ECHO ERROR:  Failed to create SAMPLE01.EXE
  110. ECHO REMEDY: Make sure that you have installed the correct components,
  111. ECHO         and try again
  112. PAUSE
  113. GOTO END
  114. :RUN
  115. ECHO ************************************************************************
  116. ECHO Running SAMPLE01.EXE
  117. ECHO ************************************************************************
  118. SAMPLE01
  119. PAUSE
  120. ECHO ************************************************************************
  121. ECHO Clean up files and environment
  122. ECHO ************************************************************************
  123. :CLEANUP
  124. IF EXIST SAMPLE01.EXE ERASE SAMPLE01.EXE
  125. IF EXIST SAMPLE01.OBJ ERASE SAMPLE01.OBJ
  126. :END
  127. ENDLOCAL
  128.