home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / samples / sam04l / build04d.cm_ / BUILD04D.CMD
Encoding:
Text File  |  1992-04-01  |  5.0 KB  |  95 lines

  1. @echo off
  2. cls
  3. ECHO ***************************************************************************
  4. ECHO * SAMPLE PROGRAM: SAMPLE04 -- Dynamically-linked runtime                  *
  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 calls to and from 16-bit routines.              *
  25. ECHO *                                                                         *
  26. ECHO *  File list:                                                             *
  27. ECHO *                                                                         *
  28. ECHO *   MAIN04.C      - source code for the main routine                      *
  29. ECHO *   SAMP04A.C     - source code for a 16-bit DLL which is loaded at       *
  30. ECHO *                   load time                                             *
  31. ECHO *   SAMP04B.C     - source code for a 16-bit DLL which is loaded at       *
  32. ECHO *                   run time                                              *
  33. ECHO *   SAMPLE04.H    - header file for this sample                           *
  34. ECHO *   MAIN04.DEF    - module definition file for the main routine           *
  35. ECHO *   SAMP04A.DEF   - module definition file for the first 16-bit file      *
  36. ECHO *   SAMP04A.DEF   - module definition file for the second 16-bit file     *
  37. ECHO *   BUILD04.CMD   - command file to build SAMPLE04 statically linked      *
  38. ECHO *   MAKEFILE      - make file which drives the build                      *
  39. ECHO ***************************************************************************
  40. PAUSE
  41. SETLOCAL
  42. ECHO ************************************************************************
  43. ECHO Call CSETENV.CMD to set up the IBM C Set/2 environment
  44. ECHO ************************************************************************
  45. :ENV
  46. IF NOT EXIST ..\..\BIN\CSETENV.CMD GOTO ERROR1
  47. CALL ..\..\BIN\CSETENV.CMD
  48. GOTO CHECK
  49. :ERROR1
  50. ECHO ERROR:  Failed to locate CSETENV.CMD command file
  51. ECHO REMEDY: Verify that CSETENV.CMD is in the \BIN directory and try again
  52. PAUSE
  53. GOTO END
  54. :CHECK
  55. ECHO ************************************************************************
  56. ECHO Check that all required files exist
  57. ECHO ************************************************************************
  58. IF NOT EXIST ..\..\LIB\DDE4SBS.LIB GOTO ERROR2
  59. GOTO BUILD
  60. :ERROR2
  61. ECHO ERROR:  One or more libraries are missing
  62. ECHO REMEDY: Make sure that you have installed the correct libraries
  63. ECHO         and try again
  64. PAUSE
  65. GOTO END
  66. :BUILD
  67. ECHO ************************************************************************
  68. ECHO Build the program
  69. ECHO ************************************************************************
  70. NMAKE "LIBRARY=DYNAMIC"
  71. IF NOT ERRORLEVEL 1 GOTO RUN
  72. ECHO ERROR:  An error occurred when building the sample program
  73. ECHO REMEDY: Examine the error messages generated by the compiler or linker,
  74. ECHO         correct the problem, and try again.
  75. PAUSE
  76. GOTO END
  77. :RUN
  78. ECHO ************************************************************************
  79. ECHO Running MAIN04.EXE
  80. ECHO ************************************************************************
  81. COPY SAMP04A.DLL ..\..\DLL > NUL:
  82. COPY SAMP04B.DLL ..\..\DLL > NUL:
  83. MAIN04
  84. PAUSE
  85. ECHO ************************************************************************
  86. ECHO Clean up files and environment.  Then save the whales.
  87. ECHO ************************************************************************
  88. IF EXIST ..\..\DLL\SAMP04A.DLL ERASE ..\..\DLL\SAMP04A.DLL
  89. IF EXIST ..\..\DLL\SAMP04B.DLL ERASE ..\..\DLL\SAMP04B.DLL
  90. IF EXIST *.EXE ERASE *.EXE
  91. IF EXIST *.OBJ ERASE *.OBJ
  92. IF EXIST *.LIB ERASE *.LIB
  93. :END
  94. endlocal
  95.