home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 5 / CD_Magazyn_EXEC_nr_5.iso / Programy / MorphOS / morphosdev-150201.lha / emulinclude / splitasm.awk < prev   
Encoding:
AWK Script  |  2001-02-14  |  468 b   |  30 lines

  1. #! /bin/awk -f
  2. #
  3. # splitasm.awk
  4. #
  5. # Copyright (C) 2000 Emmanuel Lesueur <lesueur@club-internet.fr>
  6. # Distributed under terms of GNU General Public License.
  7. #
  8. # This file is part of fd2inline package.
  9. #
  10. # It is used to create linker libraries with stubs for MorphOS.
  11.  
  12. BEGIN {
  13.     dir=dest
  14. }
  15.  
  16. /^[\t ].globl/ {
  17.     currfn=dir "/" $2 ".s"
  18.     print "\t.section\t\".text\"\n\t.align\t2\n" >currfn
  19. }
  20.  
  21. currfn!="" {
  22.     print $0 >currfn
  23. }
  24.  
  25. /^[\t ].size/ {
  26.     close(currfn)
  27.     currfn=""
  28. }
  29.  
  30.