home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume1 / xref / READ_ME < prev    next >
Encoding:
Text File  |  1986-11-30  |  1.8 KB  |  39 lines

  1. In the last few months there have been requests on USENET for a cross
  2. referencing program.  Standard UNIX usage is, one supposes, to use
  3. egrep on a case by case basis for this purpose.  However, I cobbled up
  4. such a program as an example using of using make, lex and awk for a
  5. short UNIX tutorial.  It has had only minimal testing and is not
  6. especially efficient;  caveat emptor!
  7.  
  8. This package makes three files:
  9.     xref - a shell script which cross references files
  10.     xreflex - a lex(1) program used by xref
  11.     xref.1 - a manual entry for xref
  12.  
  13. It was developed on a 4.2BSD system, and assumes that make, lex, cc, 
  14. sh, ed, fgrep, sort, and awk are available under /bin or
  15. /usr/{bin,ucb,local}.  It should run with at worst minimal changes
  16. under any other flavor of UNIX.  If fgrep, sort, and awk are somewhere
  17. else be sure to change the PATH in xrefhead.sh.
  18.  
  19. The idea is to cross reference files by "xref file1 ... >listing".
  20. A pipeline of the form "lex program | fgrep | sort | awk" extracts
  21. words and their locations, discards extraneous ones, sorts the rest,
  22. and merges the resulting name,file,line triples into a fairly standard
  23. cross reference map.
  24.  
  25. Various make targets are available:
  26.     make all        # makes xref & xreflex for /usr/local
  27.     make DESTDIR=somewhere all    # ... for somewhere instead.
  28.     make piecetest    # produce intermediate *_out files.
  29.     make DESTDIR=somewhere MANLOC=elsewhere install
  30.             # install xref, xreflex, xref.1
  31.     make clean        # remove computed files
  32.  
  33. xref is produced by minor editing from xrefhead.sh and mergelines.awk.
  34. xref.1 is produced by minor editing from xref.man.
  35. xreflex is produced by lex and cc from xref.l.
  36.  
  37. -- Jim Leinweber  (jiml@uwmacc.UUCP, leinwebe@wisc-ai.ARPA)
  38. Madison Academic Computing Center, 1210 W. Dayton ST., Madison Wi 53706
  39.