home *** CD-ROM | disk | FTP | other *** search
Makefile | 1992-09-24 | 5.3 KB | 188 lines |
- GVERSION=gversion -v 1.5.0.1
- # Makefile for gdbm.
- #
- # for System V, add "-DSYSV" to CFLAGS. Also, if you need alloca(),
- # add "-lPW" to LIBS.
- #
- # for BSD, nothing is required
- #
- # for gcc, uncomment the CC = gcc line.
-
- AR = gcc-ar
- CC = gcc -v -z -Wall -Ig:/mint/include
- LD = gcc -v -z -Wall -Lg:/mint/lib
- #CFLAGS = -g # -O -DSYSV
- CFLAGS = -O -fomit-frame-pointer
- LDFLAGS = -nostdlib g:/mint/lib/crt0.o
- #LIBS = # -lPW
- LIBS = -lgnu
- DBM = -ldbm
- NDBM = -lc
- LIBC = -lc
- LINTFLAGS =
-
- DBM_CF = dbminit.c delete.c fetch.c store.c seq.c
-
- NDBM_CF = dbmopen.c dbmdelet.c dbmfetch.c dbmstore.c dbmseq.c \
- dbmclose.c dbmdirfn.c dbmpagfn.c
-
- GDBM_CF = gdbmopen.c gdbmdele.c gdbmfetc.c gdbmstor.c gdbmclos.c \
- gdbmreor.c gdbmseq.c \
- bucket.c falloc.c findkey.c global.c hash.c update.c version.c
-
- HFILES = gdbmdefs.h extern.h gdbmerrn.h systems.h dbm.h ndbm.h gdbmcons.h
-
-
- MSCFILES = COPYING _change.log makefile readme gdbm.pro conv2gdb.c
-
- TESTFILES = testdbm.c testndbm.c testgdbm.c
-
-
- DBM_OF = dbminit.o delete.o fetch.o store.o seq.o
-
- NDBM_OF = dbmopen.o dbmdelet.o dbmfetch.o dbmstore.o dbmseq.o \
- dbmclose.o dbmdirfn.o dbmpagfn.o
-
- GDBM_OF = gdbmopen.o gdbmdele.o gdbmfetc.o gdbmstor.o gdbmclos.o \
- gdbmreor.o gdbmseq.o \
- bucket.o falloc.o findkey.o global.o hash.o update.o version.o
-
- # atari/MiNT does not have (or really need) this
- OTHER_OF = #fsync.o
-
- LIBDIR = /dev/g/mint/lib
- INCLUDE = /dev/g/mint/include
-
- default:
- @echo "\"make gdbm.olb\" to make the library"
- @echo "\"make testgdbm\" to make the gdbm test program"
- @echo "\"make testdbm\" to make the dbm compatability test program"
- @echo "\"make testndbm\" to make the ndbm compatability test program"
- @echo "\"make allgdbm\" to make all of the above"
- @echo "\"make tests\" to make the tests progs above"
- @echo "\"make tdbm\" to make the dbm test program (uses dbm, not gdbm)"
- @echo "\"make tndbm\" to make the ndbm test program (uses ndbm)"
- @echo "\"make alldbm\" to make the two previous programs"
- @echo "\"make conv2gdbm\" to make the conversion program"
- @echo "\"make all\" to make all of the above"
- @echo "\"make install\" to install the library"
- @echo "\"make dist\" to make gdbm.tar.Z distribution file"
-
- all: allgdbm conv2gdb alldbm
-
- alldbm: tdbm.ttp tndbm.ttp
-
- allgdbm: gdbm.olb testgdbm.ttp testdbm.ttp testndbm.ttp
-
- tests: testgdbm.ttp testdbm.ttp testndbm.ttp
-
- gdbm.olb: $(DBM_OF) $(NDBM_OF) $(GDBM_OF) $(OTHER_OF) gdbm.h
- rm -f gdbm.olb
- $(AR) rsv gdbm.olb $(DBM_OF) $(NDBM_OF) $(GDBM_OF) $(OTHER_OF)
- # if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
- # then ranlib gdbm.olb; fi
- $(GVERSION) gdbm.olb
-
- gdbm.h: gdbm.pro gdbmerrn.h
- cp gdbm.pro gdbm.h
- chmod +w gdbm.h
- grep _ gdbmerrn.h >> gdbm.h
-
- install: gdbm.olb gdbm.h
- install -c -m 644 gdbm.olb $(LIBDIR)/gdbm.olb
- # if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
- # then ranlib $(LIBDIR)/gdbm.olb; fi
- install -c -m 644 gdbm.h $(INCLUDE)/gdbm.h
-
- testgdbm.ttp: testgdbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o testgdbm.ttp testgdbm.o gdbm.olb $(LIBS)
-
- testdbm.ttp: testdbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o testdbm.ttp testdbm.o gdbm.olb $(LIBS)
-
- tdbm.ttp: testdbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o tdbm.ttp testdbm.o $(DBM) $(LIBS)
-
- testndbm.o: testndbm.c
- $(CC) -c $(CFLAGS) -DGNU testndbm.c
-
- testndbm.ttp: testndbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o testndbm.ttp testndbm.o gdbm.olb $(LIBS)
-
- tndbm.o: testndbm.c
- rm -f tndbm.c
- cp testndbm.c tndbm.c
- $(CC) $(CFLAGS) -c tndbm.c
- rm -f tndbm.c
-
- tndbm.ttp: tndbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o tndbm.ttp tndbm.o $(LIBS) $(NDBM)
-
- conv2gdb: conv2gdbm.o gdbm.olb
- $(LD) $(CFLAGS) $(LDFLAGS) -o conv2gdb.ttp conv2gdb.o $(DBM) $(LIBC) \
- gdbm.olb $(LIBS)
-
- lintgdbm:
- lint $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
-
- clean:
- rm -f $(DBM_OF) $(NDBM_OF) $(GDBM_OF) gdbm.h gdbm.olb \
- testdbm.ttp testndbm.ttp testgdbm.ttp testdbm.o testndbm.o testgdbm.o \
- tdbm.ttp tndbm.ttp tndbm.o tndbm.c conv2gdb conv2gdb.o
-
- dist:
- OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/gdbm-\1/p' version.c` \
- ;mkdir $$OF \
- ;ln $(MSCFILES) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) $(HFILES) \
- $(TESTFILES) $$OF \
- ;tar cvohf $$OF.tar $$OF \
- ;compress $$OF.tar \
- ;rm -rf $$OF
-
-
- # dbm files
- dbminit.o: gdbmdefs.h extern.h gdbmerrno.h
- delete.o: gdbmdefs.h extern.h
- fetch.o: gdbmdefs.h extern.h
- store.o: gdbmdefs.h extern.h
- seq.o: gdbmdefs.h extern.h
-
- # ndbm files
- dbmopen.o: gdbmdefs.h extern.h gdbmerrn.h
- dbmdelet.o: gdbmdefs.h extern.h
- dbmfetch.o: gdbmdefs.h extern.h
- dbmstore.o: gdbmdefs.h extern.h
- dbmseq.o: gdbmdefs.h extern.h
- dbmclose.o: gdbmdefs.h systems.h
- dbmpagfn.o: gdbmdefs.h extern.h
- dbmdirfn.o: gdbmdefs.h extern.h
-
-
- # gdbm files
- gdbmclos.o: gdbmdefs.h
- gdbmdele.o: gdbmdefs.h gdbmerrn.h
- gdbmfetc.o: gdbmdefs.h gdbmerrn.h
- gdbmopen.o: gdbmdefs.h gdbmerrn.h
- gdbmreor.o: gdbmdefs.h gdbmerrn.h extern.h
- gdbmseq.o: gdbmdefs.h
- gdbmstor.o: gdbmdefs.h gdbmerrn.h
-
- # gdbm support files
- bucket.o: gdbmdefs.h
- falloc.o: gdbmdefs.h
- findkey.o: gdbmdefs.h
- global.o: gdbmdefs.h gdbmerrn.h
- hash.o: gdbmdefs.h
- update.o: gdbmdefs.h
- version.o:
- extern.h:
- gdbmdefs.h: gdbmcons.h systems.h
- touch gdbmdefs.h
-
- # other programs
- testgdbm.o: gdbmdefs.h extern.h gdbmerrno.h systems.h
- testdbm.o:
- testndbm.o: ndbm.h
- tdbm.o:
- conv2gdb.o: gdbm.h
-