# -*-Fundamental-*- ############################################################################### # # File: Makefile # RCS: $Header: Makefile,v 1.30 95/08/09 16:48:56 chip Exp $ # Description: Makefile for Bible Retrieval System # Author: Chip Chapin, Hewlett Packard Company # Created: Thu Aug 24 17:26:25 1989 # Modified: Tue Nov 29 23:11:55 1994 (Chip Chapin) chip@hpclbis.cup.hp.com # Language: make # Package: Bible Retrieval System # Status: Experimental (Do Not Distribute) # ############################################################################### # # Revisions: # # Tue Nov 29 23:11:13 1994 (Chip Chapin) chip@hpclbis.cup.hp.com # Add one more target to kludge "touch" case on bible.rawtext workaround. # Tue Apr 12 17:38:27 1994 (Chip Chapin) chip@hpclbis # Expanded output on RELNAME tombstone. # Tue Apr 27 12:57:34 1993 (Chip Chapin) chip@hpclbis # Removed dependencies from "install" target. # Tue Apr 27 09:43:20 1993 (Chip Chapin) chip@hpclbis # Monkey with "touch" invocation some more, for benefit of SunOS. # This may be temporary... # Tue Apr 27 08:52:14 1993 (Chip Chapin) chip@hpclbis # Make "ninstall" a separate target. # Mon Apr 26 10:52:42 1993 (Chip Chapin) chip@hpclbis # Restructuring of distribution tar files. Normal users will no longer # need the raw text file, or the associated processing tools. # Fri Apr 23 12:14:17 1993 (Chip Chapin) chip@hpclbis # Include data files in distribution, now that they're portable. # Updated dependencies. # Conditionalize production of squish data files, to account for possible # failure or interrupt of squish. Add dependency for rawconcordance. # Thu Apr 22 13:18:14 1993 (Chip Chapin) chip@hpclbis # Use obsolescent form of touch(1) invocation to work on BSD systems. # Fri Jan 8 12:08:24 1993 (Chip Chapin) chip@hpclbis # Create dummy $(RAWDATA) file to satisfy $(PROGINDEX).c dependency # Tue Jan 5 18:58:11 1993 (Chip Chapin) chip@hpclbis # Added brl-startverse/brl-startchapter and makeindex2 stuff. # Mon Jan 4 16:37:21 1993 (Chip Chapin) chip@hpclbis # Minor tweaks related to correct installation of man page. # Thu Dec 24 11:30:31 1992 (Chip Chapin) chip@hpclbis # Added util.h. # Wed Dec 23 15:13:27 1992 (Chip Chapin) chip@hpclbis # Add makeconc.pl, courtesy of Chris Eich. # Wed Dec 23 14:23:47 1992 (Chip Chapin) chip@hpclbis # Include bible-index.c with distributed files. # Minor tweaks to avoid excessive rebuilding of data files. # Tue Dec 22 11:27:17 1992 (Chip Chapin) chip@hpclbis # Improved install and release process. # Mon Dec 21 19:17:27 1992 (Chip Chapin) chip@hpclbis # Added new files for concordance, other release 2.0 changes. ############################################################################### # # $Log: Makefile,v $ # Revision 1.30 95/08/09 16:48:56 16:48:56 chip (Chip Chapin) # Release 4.03. Consolidate some changes made over the last year or so. # # Revision 1.29 94/12/08 20:11:08 20:11:08 chip (Chip Chapin) # Added one more target to kludge "touch" case for bible.rawtext workaround. # # Revision 1.28 94/04/12 17:39:25 17:39:25 chip (Chip Chapin) # Release 4.01: Fix singleton refs in concordance access routine. # # Revision 1.27 93/04/27 12:57:55 12:57:55 chip (Chip Chapin) # Removed dependencies from "install" target". # # Revision 1.26 93/04/27 12:46:06 12:46:06 chip (Chip Chapin) # Minor tweak of previous checkin. # # Revision 1.25 93/04/27 12:33:49 12:33:49 chip (Chip Chapin) # Fix "touch" invocation to work with more flavors of Unix. # # Revision 1.24 93/04/26 12:30:17 12:30:17 chip (Chip Chapin) # Tweak 4.00 repackaging. # # Revision 1.23 93/04/26 11:18:30 11:18:30 chip (Chip Chapin) # Release 4.00 # Public release of portable datafile version. # # Revision 1.22 93/04/23 13:08:13 13:08:13 chip (Chip Chapin) # PORTABILITY RELEASE # This version supports portable data files, usable on machines with # differing native byte-orders. # Also, this version compiles and runs on non-HPUX systems. It has been # tested on SunOS 4.? and ULTRIX 4.?, using SPARC and DEC 3100 hardware # respectively. Note that the data file format has rolled again. #  # # Revision 1.21 93/01/07 12:18:12 12:18:12 chip (Chip Chapin) # Release 3.01: Greatly improved compression of concordance data file. # # Revision 1.20 93/01/05 19:07:27 19:07:27 chip (Chip Chapin) # Release 3.00: (not for distribution) # Fixed errors (blank lines) in bible.data file. Data file is not compatible # with previous (1.x and 2.x) distributions. Further changes pending. # Rewrote context handling, and added "<" and ">" commands. # Tools for building brl-index are now part of release. # # Revision 1.19 93/01/05 10:49:13 10:49:13 chip (Chip Chapin) # Release 2.2, Added ?w command and line formatting to ?l output. # # Revision 1.18 92/12/24 11:38:15 11:38:15 chip (Chip Chapin) # Minor release 2.04a, fixes certain compile warnings. # # Revision 1.17 92/12/24 11:09:23 11:09:23 chip (Chip Chapin) # Release 2.04. Include verse ref in prompt line. # # Revision 1.16 92/12/23 16:04:00 16:04:00 chip (Chip Chapin) # Minor release v2.03a to include Chris Eich's makeconc.pl, & new Makefile. # # Revision 1.15 92/12/23 14:11:10 14:11:10 chip (Chip Chapin) # Release 2.03: minor tweaks and bug fixes. # # Revision 1.14 92/12/22 11:29:02 11:29:02 chip (Chip Chapin) # Minor release 2.01 -- fix a couple of bugs. # # Revision 1.13 92/12/21 20:02:07 20:02:07 chip (Chip Chapin) # Release 2.0. This release adds the concordance, and some small fixes. # # Revision 1.12 89/10/05 12:19:59 12:19:59 chip (Chip Chapin) # Added support for "smalltar" and "smallshar". # # Revision 1.11 89/10/02 23:32:44 23:32:44 chip (Chip Chapin) # Now installs ninstall package on make release. Uses ".do". # # Revision 1.10 89/10/02 23:20:25 23:20:25 chip (Chip Chapin) # Remove uncompressed tar file after compression. # # Revision 1.9 89/10/02 23:08:15 23:08:15 chip (Chip Chapin) # Add ninstall package to RCSFILES. # # Revision 1.8 89/10/02 22:41:25 22:41:25 chip (Chip Chapin) # *** empty log message *** # # Revision 1.7 89/10/02 22:23:13 22:23:13 chip (Chip Chapin) # Change make install to copy files instead of moving them. # # Revision 1.6 89/10/02 14:27:05 14:27:05 chip (Chip Chapin) # Revised checkin and relcheckin. # # Revision 1.5 89/09/14 21:16:09 21:16:09 chip (Chip Chapin) # Release 1-2. Supports -f and -l options for formatting the output. # Updates primarily brl.c, bible.c, and bible.1. # Makefile updates include automatic release. # # Revision 1.4 89/09/08 13:23:38 13:23:38 chip (Chip Chapin) # Better error checking on verse syntax; automatic test suite. # # Revision 1.3 89/09/07 09:55:39 09:55:39 chip (Chip Chapin) # Bug fixes: "make install" now creates non-existent directories instead # of barfing. Added man file to "make uninstall". # # Revision 1.2 89/09/05 20:23:53 20:23:53 chip (Chip Chapin) # Fix install bug. # # Revision 1.1 89/09/05 17:49:57 17:49:57 chip (Chip Chapin) # Initial revision # ############################################################################### # I use environment variables for these... #CFLAGS = -g #CFLAGS = -O # name of main program -- this determines a lot of other names PROGRAM = bible # name of supplemental index file -- generated from raw data file PROGINDEX = $(PROGRAM)-index README = README.$(PROGRAM) # primary man page MAN = $(PROGRAM).1 # Derived data file. Comes from processing raw data file. DATA = $(PROGRAM).data # Ninstall package NINSTPKG = $(PROGRAM).pkg # where to install this stuff DEST = $(PREFIX) #DEST = $(HOME)/local DESTBIN = $(DEST)/bin DESTLIB = $(DEST)/share/brs DESTMAN = $(DEST)/man DESTMAN1 = $(DESTMAN)/man1 # release directories. Nobody should care about this but me FTPHOME = /mnt/ftp RELEASEDIR = $(FTPHOME)/pub/$(PROGRAM) NINSTDIR = /usr/adm/netdist NINSTPKGDIR = $(NINSTDIR)/packages # This is only used by the author when making a new release ftp-able. INSTALL = .do cp LD = cc MAKEFILE = Makefile PRINT = pr SHELL = /bin/sh ############################################################################### # Sources, objects, and tools ############################################################################### # PROGOBJS and PROGSRCS are the components of the main program. PROGOBJS = $(PROGRAM).o \ brl-index.o \ brl.o \ $(PROGINDEX).o \ tsl.o \ util.o \ compresslib.o PROGSRCS = $(PROGRAM).c \ brl-index.c \ brl.c \ $(PROGINDEX).c \ tsl.c \ util.c \ compresslib.c # TOOLOBJS and TOOLSRCS are objects and sources used in building TOOLS. TOOLOBJS = buildcmp.o \ makeindex.o \ makeconcfile.o \ squish.o TOOLSRCS = buildcmp.c \ makeindex.c \ makeconcfile.c \ squish.c TOOLS = buildcmp squish makeindex makeconcfile # TOOLS2 are additional scripts and data files used in constructing stuff. TOOLS2 = makeindex2 \ makeconcordance \ makeconc.pl \ $(PROGRAM).stopwords # HDRS lists all header files used by PROGRAM and TOOLS HDRS = brl.h \ brl-startverse.h \ brl-startchapter.h \ tsl.h \ util.h \ version.h ############################################################################### # Distribution and version-control packages ############################################################################### # SRCS includes all archivable sources except headers, both tools and program SRCS = $(PROGSRCS) \ $(TOOLSRCS) \ $(TOOLS2) # DOC includes all available program documentation DOC = $(README) \ README.ftp \ $(MAN) # List of files controlled by RCS RCSFILES = $(DOC) \ $(SRCS) \ $(HDRS) \ $(MAKEFILE) \ $(NINSTPKG) \ testall # PROGDIST contains only those files needed to build PROGRAM, plus doc. PROGDIST = $(HDRS) \ $(PROGSRCS) \ $(MAKEFILE) \ $(DOC) # DATADIST contains the fully-processed compressed data files DATADIST = $(DATA) $(DATA).conc # TOOLSDIST contains all additional files needed to build a new # version of this application from scratch, including re-processing data. TOOLSDIST = $(TOOLSRCS) \ $(TOOLS2) \ $(NINSTPKG) \ testall ############################################################################### # TARGETS ############################################################################### $(PROGRAM): $(PROGOBJS) @echo "Linking $@ ..." @$(LD) $(LDFLAGS) $(PROGOBJS) -o $@ @echo "done" all: $(PROGRAM) $(TOOLS) $(DATA) $(DATA).conc buildcmp: buildcmp.o compresslib.o util.o @echo "Linking $@ ..." @$(LD) $(LDFLAGS) $@.o compresslib.o util.o -o $@ @echo "done" squish: squish.o @echo "Linking $@ ..." @$(LD) $(LDFLAGS) $@.o -o $@ @echo "done" makeindex: makeindex.o @echo "Linking $@ ..." @$(LD) $(LDFLAGS) $@.o -o $@ @echo "done" makeconcfile: makeconcfile.o util.o @echo "Linking $@ ..." @$(LD) $(LDFLAGS) $@.o util.o -o $@ @echo "done" brl-startverse.h brl-startchapter.h: $(RAWDATA) ./makeindex2 $(RAWDATA) ############################################################################### # The nested makes are used on the following items to # avoid establishing an explicit dependency on those files. # Such a dependency causes lots of extra work. $(DATA).conc: $(PROGRAM).rawconcordance make makeconcfile ./makeconcfile $@ < $(PROGRAM).rawconcordance squish.stats squish.data: $(RAWDATA) make squish if ./squish -w 65536 -v < $(RAWDATA) >squish.tmpdata; \ then mv squish.tmpdata squish.data; \ else rm squish.tmpdata squish.stats; fi $(DATA): squish.stats squish.data make buildcmp ./buildcmp mv squish.output $@ # ############################################################################### # The next one ensures that $(PROGINDEX).c gets its dependency satisfied. # Note that $(PROGINDEX).c is included in source distributions, while # $(RAWDATA) is NOT included in all distributions. $(PROGINDEX).c does NOT # need to be rebuilt unless someone (probably me) has munged $(RAWDATA). # The dependency on $(RAWDATA) helps to ensure that the raw concordance file # is not rebuilt unnecessarily. $(PROGRAM).rawconcordance: $(RAWDATA) @echo "To exclude \"stopwords\" from concordance use this:" @echo " ./makeconc.pl bible.stopwords" @echo "NOTE: The next command will FAIL if you don't have PERL." @echo " If it fails, edit Makefile to use this instead:" @echo " ./makeconcordance" @echo "Here we go..." ./makeconc.pl # ./makeconcordance clean:; @rm -f $(PROGOBJS) $(TOOLOBJS) core clobber:; @rm -f $(PROGOBJS) $(TOOLOBJS) $(PROGRAM) $(TOOLS) $(DATA) \ $(PROGINDEX).c squish.stats squish.data core tags # depend:; @mkmf -f $(MAKEFILE) ROOT=$(ROOT) echo:; @echo $(HDRS) $(SRCS) index:; @ctags -wx $(HDRS) $(SRCS) print:; @$(PRINT) $(HDRS) $(SRCS) tags: $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS) ############################################################################### # Distribution Targets ############################################################################### shar: $(PROGRAM).shar $(DATA).shar $(PROGRAM)-tools.shar $(PROGRAM).shar: $(PROGDIST) shar -cstem $(PROGDIST) > $< $(DATA).shar: $(DATADIST) shar -cstem $(DATADIST) > $< $(PROGRAM)-tools.shar: $(TOOLSDIST) shar -cstem $(TOOLSDIST) > $< TARFILES = $(PROGRAM).tar.Z \ $(DATA).tar \ $(PROGRAM)-tools.tar.Z \ $(PROGRAM).rawtext.Z tar: $(TARFILES) $(PROGRAM).tar.Z: $(PROGDIST) tar cvf $(PROGRAM).tar $(PROGDIST) compress $(PROGRAM).tar $(DATA).tar: $(DATADIST) tar cvf $@ $(DATADIST) $(PROGRAM)-tools.tar.Z: $(TOOLSDIST) tar cvf $(PROGRAM)-tools.tar $(TOOLSDIST) compress $(PROGRAM)-tools.tar # compress raw text data (without deleting uncompressed) $(PROGRAM).rawtext.Z: $(PROGRAM).rawtext compress <$(PROGRAM).rawtext >$@ linustape: tar @echo "Writing Linus tape on device /dev/rct...\c" @echo $(TARFILES) | cpio -ocv | tcio -orveVS 8 /dev/rct @echo " done." dattape: tar @echo "Writing tar-format tape on device /dev/dat...\c" tar cvf /dev/dat README.ftp $(TARFILES) @echo " done." ############################################################################### # Testing Targets ############################################################################### stdresults: test.results @echo "Storing Standard test results in test.stdresults...\c" @cp test.results test.stdresults @touch stdresults @echo " done." test.results: testall $(PROGRAM) @echo "Running Test Suite (results in test.results)...\c" @./testall > test.results 2>&1 @echo " test suite completed" test: test.results test.stdresults @echo "Comparing results to standard results" @if diff -c test.results test.stdresults; \ then echo " results OK."; \ else echo " results differ. Possible error."; fi ############################################################################### # Release/Version Control/Installation Targets # Except for "install" this will be of no interest to users other than # the author. ############################################################################### checkin: $(RCSFILES) ci -l $? touch checkin relcheckin: checkin @if [ "$(RELNAME)" = "" ]; \ then echo "*** No RELNAME value specified ***"; \ echo "*** Set RELNAME to release name and export it ***"; \ echo "*** Use format: bible-vN-NN ***"; \ exit 1; fi @if [ "$(CFLAGS)" != "-O" ]; \ then echo "*** CFLAGS not set to -O for release ***"; \ echo "*** Set CFLAGS to -O and export it ***"; \ exit 1; fi rcs -n"$(RELNAME):" -sRel $(RCSFILES) echo "$(RELNAME)" > relcheckin ## $(RCSFILES):; co $@ # The nested makes are here because the timestamps don't get updated # correctly from the ci -l otherwise. release: relcheckin make all strip $(PROGRAM) make stdresults make tar make relinstall touch release # The "relinstall" target puts all the pieces of a new release into place on # my home distribution machine. Probably nobody else will want this... relinstall: $(PROGRAM) $(DATA) $(DATA).conc $(TARFILES) \ $(MAN).Z $(README) README.ftp ninstall if hp9000s800;then $(INSTALL) $(PROGRAM) $(RELEASEDIR)/$(PROGRAM).hp-s800;fi $(INSTALL) $(DATA) $(RELEASEDIR) $(INSTALL) $(DATA).conc $(RELEASEDIR) $(INSTALL) $(TARFILES) $(RELEASEDIR) $(INSTALL) $(MAN).Z $(RELEASEDIR) $(INSTALL) $(README) $(RELEASEDIR)/$(README) $(INSTALL) README.ftp $(RELEASEDIR)/README.ftp ninstall: $(NINSTPKG) $(INSTALL) $(NINSTPKG) $(NINSTPKGDIR) .do $(NINSTDIR)/restartd # The "install" target could be of general use. That's why there are # no explicit dependencies here. They just confuse things... install: @if [ ! -r $(DEST) ]; then mkdir $(DEST); fi @echo Installing $(PROGRAM) in $(DESTBIN) @-strip $(PROGRAM) @if [ ! -r $(DESTBIN) ]; then mkdir $(DESTBIN); fi @if [ $(DESTBIN) != . ]; then \ ((cd $(DESTBIN);rm -f $(PROGRAM)); \ cp $(PROGRAM) $(DESTBIN)); \ chown root:wheel $(DESTBIN)/$(PROGRAM); \ chmod 755 $(DESTBIN)/$(PROGRAM); fi @echo Installing $(DATA) and $(DATA).conc in $(DESTLIB) @if [ ! -r $(DESTLIB) ]; then mkdir $(DESTLIB); fi @if [ $(DESTLIB) != . ]; then \ cp $(DATA) $(DATA).conc $(DESTLIB); \ chown root:wheel $(DESTLIB)/$(DATA) $(DESTLIB)/$(DATA).conc; \ chmod 644 $(DESTLIB)/$(DATA) $(DESTLIB)/$(DATA).conc; fi @if [ ! -r $(DESTMAN) ]; then mkdir $(DESTMAN); fi @echo Installing $(MAN) in $(DESTMAN1) @if [ ! -r $(DESTMAN1) ]; then mkdir $(DESTMAN1); fi @if [ $(DESTMAN1) != . ]; then \ cp $(MAN) $(DESTMAN1)/$(MAN); \ chown root:wheel $(DESTMAN1)/$(MAN); \ chmod 644 $(DESTMAN1)/$(MAN); fi uninstall:; @echo Un-installing $(PROGRAM), $(DATA) and $(MAN) rm -f $(DESTBIN)/$(PROGRAM) rm -f $(DESTLIB)/$(DATA) $(DESTLIB)/$(DATA).conc rm -f $(DESTMAN1)/$(MAN) # update: $(DESTBIN)/$(PROGRAM) $(DESTLIB)/$(DATA) ############################################################################### # Header DEPENDENCIES ############################################################################### ### $(PROGRAM).o: brl.h tsl.h util.h version.h brl.o: brl.h tsl.h util.h tsl.o: tsl.h util.h buildcmp.o: tsl.h util.h makeconcfile.o: tsl.h util.h brl-index.o: brl-startverse.h brl-startchapter.h