home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / samples / sam05l / build05d.cm_ / BUILD05D.CMD
Encoding:
Text File  |  1992-04-01  |  6.8 KB  |  123 lines

  1. @echo off
  2. cls
  3. ECHO ***************************************************************************
  4. ECHO * SAMPLE PROGRAM: SAMPLE05 - dynamically linked                           *
  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 global DLL using shared memory.               *
  25. ECHO *                                                                         *
  26. ECHO *  File list:                                                             *
  27. ECHO *                                                                         *
  28. ECHO *   SAMPLE05.C    - source code to create the DLL                         *
  29. ECHO *   SAMPLE05.H    - header file for this sample                           *
  30. ECHO *   SAMPLE05.DEF  - module definition file for the DLL                    *
  31. ECHO *   MAIN05.C      - source code to create the EXE                         *
  32. ECHO *   MAIN05.DEF    - module definition file for the EXE                    *
  33. ECHO *   BUILD05D.CMD  - command file to build SAMPLE05 dynamically linked     *
  34. ECHO ***************************************************************************
  35. PAUSE
  36. SETLOCAL
  37. ECHO ************************************************************************
  38. ECHO Call CSETENV.CMD to set up the IBM C Set/2 environment
  39. ECHO ************************************************************************
  40. :ENV
  41. IF NOT EXIST ..\..\BIN\CSETENV.CMD GOTO ERROR1
  42. CALL ..\..\BIN\CSETENV.CMD
  43. GOTO CHECK
  44. :ERROR1
  45. ECHO ERROR:  Failed to locate CSETENV.CMD command file
  46. ECHO REMEDY: Verify that CSETENV.CMD is in the \BIN directory and try again
  47. PAUSE
  48. GOTO END
  49. :CHECK
  50. ECHO ************************************************************************
  51. ECHO Check that all required files exist
  52. ECHO ************************************************************************
  53. IF NOT EXIST ..\..\LIB\DDE4NBSI.LIB GOTO ERROR2
  54. IF NOT EXIST ..\..\LIB\DDE4SBSI.LIB GOTO ERROR2
  55. IF NOT EXIST ..\..\DLL\DDE4NBS.DLL GOTO ERROR2
  56. IF NOT EXIST ..\..\DLL\DDE4SBS.DLL GOTO ERROR2
  57. GOTO BUILDDLL
  58. :ERROR2
  59. ECHO ERROR:  One or more libraries or DLLs are missing
  60. ECHO REMEDY: Make sure that you have installed the correct libraries
  61. ECHO         and DLLs.  Then try again.
  62. PAUSE
  63. GOTO END
  64. :BUILDDLL
  65. ECHO ***************************************************************************
  66. ECHO * Building DLL                                                            *
  67. ECHO *                                                                         *
  68. ECHO * icc /Rn /O+ /Ge- /Gd+ SAMPLE05.C SAMPLE05.DEF                           *
  69. ECHO *                                                                         *
  70. ECHO * compiler options:                                                       *
  71. ECHO *                                                                         *
  72. ECHO *   /Rn   :  use the subsystems development library                       *
  73. ECHO *   /O+   :  generate optimized code                                      *
  74. ECHO *   /Ge-  :  build a .DLL file                                            *
  75. ECHO *   /Gd+  :  dynamically link the C runtime functions                     *
  76. ECHO *                                                                         *
  77. ECHO ***************************************************************************
  78. icc /Rn /O+ /Ge- /Gd+ SAMPLE05.C SAMPLE05.DEF
  79. IF NOT ERRORLEVEL 1 GOTO BUILDEXE
  80. ECHO ERROR:  Failed to compile and/or link SAMPLE05.C
  81. ECHO REMEDY: Make sure that you have installed the correct components
  82. ECHO         and try again
  83. PAUSE
  84. GOTO END
  85. :BUILDEXE
  86. ECHO ***************************************************************************
  87. ECHO * Building EXE                                                            *
  88. ECHO *                                                                         *
  89. ECHO * icc /O+ /Gd+ /B"/BASE:0x10000" MAIN05.C MAIN05.DEF                      *
  90. ECHO *                                                                         *
  91. ECHO * compiler options:                                                       *
  92. ECHO *                                                                         *
  93. ECHO *   /O+   :  generate optimized code                                      *
  94. ECHO *   /Gd+  :  dynamically link the C runtime functions                     *
  95. ECHO *   /B    :  pass options to linker                                       *
  96. ECHO *                                                                         *
  97. ECHO ***************************************************************************
  98. icc /O+ /Gd+ MAIN05.C MAIN05.DEF
  99. IF NOT ERRORLEVEL 1 GOTO RUN
  100. ECHO ERROR:  Failed to compile and/or link MAIN05.C
  101. ECHO REMEDY: Make sure that you have installed the correct components
  102. ECHO         and try again
  103. PAUSE
  104. GOTO END
  105. :RUN
  106. COPY SAMPLE05.DLL ..\..\DLL > NUL:
  107. ECHO ************************************************************************
  108. ECHO Running MAIN05.EXE
  109. ECHO ************************************************************************
  110. MAIN05
  111. PAUSE
  112. ECHO ************************************************************************
  113. REM Clean up files and environment
  114. ECHO ************************************************************************
  115. :CLEANUP
  116. IF EXIST ..\..\DLL\SAMPLE05.DLL ERASE ..\..\DLL\SAMPLE05.DLL
  117. IF EXIST SAMPLE05.DLL ERASE SAMPLE05.DLL
  118. IF EXIST SAMPLE05.OBJ ERASE SAMPLE05.OBJ
  119. IF EXIST MAIN05.EXE ERASE MAIN05.EXE
  120. IF EXIST MAIN05.OBJ ERASE MAIN05.OBJ
  121. :END
  122. endlocal
  123.