home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 1.ddi / BIN / MAKESAMP.BAT < prev    next >
Encoding:
DOS Batch File  |  1992-07-27  |  6.1 KB  |  165 lines

  1. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. :: MAKESAMP.BAT  Script for building AutoCAD ADS example programs.        ::
  3. ::                                                                        ::
  4. :: Run without arguments to compile all examples; or, provide the name of ::
  5. :: an example (without file extension) on the command line.  If you       ::
  6. :: specify an example, you must run this script from the directory where  ::
  7. :: the example program resides.  See README.ADS for more information.     ::
  8. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9. @echo off
  10. echo --------------------------------------------------------------------
  11. echo         Copyright (C) 1992 by Autodesk Inc. / MetaWare Inc.
  12. echo Permission to use, copy, modify, and distribute this software and its
  13. echo documentation for any purpose and without fee is hereby granted.
  14. echo THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
  15. echo ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
  16. echo MERCHANTABILITY ARE HEREBY DISCLAIMED.
  17. echo --------------------------------------------------------------------
  18. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  19. :: To build an ADS application you need the following:
  20. :: * the application's source code (for example, GRAVITY.C)
  21. :: * the ADS library (ADS.LIB or MWADS.LIB)
  22. :: * the High C libraries.
  23. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  24.  
  25. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  26. :: Set next line to the full pathname of AutoCAD directory; e.g.        ::
  27. ::    set ACADPATH=c:\ACAD11                                            ::
  28. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  29. :: set ADSPATH=c:\acad11
  30.  
  31. if "%ADSPATH%" == "" goto noadspath
  32.  
  33. @echo MAKESAMP: building sample AutoCAD ADS programs.
  34.  
  35. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  36. :: The following line sets ADS_COMP for AutoCAD R12, R11 or earlier.
  37. :: If you are using a later release, comment out this line (see README.ADS).
  38. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  39.  
  40. set ADS_COMP=-Hads -Hloclib -L%ADSPATH%\ads -I%ADSPATH%\ads -lads 
  41.  
  42. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  43. :: FOR FUTURE RELEASES OF AutoCAD R12 (preferred if you have the MWADS 
  44. :: library) you must comment out the above line and uncomment the 
  45. :: following line.
  46. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  47.  
  48. :: set ADS_COMP=-Hads -L%ADSPATH%\ads -I%ADSPATH%\ads -lmwads
  49.  
  50. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  51. :: Check to see that ADS_COMP has been set.
  52. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  53.  
  54. if not "%ADS_COMP%x" == "x" goto OK
  55. echo Please set ADS_COMP inside of batch file
  56. goto done
  57.  
  58. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  59. :: Create the sample(s).
  60. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  61.  
  62. :OK
  63. @echo Creating sample.pro ...
  64. echo #define PROTOTYPES 1                      > sample.pro
  65. echo #define HIGHC 1                          >> sample.pro
  66. echo pragma On (Prototype_conversion_warn);   >> sample.pro
  67. echo pragma Off(Prototype_override_warnings); >> sample.pro
  68. echo pragma On (Read_only_strings);           >> sample.pro
  69. echo pragma On (Push_regsize);                >> sample.pro
  70. echo pragma Off(Align_members);               >> sample.pro
  71.  
  72. if "%1x"=="x" goto COMP_ALL
  73.  
  74. if exist %1.c   goto COMP_C
  75. if exist %1.cpp goto COMP_CPP
  76. echo Neither %1.c nor %1.cpp exists in this directory.
  77. goto done
  78.  
  79. :COMP_CPP
  80. @echo Compiling %1.cpp
  81.  
  82. hc386 %ADS_COMP% -f287 %1.cpp -Hpro=sample.pro
  83. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  84. :: For debugging: comment out the above line, and uncomment this line:
  85. :: hc386 -g %ADS_COMP% -f287 %1.cpp -Hkeep -Hpro=sample.pro
  86. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  87. goto done
  88.  
  89. :COMP_C
  90. @echo Compiling %1.c
  91.  
  92. hc386 %ADS_COMP% -f287 %1.c -Hpro=sample.pro
  93. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  94. :: For debugging: comment out the above line, and uncomment this line:
  95. :: hc386 -g %ADS_COMP% -f287 %1.c -Hkeep -Hpro=sample.pro
  96. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  97. goto done
  98.  
  99. :COMP_ALL
  100. @echo Compiling ads_perr.c
  101.   hc386 ads_perr.c %ADS_COMP% -f287 -Hpro=sample.pro
  102.  
  103. @echo Compiling arbmat.c
  104.   hc386 arbmat.c %ADS_COMP% -f287 -Hpro=sample.pro
  105.  
  106. @echo Compiling colext.c
  107.   hc386 colext.c   %ADS_COMP% -f287 -Hpro=sample.pro
  108.  
  109. @echo Compiling fact.c
  110.   hc386 fact.c  %ADS_COMP% -f287 -Hpro=sample.pro
  111.  
  112. @echo Compiling gravity.c
  113.   hc386 gravity.c %ADS_COMP% -f287 -Hpro=sample.pro
  114.  
  115. @echo Compiling magnets.c
  116.   hc386 magnets.c %ADS_COMP% -f287 -Hpro=sample.pro
  117.  
  118. @echo Compiling mountain.c
  119.   hc386 mountain.c %ADS_COMP% -f287 -Hpro=sample.pro
  120.  
  121. @echo Compiling ptext.c
  122.   hc386 ptext.c  %ADS_COMP% -f287 -Hpro=sample.pro
  123.  
  124. @echo Compiling sld2ps.c
  125.   hc386 sld2ps.c %ADS_COMP% -f287 -Hpro=sample.pro
  126.  
  127. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  128. :: Check if extra future-release examples are present.
  129. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  130. if not exist adset.c goto done
  131.  
  132. @echo Compiling adset.c
  133.   hc386 adset.c %ADS_COMP% -lads.lib -Hpro=sample.pro
  134.  
  135. @echo Compiling dlgtest.c
  136.   hc386 dlgtest.c %ADS_COMP% -lads.lib -Hpro=sample.pro
  137.  
  138. @echo Compiling sqr.c
  139.   hc386 sqr.c %ADS_COMP% -lads.lib -Hpro=sample.pro
  140.  
  141. @echo Compiling tadc.c
  142.   hc386 tadc.c %ADS_COMP% -lads.lib -Hpro=sample.pro
  143.  
  144. @echo Compiling tower.c
  145.   hc386 tower.c %ADS_COMP% -lads.lib -Hpro=sample.pro
  146.  
  147. if not exist sum.cpp goto done
  148. @echo Compiling sum.cpp
  149. hc386 %ADS_COMP% -f287 sum.cpp -Hpro=sample.pro
  150. goto done
  151.  
  152. :noadspath
  153. @echo please set ADSPATH to point to acad directory
  154. goto end
  155.  
  156. :done
  157. set ADS_COMP=
  158. set ADSPATH=
  159. @echo MAKESAMP completed.
  160. @echo on
  161.  
  162. :end
  163.  
  164.  
  165.