commacs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ?section CC ROUTINE
  2. #FRAME
  3. [#PUSH file stem src obj htime file prev time stime otime
  4. comp out options sup buf col locn group
  5. ]
  6. [#IF [#ARGUMENT /VALUE file/ WORD /SPACE/ END]]
  7. [#IF [#EMPTYV file] |THEN|
  8. #OUTPUT Syntax: CC <file> <collector> <comp-options>
  9. #RESET FRAMES
  10. #RETURN
  11. ]
  12. [#IF NOT [#FILEINFO /EXISTENCE/ [file]]
  13. |THEN|
  14. #OUTPUT [file] does not exist !
  15. #RESET FRAMES
  16. #RETURN
  17. ]
  18. #PUSH #DEFAULTS vol subvol
  19. #SETMANY vol subvol src, [#FILEINFO /VOLUME, SUBVOL, FILE/ [file]]
  20. VOLUME [vol].[subvol]
  21. #SETV stem file
  22. #CHARDEL stem [#CHARCOUNT stem]
  23. #SET obj [stem]O
  24. #SETV stem src
  25. #CHARDEL stem [#CHARCOUNT stem]
  26. [#IF [#ARGUMENT /VALUE out/ DEVICE END]]
  27. [#IF [#EMPTYV out] |THEN| #SET out $T.#C]
  28. #SETMANY col group, [#FILEINFO /VOLUME, SUBVOL/ [out]]
  29. #SET locn [group].[stem]
  30. #SET sup [#LOOKUPPROCESS /ANCESTOR/ [col]]
  31. #SET options [#REST]
  32. == Find newest Header file
  33. #SET htime 0
  34. #SET file [#FILENAMES /MAXIMUM 1/ *H]
  35. [#LOOP |WHILE| NOT [#EMPTYV file]
  36. |DO|
  37. #SET time [#FILEINFO /MODIFICATION/ [file]]
  38. [#IF time > htime |THEN| #SETV htime time]
  39. #SETV prev file
  40. #SET file [#FILENAMES /MAXIMUM 1, PREVIOUS [prev]/ *H]
  41. ]
  42. #SET stime [#FILEINFO /MODIFICATION/ [src]]
  43. #SET otime [#FILEINFO /MODIFICATION/ [obj]]
  44. #SET comp 0
  45. [#IF otime < htime
  46. |THEN|
  47. #OUTPUT Header file(s) changed since object [obj] compiled
  48. #SET comp -1
  49. ]
  50. [#IF otime < stime
  51. |THEN|
  52. #OUTPUT Source file [src] changed since object [obj] compiled
  53. #SET comp -1
  54. ]
  55. [#IF comp
  56. |THEN|
  57. SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS,DELETE !
  58. #SET buf
  59. #OUTPUT Compiling [src]... [options]
  60. C /IN [src], OUT [out].[stem]/[obj];SYMBOLS,HIGHPIN [options]
  61. [#CASE [tacl^completioncode]
  62. | 0 |
  63. #OUTPUT Compiled OK: [src]
  64. SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS,DELETE !
  65. #SET _completion:completioncode 0
  66. | 1 |
  67. #OUTPUT [src]: Compile Warnings
  68. SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS
  69. #OUTPUTV buf
  70. |OTHERWISE|
  71. #OUTPUT [src]: Compile FAILED !
  72. SPOOLCOM /OUTV buf/ OPEN [sup];JOB (OWNER, LOC [locn]),STATUS
  73. #OUTPUTV buf
  74. ]
  75. |ELSE|
  76. #OUTPUT Object file [obj] is up to date
  77. #SET _completion:completioncode 0
  78. ]
  79. #UNFRAME