########################################################################## # PROGNAME = quranref # ########################################################################## # # User-modifiable section. Read carefully! You will almost # certainly have to change some settings here. # # # Destination directory for binaries; library directory for auxiliary # files. Owner and group for public executables. Leave the trailing # slash off of directory names. # DESTDIR = /usr/local/bin # DESTDIR = $(HOME)/bin LIBDIR = /usr/local/lib/$(PROGNAME) # LIBDIR = $(HOME)/$(PROGNAME) # LIBDIR = /usr/local/share/lib/$(PROGNAME) OWNER = root #bin GROUP = root #bin # # Name of your icon compiler and compiler flags. # ICONC = /usr/icon/v8/bin/icont # Flags for $(ICONC) (these may vary for different versions and/or # implementations). If you get messages like "out of X table space," # then you will need to adjust these. Note that they apply only to # the interpreter. Comment everything out but the -u for the # compiler. IFLAGS = -u -Sc 400 -Sg 400 -Si 2000 -Sn 4000 -SF 40 # # Names of Quran files should all be sorted, consisting of a three- # digit prefix, followed by a period, and a title. Cat-ing them is # sufficient, since the shell automatically takes them in order. Use # zcat if your files are compressed. Note that I assume the original # distribution and form, as announced in soc.religion.islam by Cary # Maguire), and as archived at princeton.edu (pub/Quran.tar.Z). # CAT = cat [0-9][0-9][0-9].* # CAT = zcat [0-9][0-9][0-9].* # # Change these only if you're sure of what you're doing # SHELL = /bin/sh MAKE = make SHAR = shar # # Maximum number that any database location field will have to # contain. For a standard Quran, this figure is 286 (the Cow). # MAXFIELDS = 286 ########################################################################### # # Don't change anything below this line. # RTVFILE = qur.rtv CONVERTER = qur2rtv CONVERTSRC = $(CONVERTER).icn INDEXER = makeind INDEXSRC = $(INDEXER).icn gettokens.icn indexutl.icn huffcode.icn \ outbits.icn DUMMY_FILE = index.done MAINFILE = bibleref SEARCHSRC = $(MAINFILE).icn ref2bmap.icn name2num.icn convertb.icn \ listutil.icn passutil.icn readfile.icn srchutil.icn complete.icn \ ipause.icn rewrap.icn binsrch.icn bmp2text.icn initfile.icn \ retrieve.icn indexutl.icn retrops.icn whatnext.icn iolib.icn \ iscreen.icn findre.icn version.icn huffcode.icn inbits.icn all: $(DUMMY_FILE) $(PROGNAME) $(DUMMY_FILE): @echo "" @echo "This may take a while (about 1 minute/MB on a Sun4)." @echo "" @sleep 3 $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC) $(CAT) $(RAWFILES) | $(CONVERTER) > $(RTVFILE) @echo "" @echo "This will take a long time (c. 1 hour/MB on a Sun4)." @echo "Kids, don't even *think* of trying this at home." @echo "" @sleep 3 $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC) $(INDEXER) -f $(RTVFILE) -m $(MAXFIELDS) -n 2 -l 2 @rm -f *.BAK @echo "" @echo "I'm creating a $(DUMMY_FILE) file, indicating that the" @echo "indexing process is done. Once the data files are moved," @echo "this file remains, preventing an accidental remake of the" @echo "data files. If, poor soul, you *want* a total remake, you" @echo 'will need to remove this file (see "clobber" below).' @echo "" @sleep 4 touch $(DUMMY_FILE) $(PROGNAME): $(SEARCHSRC) @echo "" @echo "Compiling main executable, $(PROGNAME)." @echo "" @sleep 2 $(ICONC) $(IFLAGS) -o $(PROGNAME) $(SEARCHSRC) $(MAINFILE).icn: $(MAINFILE).src @echo "" @echo "Hardcoding default datafile path ($(LIBDIR))." @echo "" @sleep 2 sed "s|/usr/local/lib/bibleref/kjv.rtv|$(LIBDIR)/$(RTVFILE)|; s|Bible|Quran|g" $(MAINFILE).src > $(MAINFILE).icn $(CONVERTER): $(CONVERTSRC) $(ICONC) $(IFLAGS) -o $(CONVERTER) $(CONVERTSRC) $(INDEXER): $(INDEXSRC) $(ICONC) $(IFLAGS) -o $(INDEXER) $(INDEXSRC) ########################################################################## # # Pseudo-target names (install, clean, clobber) # # # Pessimistic assumptions regarding the environment (in particular, # I don't assume you have the BSD "install" shell script). install: all @echo "" @echo "Creating (if need be) necessary directories, and moving" @echo "executables/data files to their correct locations, with" @echo "the permissions and the ownership you specified in the" @echo "makefile (i.e. $(OWNER))." @echo "" -test -d $(DESTDIR) || mkdir $(DESTDIR) && chmod 755 $(DESTDIR) cp $(PROGNAME) $(DESTDIR)/$(PROGNAME) -chgrp $(GROUP) $(DESTDIR)/$(PROGNAME) -chown $(OWNER) $(DESTDIR)/$(PROGNAME) -test -d $(LIBDIR) || mkdir $(LIBDIR) && chmod 755 $(LIBDIR) mv xxx* $(RTVFILE) $(LIBDIR)/ -chgrp $(GROUP) $(LIBDIR) -chown $(OWNER) $(LIBDIR) -chgrp $(GROUP) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE) -chown $(OWNER) $(LIBDIR)/xxx* $(LIBDIR)/$(RTVFILE) @echo "" @echo "Done installing." @echo "" # # Cleanup # clean: @echo "" @echo "Minor cleanup underway (major = make clobber)." @echo "" rm -f $(CONVERTER) $(INDEXER) $(PROGNAME) # Be careful; use this target, and you'll be back to square one. clobber: clean @echo "" @echo "You're in for a complete remake if you do this. Here" @echo "are the files that will get clobbered (note especially" @echo "the raw Qur'an files):" @echo "" @echo $(RAWFILES) xxx*.??? $(RTVFILE) $(DUMMY_FILE) $(MAINFILE).icn @echo "" @echo 'If you really want a total remake, then make "honestly."' @echo "" honestly: @echo "" @echo "Okay, you asked for it." @echo "" @sleep 4 rm -f $(RAWFILES) xxx*.??? $(RTVFILE) $(DUMMY_FILE) $(MAINFILE).icn