home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3585 < prev    next >
Text File  |  1991-07-02  |  20KB  |  639 lines

  1. Newsgroups: alt.sources
  2. From: goer@ellis.uchicago.edu (Richard L. Goerwitz)
  3. Subject: kjv browser, part 9 of 11
  4. Message-ID: <1991Jul3.065253.28409@midway.uchicago.edu>
  5. Date: Wed, 3 Jul 1991 06:52:53 GMT
  6.  
  7. ---- Cut Here and feed the following to sh ----
  8. #!/bin/sh
  9. # this is bibleref.09 (part 9 of a multipart archive)
  10. # do not concatenate these parts, unpack them in order with /bin/sh
  11. # file makeind.icn continued
  12. #
  13. if test ! -r _shar_seq_.tmp; then
  14.     echo 'Please unpack part 1 first!'
  15.     exit 1
  16. fi
  17. (read Scheck
  18.  if test "$Scheck" != 9; then
  19.     echo Please unpack part "$Scheck" next!
  20.     exit 1
  21.  else
  22.     exit 0
  23.  fi
  24. ) < _shar_seq_.tmp || exit 1
  25. if test ! -f _shar_wnt_.tmp; then
  26.     echo 'x - still skipping makeind.icn'
  27. else
  28. echo 'x - continuing file makeind.icn'
  29. sed 's/^X//' << 'SHAR_EOF' >> 'makeind.icn' &&
  30. X    # (keys are option letters).
  31. X    #
  32. X    usage:= "usage: makeind -f filename -m int -n int [-l int] [-s]"
  33. X    opt_table := initialize_IS(a)
  34. X    fname := \opt_table["f"]                | stop(usage)
  35. X    rollover_field := opt_table["l"]            # (optional)
  36. X
  37. X    #
  38. X    # Begin the process of tokenizing, recording token locations, and
  39. X    # of storing this information in two separate files.
  40. X    #
  41. X    # Read input file, making a table of words and their locations.
  42. X    index_table  := create_index(fname)
  43. X
  44. X    #
  45. X    # Write keys to one file, with pointers into another file
  46. X    # containing the bitmaps for each key.
  47. X    #
  48. X    index_fname  := dir_name(fname)||create_fname(fname, "IND")
  49. X    bitmap_fname := dir_name(fname)||create_fname(fname, "BMP")
  50. X    write_tokens_and_offsets(index_fname, bitmap_fname, index_table)
  51. X
  52. X    #
  53. X    # Re-open fname and store the locations for each chunk of text
  54. X    # marked by a ::location marker.  This could certainly be
  55. X    # incorporated into the indexing routines, but only at the great
  56. X    # expense of clarity.
  57. X    #
  58. X    upto_field := 1 < (IS.no * 2) / 3 | 1
  59. X    bofname := dir_name(fname)||create_fname(fname, "OFS")
  60. X    bitmap_offset_table := 
  61. X    store_bitmaps_and_offsets(fname, upto_field)
  62. X    # store in .OFS file
  63. X    write_bitmaps_and_offsets(bofname, bitmap_offset_table, upto_field)
  64. X
  65. X    #
  66. X    # Re-open fname again, and store the pre-rollover bitmaps in the
  67. X    # .LIM file.  Obviously this procedure could be stuffed into
  68. X    # another one above (e.g. store_bitmaps_and_offsets()).
  69. X    #
  70. X    if \rollover_field then {
  71. X    #
  72. X    # Let's say we are using the Bible as our text, and we want to
  73. X    # create all the bitmaps for Genesis 1:9-2:10.  We need to know
  74. X    # what verse chapter 1 goes up to.  By supplying makeind
  75. X    # with a "-l 3" argument, you are telling it to store this in-
  76. X    # formation for later use by expandrf().
  77. X    #
  78. X    limits_fname := dir_name(fname)||create_fname(fname, "LIM")
  79. X    write_limits(limits_fname, fname, rollover_field)
  80. X    IS.r_field := rollover_field
  81. X    }
  82. X
  83. X    #
  84. X    # Write IS record to the .IS file.
  85. X    #
  86. X    out_IS := open(dir_name(fname)||create_fname(fname, "IS"), "w") |
  87. X    abort("makeind","can't open .IS file",2)
  88. X    writes(out_IS, encode(IS))
  89. X    close(out_IS)
  90. X
  91. X    # All is well.  Exit with zero status.
  92. X    exit(0)
  93. X
  94. Xend
  95. X
  96. X
  97. X#
  98. X# initialize_IS
  99. X#
  100. X# Sets up main parameters for the current index file, such as the
  101. X# field separator to be used in tokenizing the file, the string and
  102. X# bit lengths of bitmap fields, the number of fields, and the size of
  103. X# the actual bitmaps (in bytes) as written to disk (comes out to the
  104. X# smallest multiple of eight greater than the field length times the
  105. X# field number.  The marker length has to be set in the main
  106. X# procedure, so initialize_IS leaves it null for now.
  107. X#
  108. Xprocedure initialize_IS(a)
  109. X
  110. X    local usage, fname, opt_table
  111. X    # global IS
  112. X
  113. X    usage:="usage: makeind -f filename -m int -n int [-l int] [-s]"
  114. X
  115. X    IS := is()            # set up some IS fields
  116. X    opt_table := options(a, "f:m:n+sS:l+")
  117. X    3 <= *opt_table <= 6            | stop(usage)
  118. X    IS.no := \opt_table["n"]            | stop(usage)
  119. X    IS.FS := \opt_table["S"] | "['.]?[^-0-9A-Za-z']+'?"
  120. X    IS.is_case_sensitive := opt_table["s"]      # normally is &null
  121. X
  122. X    #
  123. X    # Calculate string representation length for fields, as well as
  124. X    # the number of bits required for their integer representation.
  125. X    # I.e. if the opt_table["m"] value is 99, this will take two chars to
  126. X    # represent as a string ("99"), but 7 binary "digits" to represent
  127. X    # internally as a base-two integer.
  128. X    #
  129. X    IS.s_len := *string(opt_table["m"])
  130. X    IS.len := *exbase10(opt_table["m"], 2)
  131. X
  132. X    return opt_table
  133. X
  134. Xend
  135. X
  136. X
  137. X#
  138. X# create_index
  139. X#
  140. X# Creates a table containing all tokens in the file fname, with the
  141. X# set of each token's locations recorded as values for those tokens.
  142. X# IS.FS is a nawk-style field separator regular expression.
  143. X# If &null, defaults to ~(&digits++&letters).  IS.s_len
  144. X# is the location marker string-representation field length.  Index_
  145. X# stats.len is the number of binary digits needed for an
  146. X# integer representation of a given field.  IS.no is
  147. X# the number of fields.
  148. X# 
  149. Xprocedure create_index(fname)
  150. X
  151. X    local intext, wordtbl, line, bitmap, token
  152. X
  153. X    intext := open(fname) |
  154. X    abort("create_index","can't open index file, "||fname, 9)
  155. X    wordtbl := table()
  156. X
  157. X    while line := read(intext) do {
  158. X    line ? {
  159. X        if ="::" then {
  160. X        bitmap := digits_2_bitmap(tab(0)) # in indexutl.icn
  161. X        } else {
  162. X        # gettokens() resides in a separate file, gettokens.icn
  163. X        every token := gettokens(IS.is_case_sensitive) do {
  164. X            /wordtbl[token] := set()
  165. X            insert(wordtbl[token], \bitmap) |
  166. X            abort("create_index","text before location-marker",8)
  167. X        }
  168. X        }
  169. X    }
  170. X    }
  171. X    \line | abort("create_index", "empty input file, "||fname, 8)
  172. X    close(intext)
  173. X    return wordtbl
  174. X
  175. Xend
  176. X
  177. X
  178. X#
  179. X# write_tokens_and_offsets
  180. X#
  181. X# Writes to one file a list of all tokens collected from the input
  182. X# file, one to a line, followed by a tab, and then a byte offset into
  183. X# another file where the bitmaps for that token are kept.
  184. X#
  185. X#     token tab offset
  186. X#
  187. X# A seek to "offset" in the bitmap file will put you at the start of a
  188. X# block of bitmaps.
  189. X#
  190. Xprocedure write_tokens_and_offsets(index_fname, bitmap_fname, t)
  191. X
  192. X    local outtokens, outbitmaps, index_lst, i, bitmap_length, bitmap
  193. X
  194. X    outtokens := open(index_fname, "w") |
  195. X    abort("write_tokens_and_offsets","can't open "||index_fname,6)
  196. X    outbitmaps := open(bitmap_fname, "w") |
  197. X    abort("write_tokens_and_offsets","can't open "||bitmap_fname,5)
  198. X    # Calculate the length of bitmaps (must be the smallest multiple of
  199. X    # 8 >= (IS.len * IS.no)).
  200. X    bitmap_length := ((IS.len * IS.no) <= seq(0,8))
  201. X    index_lst := sort(t, 3)
  202. X
  203. X    every i := 1 to *index_lst-1 by 2 do {
  204. X
  205. X    # Write token to index file with the offset of that token's
  206. X    # bitmaps in the bitmap file.
  207. X    write(outtokens, index_lst[i], "\t", where(outbitmaps))
  208. X
  209. X    # Now write the bitmaps for the above token to the bitmap file.
  210. X    # First write out the number of bitmaps in this block.  Two bytes
  211. X    # are allotted to hold this count (16 bits).
  212. X    if *index_lst[i+1] > 65535 then {        # just in case
  213. X        abort("write_tokens_and_offsets",
  214. X          "too many bitmaps for"||index_lst[i], 16)
  215. X    }
  216. X    write_int(outbitmaps, *index_lst[i+1], 16)
  217. X    # Having written the bitmap count, now write the bitmaps proper
  218. X    # to the bitmap file.
  219. X    every write_int(outbitmaps, !index_lst[i+1], bitmap_length)
  220. X    }
  221. X
  222. X    # Close files.  Return number of keys processed (any better ideas??)
  223. X    every close(outtokens | outbitmaps)
  224. X    return *index_lst / 2    # return number of keys in index file
  225. X
  226. Xend
  227. X
  228. X
  229. X
  230. X#
  231. X# store_bitmaps_and_offsets
  232. X#
  233. X# Runs through the file called fname, finding all the location
  234. X# markers, and recording the offset of the text they precede.  Writes
  235. X# bitmap : offset pairs to a .ofs file.  Note that the full bitmap is
  236. X# not stored.  Rather only the first upto_field fields are stored.
  237. X# Normally upto_field = IS.no - 1.
  238. X#
  239. Xprocedure store_bitmaps_and_offsets(fname, upto_field)
  240. X
  241. X    local intext, current_location, last_major_division,
  242. X    major_division, bitmap_offset_table
  243. X
  244. X    intext := open(fname) |
  245. X    abort("store_bitmaps_and_offsets","can't open "||fname,5)
  246. X    bitmap_offset_table := table()
  247. X
  248. X    while (current_location := where(intext), line := read(intext)) do {
  249. X    line ? {
  250. X        if ="::" then {
  251. X        major_division := 
  252. X            ishift(digits_2_bitmap(tab(0)), # in indexutl.icn
  253. X               -((IS.no - upto_field) * IS.len))
  254. X        if \last_major_division = major_division then
  255. X            next
  256. X        else {
  257. X            insert(
  258. X            bitmap_offset_table, major_division, current_location)
  259. X            last_major_division := major_division
  260. X        }        
  261. X        }
  262. X    }
  263. X    }
  264. X    
  265. X    return bitmap_offset_table
  266. X
  267. Xend
  268. X
  269. X
  270. X#
  271. X# write_bitmaps_and_offsets
  272. X#
  273. X# Does the actual writing of bitmaps and offsets to a file.  Receives
  274. X# a table of bitmaps cut down to upto_field fields.  Shinking the
  275. X# bitmaps lessens the size of the resulting file, but requires a bit
  276. X# more I/O when it comes time to look something up.
  277. X#
  278. Xprocedure write_bitmaps_and_offsets(bofname, t, upto_field)
  279. X
  280. X    local outtext, tmp_list, i, offset_length,
  281. X    block_size, stored_bitmap_length
  282. X
  283. X    outtext := open(bofname, "w") |
  284. X    abort("write_bitmaps_and_offsets","can't open "||bofname,5)
  285. X    stored_bitmap_length := ((IS.len * upto_field) <= seq(0,8))
  286. X    tmp_list := sort(t, 3)
  287. X
  288. X    every i := 1 to *tmp_list-1 by 2 do {
  289. X
  290. X    # Number of bits needed to hold offset.
  291. X    offset_length := (*exbase10(tmp_list[i+1], 2) <= seq(0,8))
  292. X    # Number of bytes needed to hold bitmap and offset (both).
  293. X    block_size := (stored_bitmap_length + offset_length) / 8
  294. X
  295. X    # We could just code the length of the offset, since the bitmap's
  296. X    # length is fixed (and known).  Seems better to code the block's
  297. X    # total length just in case something gets screwed up.  An 8-bit
  298. X    # limit means the bitmap+offset length cannot exceed 2^9-1 (255)
  299. X    # characters.
  300. X    if block_size > 255 then
  301. X        abort("write_bitmaps_and_offsets","bitmap+offset too big",15)
  302. X    write_int(outtext, block_size, 8)
  303. X    write_int(outtext, tmp_list[i], stored_bitmap_length)
  304. X    write_int(outtext, tmp_list[i+1], offset_length)
  305. X
  306. X    }
  307. X
  308. X    return
  309. X
  310. Xend
  311. X
  312. X#
  313. X# write_limits
  314. X#
  315. X# Writes out the bitmaps that will be needed in order for expandrf()
  316. X# to be able to know when the rollover field rolls over.
  317. X#
  318. Xprocedure  write_limits(out_fname, in_fname, r_field)
  319. X
  320. X    local in, out, shift_bits_out, bitmap_length, bitmaps_read,
  321. X     line, bitmap, short_bitmap, old_bitmap
  322. X
  323. X    in := open(in_fname) |
  324. X    abort("write_limits","can't open "||in_fname,5)
  325. X    out := open(out_fname, "w") |
  326. X    abort("write_limits","can't open "||out_fname,5)
  327. X    r_field <= IS.no |
  328. X    abort("write_limits","-l value should not exceed that of -n",50)
  329. X    shift_bits_out := -(((IS.no-r_field)+ 1) * IS.len)
  330. X    bitmap_length := ((IS.len * IS.no) <= seq(0,8))
  331. X    bitmaps_read := 0
  332. X
  333. X    while line := read(in) do {
  334. X    line ? {
  335. X        if ="::" then {
  336. X        bitmaps_read +:= 1
  337. X        bitmap := digits_2_bitmap(tab(0)) # in indexutl.icn
  338. X        short_bitmap := ishift(bitmap, shift_bits_out)
  339. X        if ishift(\old_bitmap, shift_bits_out) ~== short_bitmap
  340. X        then write_int(out, old_bitmap, bitmap_length)
  341. X        old_bitmap := bitmap
  342. X        }
  343. X    }
  344. X    }
  345. X
  346. X    write_int(out, \old_bitmap, bitmap_length)
  347. X    every close(in | out)
  348. X    return bitmaps_read
  349. X            
  350. Xend
  351. SHAR_EOF
  352. echo 'File makeind.icn is complete' &&
  353. true || echo 'restore of makeind.icn failed'
  354. rm -f _shar_wnt_.tmp
  355. fi
  356. # ============= gettokens.icn ==============
  357. if test -f 'gettokens.icn' -a X"$1" != X"-c"; then
  358.     echo 'x - skipping gettokens.icn (File already exists)'
  359.     rm -f _shar_wnt_.tmp
  360. else
  361. > _shar_wnt_.tmp
  362. echo 'x - extracting gettokens.icn (Text)'
  363. sed 's/^X//' << 'SHAR_EOF' > 'gettokens.icn' &&
  364. X############################################################################
  365. X#
  366. X#    Name:     gettokens.icn
  367. X#
  368. X#    Title:     get tokens from text-base file
  369. X#
  370. X#    Author:     Richard L. Goerwitz
  371. X#
  372. X#    Version: 1.2
  373. X#
  374. X############################################################################
  375. X#
  376. X#  Tokenizing routine used by makeind.icn to create index.
  377. X#
  378. X############################################################################
  379. X#
  380. X#  See also: ./makeind.icn
  381. X#
  382. X#############################################################################
  383. X
  384. X# declared in ./indexutl.icn (q.v.)
  385. X# global IS
  386. X#
  387. X# One idea for gettokens, good for small indices.  Uses field separator
  388. X# (IS.FS).  Also uses (slow) findre.  Farther below is a less flexible
  389. X# version of gettokens which runs faster.
  390. X#
  391. X#procedure gettokens(is_case_sensitive)
  392. X#
  393. X#    # Used within a scanning expression.  Returns tokens in
  394. X#    # &subject[&pos:0] (&pos normally = 1).  Tokens are stretches of
  395. X#    # text separated by the IS.FS field separator.  This
  396. X#    # field separator is a nawk style FS regular expression.  If null,
  397. X#    # it gets defined as ~(&digits++&letters).
  398. X#
  399. X#    local token
  400. X#    static non_alphanums
  401. X#    initial non_alphanums := ~(&digits ++ &letters ++ '-')
  402. X#
  403. X#    /IS.FS := non_alphanums
  404. X#    
  405. X#    while token := tab(findre(IS.FS)) do {
  406. X#    tab(__endpoint)
  407. X#    tab(many('\''))        # unfortunate by-product of findre's weakness
  408. X#    if \is_case_sensitive
  409. X#    then suspend "" ~== trim(token,'\t ')
  410. X#    else suspend map("" ~== trim(token,'\t '))
  411. X#    }
  412. X#
  413. X#    # Return the rest of &subject.  Even though we're not tabbing
  414. X#    # upto FS, this is normally what the user intends.
  415. X#    if \is_case_sensitive
  416. X#    then return "" ~== trim(tab(0),'\t ')
  417. X#    else return map("" ~== trim(tab(0),'\t '))
  418. X#
  419. X#end
  420. X
  421. Xprocedure gettokens(is_case_sensitive)
  422. X
  423. X    # Used within a scanning expression.  Returns tokens in
  424. X    # &subject[&pos:0] (&pos normally = 1).  Tokens are stretches of
  425. X    # text separated by an optional apostrophe or dash, then any
  426. X    # stretch of non-alphanumeric characters, then an optional apos-
  427. X    # trophe.
  428. X
  429. X    local token
  430. X    static alphanums, wordchars
  431. X    initial {
  432. X    alphanums := &digits ++ &letters ++ '-'
  433. X    wordchars := alphanums ++ '\''
  434. X    }
  435. X
  436. X    tab(upto(alphanums))
  437. X    while token := tab(many(wordchars)) do {
  438. X    if \is_case_sensitive
  439. X    then suspend "" ~== trim(token,'\t \'-')
  440. X    else suspend map("" ~== trim(token,'\t \'-'))
  441. X    tab(upto(alphanums))
  442. X    }
  443. X
  444. Xend
  445. SHAR_EOF
  446. true || echo 'restore of gettokens.icn failed'
  447. rm -f _shar_wnt_.tmp
  448. fi
  449. # ============= Makefile.dist ==============
  450. if test -f 'Makefile.dist' -a X"$1" != X"-c"; then
  451.     echo 'x - skipping Makefile.dist (File already exists)'
  452.     rm -f _shar_wnt_.tmp
  453. else
  454. > _shar_wnt_.tmp
  455. echo 'x - extracting Makefile.dist (Text)'
  456. sed 's/^X//' << 'SHAR_EOF' > 'Makefile.dist' &&
  457. X##########################################################################
  458. X#
  459. X#  Makefile.dist for bibleref.
  460. X#
  461. X##########################################################################
  462. X#
  463. X#  User-modifiable section.  Read carefully!  You will almost
  464. X#  certainly have to change some settings here.
  465. X#
  466. X
  467. X#
  468. X# Destination directory for binaries; library directory for auxiliary
  469. X# files.  Owner and group for public executables.  Leave the trailing
  470. X# slash off of directory names.
  471. X#
  472. XDESTDIR = /usr/local/bin
  473. X# DESTDIR = $(HOME)/bin
  474. XLIBDIR = /usr/local/lib/$(PROGNAME)
  475. X# LIBDIR = $(HOME)/$(PROGNAME)
  476. X# LIBDIR = /usr/local/share/lib/$(PROGNAME)
  477. XOWNER = root #bin
  478. XGROUP = root #bin
  479. X
  480. X#
  481. X# Name of your icon compiler and compiler flags.
  482. X#
  483. XICONC = /usr/icon/v8/bin/icont
  484. XIFLAGS = -Sc 200 -Si 1000 -Sn 2000 -SF 30
  485. X
  486. X#
  487. X# Names of KJV files as packaged in the PC-SIG disk set (19 discs).
  488. X# Mine were snarfed from helens.stanford.edu (36.0.2.99) as kjv.tar.Z.
  489. X# You will need to link these to the current directory.  Please don't
  490. X# copy them all over, or if you do, be sure to delete them afterwards.
  491. X# They aren't needed after you are done indexing.
  492. X#
  493. XRAWFILES = gen.txt exo.txt lev.txt num.txt deu.txt jos.txt jdg.txt \
  494. X    rth.txt sa1.txt sa2.txt ki1.txt ki2.txt ch1.txt ch2.txt \
  495. X    ezr.txt neh.txt est.txt job.txt psa.txt pro.txt ecc.txt \
  496. X    son.txt isa.txt jer.txt lam.txt eze.txt dan.txt hos.txt \
  497. X    joe.txt amo.txt oba.txt jon.txt mic.txt nah.txt hab.txt \
  498. X    zep.txt hag.txt zec.txt mal.txt mat.txt mar.txt luk.txt \
  499. X    joh.txt act.txt rom.txt co1.txt co2.txt gal.txt eph.txt \
  500. X    phi.txt col.txt th1.txt th2.txt ti1.txt ti2.txt tit.txt \
  501. X    phm.txt heb.txt jam.txt pe1.txt pe2.txt jo1.txt jo2.txt \
  502. X    jo3.txt jud.txt rev.txt
  503. X#
  504. X# If you have your KJV in a single file, that's fine.  Just be sure
  505. X# the books are in their correct order (as above), and are in the PC-SIG
  506. X# disk-set format.
  507. X# RAWFILES = ./kjv.Z
  508. X
  509. X#
  510. X# If you've compressed your KJV file(s), use zcat; otherwise use cat.
  511. X#
  512. XCAT = cat
  513. X# CAT = zcat
  514. X
  515. X#
  516. X# Change these only if you're pretty sure of what you're doing.
  517. X#
  518. XSHELL = /bin/sh
  519. XMAKE = make
  520. X
  521. X
  522. X###########################################################################
  523. X#
  524. X#  Don't change anything below this line.
  525. X#
  526. X
  527. XRTVFILE = kjv.rtv
  528. X
  529. XCONVERTER = kjv2rtv
  530. XCONVERTSRC = $(CONVERTER).icn convertr.icn name2num.icn complete.icn
  531. X
  532. XINDEXER = makeind
  533. XINDEXSRC = $(INDEXER).icn gettokens.icn indexutl.icn
  534. X
  535. XDUMMY_FILE = index.done
  536. XPROGNAME = bibleref
  537. X
  538. XSEARCHSRC = $(PROGNAME).icn ref2bmap.icn name2num.icn convertb.icn \
  539. X    listutil.icn passutil.icn srchutil.icn complete.icn \
  540. X    ipause.icn rewrap.icn binsrch.icn bmp2text.icn initfile.icn \
  541. X    retrieve.icn indexutl.icn retrops.icn whatnext.icn iolib.icn \
  542. X    iscreen.icn findre.icn
  543. X
  544. Xall: $(DUMMY_FILE) $(PROGNAME)
  545. X
  546. X$(DUMMY_FILE):
  547. X    @echo ""
  548. X    @echo "This may take a while (about 1 minute/MB on a Sun4)."
  549. X    @echo ""
  550. X    @sleep 2
  551. X    $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC)
  552. X    $(CAT) $(RAWFILES) | $(CONVERTER) > $(RTVFILE)
  553. X    @echo ""
  554. X    @echo "This may take a long time (c. 20 min./MB on a Sun4)."
  555. X    @echo "Kids, don't even *think* of trying this at home."
  556. X    @echo ""
  557. X    @sleep 2
  558. X    $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC)
  559. X    $(INDEXER) -f $(RTVFILE) -m 200 -n 3 -l 3
  560. X    touch $(DUMMY_FILE)
  561. X
  562. X$(PROGNAME): $(SEARCHSRC)
  563. X    $(ICONC) $(IFLAGS) -o $(PROGNAME) $(SEARCHSRC)
  564. X
  565. X$(PROGNAME).icn: $(PROGNAME).src
  566. X    sed "s|/usr/local/lib/bibleref/kjv.rtv|$(LIBDIR)/$(RTVFILE)|" $(PROGNAME).src > $(PROGNAME).icn
  567. X
  568. X$(CONVERTER): $(CONVERTSRC)
  569. X    $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC)
  570. X
  571. X$(INDEXER): $(INDEXSRC)
  572. X    $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC)
  573. X
  574. X
  575. X##########################################################################
  576. X#
  577. X#  Pseudo-target names (install, clean, clobber)
  578. X#
  579. X
  580. X# Pessimistic assumptions regarding the environment (in particular,
  581. X# I don't assume you have the BSD "install" shell script).
  582. Xinstall: all
  583. X    -test -d $(DESTDIR) || mkdir $(DESTDIR) && chmod 755 $(DESTDIR)
  584. X    cp $(PROGNAME) $(DESTDIR)/$(PROGNAME)
  585. X    chgrp $(GROUP) $(DESTDIR)/$(PROGNAME)
  586. X    chown $(OWNER) $(DESTDIR)/$(PROGNAME)
  587. X    -test -d $(LIBDIR) || mkdir $(LIBDIR) && chmod 755 $(LIBDIR)
  588. X    mv xxx* $(RTVFILE) $(LIBDIR)/
  589. X    chgrp $(GROUP) $(LIBDIR)
  590. X    chown $(OWNER) $(LIBDIR)
  591. X    chgrp $(GROUP) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE)
  592. X    chown $(OWNER) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE)
  593. X    @echo ""
  594. X    @echo "Done."
  595. X    @echo ""
  596. X
  597. X#
  598. X# For storing the pre-indexed files.  All that needs to be done here
  599. X# is to unpack the archive on another machine, and make $(PROGNAME).
  600. X#
  601. Xtar: all
  602. X    tar -cf ./$(PROGNAME).tar $(PROGNAME).src $(DUMMY_FILE) $(AUXILSRC) \
  603. X        Makefile.dist README
  604. X
  605. X#
  606. X# Cleanup
  607. X#
  608. Xclean:
  609. X    rm -f $(CONVERTER) $(INDEXER) $(PROGNAME)
  610. X
  611. X# Be careful; use this target, and you'll be back to square one.
  612. Xclobber: clean
  613. X    @echo "Okay, you asked for it."
  614. X    rm -f $(RAWFILES) xxx*.??? $(RTVFILE) $(DUMMY_FILE) $(PROGNAME).icn
  615. SHAR_EOF
  616. true || echo 'restore of Makefile.dist failed'
  617. rm -f _shar_wnt_.tmp
  618. fi
  619. # ============= README ==============
  620. if test -f 'README' -a X"$1" != X"-c"; then
  621.     echo 'x - skipping README (File already exists)'
  622.     rm -f _shar_wnt_.tmp
  623. else
  624. > _shar_wnt_.tmp
  625. echo 'x - extracting README (Text)'
  626. sed 's/^X//' << 'SHAR_EOF' > 'README' &&
  627. X--------
  628. SHAR_EOF
  629. true || echo 'restore of README failed'
  630. fi
  631. echo 'End of  part 9'
  632. echo 'File README is continued in part 10'
  633. echo 10 > _shar_seq_.tmp
  634. exit 0
  635. -- 
  636.  
  637.    -Richard L. Goerwitz              goer%sophist@uchicago.bitnet
  638.    goer@sophist.uchicago.edu         rutgers!oddjob!gide!sophist!goer
  639.