home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / Edge1721.DMS / Edge1721.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_link_sc5.edge < prev    next >
Encoding:
Text File  |  1993-11-09  |  1.2 KB  |  53 lines

  1. /* Edge Macro: INTERNAL to hn_compile
  2. **
  3. ** $VER: hn_link_sc5.edge 1.0 (10-Feb-93 22:26:36)
  4. **
  5. ** Usage:    INTERNAL
  6. **           call hn_link(fullname,outdir,linkoptions)
  7. **
  8. ** Synopsis: Link compiled file
  9. **           SAS/C 5 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:AStartup.obj $* TO $@ 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:lc.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.  
  38. do while index(linkoptions,'$*')>0
  39.   parse var linkoptions pre '$*' post
  40.   linkoptions=pre||'"'outdir||filename'.o"'||post
  41. end
  42. do while index(linkoptions,'$@')>0
  43.   parse var linkoptions pre '$@' post
  44.   linkoptions=pre||'"'outdir||filename'"'||post
  45. end
  46.  
  47. address command 'blink >"echo:t:link_'filename'"' linkoptions
  48. if RC~=0 then do
  49.   return 10
  50. end
  51.  
  52. return 0
  53.