mc.exec 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* MAKECPIP EXEC Make program to build a C/370 module */
  2. /* Author: George Petrov, 29 Sep 1994 */
  3. arg fn . '(' cparms /* Filter name */
  4. 'pipe (end ?) < 'fn' makefile', /* get all source files from */
  5. '| frlab GLOBALS:'||,
  6. '| drop',
  7. '| strip',
  8. '| var globals'
  9. cparms = cparms globals
  10. say ''
  11. say 'Compile options : 'cparms
  12. say ''
  13. if pos('REB',cparms) > 0 then do
  14. parse var cparms cp1 'REB' . ' ' cp2 /* REBuild options specified ? */
  15. cparms = cp1||cp2
  16. pipe1=,
  17. 'pipe (end ?) < 'fn' makefile', /* get all source files from */
  18. '| nfind *'||, /* the makefile and compile */
  19. '| frlab TEXT:'||, /* only the those who are */
  20. '| r: tolab MODULE:'||, /* changed or never compiled */
  21. '| drop',
  22. '| o: fanout',
  23. '| chop before str /(/',
  24. '| statew',
  25. '| c: fanout', /* compiled */
  26. '| specs /Compiling / 1 w1-3 n / .../ n',
  27. '| cons'
  28. end
  29. else do
  30. pipe1=,
  31. 'pipe (end ?) < 'fn' makefile', /* get all source files from */
  32. '| nfind *'||, /* the makefile and compile */
  33. '| frlab TEXT:'||, /* only the those who are */
  34. '| r: tolab MODULE:'||, /* changed or never compiled */
  35. '| drop',
  36. '| o: fanout',
  37. '| specs w1 1 /C/ nw w3 nw write w1 1 /TEXT A/ nw',
  38. '| chop before str /(/',
  39. '| statew',
  40. '| change (57 66) / /0/',
  41. '| sort 1.8 d', /* sort the date and time */
  42. '| uniq 1-17 singles', /* if the first is a source */
  43. '| sort 1.8 d 64.2 d 57.2 d 60.2 d 66.8 d', /* sort the date */
  44. '| uniq 1-8 first', /* if the first is a source */
  45. '| locate 9.8 /C /', /* program then it has to be */
  46. '| c: fanout', /* compiled */
  47. '| specs /Compiling / 1 w1-3 n / .../ n',
  48. '| cons'
  49. end
  50. pipe2= '?',
  51. 'r:',
  52. '| drop',
  53. '| specs w1 1', /* save the module name in var */
  54. '| var module',
  55. '?',
  56. 'o:',
  57. '| specs w1 1',
  58. '| join * / /',
  59. '| var texts', /* save all the text file names */
  60. '?', /* for later include */
  61. 'c:',
  62. '| specs /CC / 1 w1-3 n /(NOTERM 'cparms'/ nw', /* compile! */
  63. '| err: cms | cons',
  64. '?',
  65. 'err:',
  66. '| strip both',
  67. '| nfind 0'||,
  68. '| var err',
  69. '| specs /----> Errors found! RC=/ 1 1-* n',
  70. '| cons'
  71. /* '| g: gate'*/
  72. pipe1 pipe2
  73. say ''
  74. if symbol('err') = 'VAR' & err ^= 0 then do
  75. say 'Errors found in source files - link aborted! RC = 'err
  76. exit err
  77. end
  78. say 'Generating module 'module
  79. 'pipe cms cmod' fn texts' DMSCSL | > 'fn' LINK A'
  80. 'set cmstype ht'
  81. 'state 'fn' LINK A'
  82. rcc = rc
  83. 'set cmstype rt'
  84. if rcc = 0 then do
  85. say ''
  86. say 'ERRORS discovered during linking!'
  87. say 'See: 'fn' LINK A for more info'
  88. end
  89. exit rc
  90. error:
  91. say 'Error in REXX detected!'
  92. Say 'Syntax error on line' Sigl':' Sourceline(Sigl)
  93. Say 'Error was:' Errortext(RC)
  94. return rc