home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDGE1_704.DMS / in.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_link_sc6.edge < prev    next >
Encoding:
Text File  |  1993-08-09  |  1.2 KB  |  54 lines

  1. /* Edge Macro: internal to hn_compile
  2. **
  3. ** $VER: hn_link_sc6.edge 1.0 (16-Feb-93 01:21:09)
  4. **
  5. ** Usage:    INTERNAL
  6. **           call hn_link(fullname,outdir,linkoptions)
  7. **
  8. ** Synopsis: Link compiled file
  9. **           SAS/C 6 Version
  10. **
  11. ** Special-strings in linkoptions:
  12. **           $* -> objectfile (same as $@.o)
  13. **           $@ -> output filename (outdir+filename without .ext)
  14. **
  15. ** Default linkoptions: (If not changed by compiler)
  16. **           lib:c.o $* TO $@ LIB LIB:sc.lib LIB:amiga.lib
  17. **
  18. ** Author:   Henrik Nordström
  19. **           Ängsvägen 1
  20. **           S 756 45 Uppsala
  21. */
  22.  
  23. parse arg fullname,outdir,linkoptions
  24.  
  25. options results
  26.  
  27. parse var fullname filename '.' type
  28.  
  29. if linkoptions='' then do
  30.   linkoptions='lib:c.o $* TO $@ LIB LIB:sc.lib LIB:amiga.lib'
  31. end
  32.  
  33. if ~exists(outdir||filename'.o') then do
  34.   say 'File not compiled!'
  35.   return 10
  36. end
  37. s=index(linkoptions,'$*')
  38. do while s>0
  39.   linkoptions=left(linkoptions,s-1)'"'outdir||filename'.o"'substr(linkoptions,s+2)
  40.   s=index(linkoptions,'$*')
  41. end
  42. s=index(linkoptions,'$@')
  43. do while s>0
  44.   linkoptions=left(linkoptions,s-1)'"'outdir||filename'"'substr(linkoptions,s+2)
  45.   s=index(linkoptions,'$@')
  46. end
  47.  
  48. address command 'slink >"echo:t:link_'filename'" 'linkoptions
  49. if RC~=0 then do
  50.   return 10
  51. end
  52.  
  53. return 0
  54.