home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / language / perl_419 / makefile.st < prev    next >
Encoding:
Makefile  |  1993-10-23  |  2.9 KB  |  120 lines

  1. # Makefile for gdbm.
  2. #
  3. # for System V, add "-DSYSV" to CFLAGS.  Also, if you need alloca(),
  4. # add "-lPW" to LIBS.
  5. #
  6. # for BSD, nothing is required
  7. #
  8. # for gcc, uncomment the CC = gcc line.
  9.  
  10. CC = cgcc
  11. CFLAGS = -O # -O -DSYSV
  12. LDFLAGS =
  13. LIBS = # -lPW
  14. DBM = -ldbm
  15. NDBM = -lc
  16. LIBC = -lc
  17. LINTFLAGS =
  18.  
  19.  
  20. GDBM_CF = gdbmopen.c gdbmdelete.c gdbmfetch.c  gdbmstore.c gdbmclose.c \
  21.     gdbmreorg.c gdbmseq.c \
  22.     bucket.c falloc.c findkey.c global.c hash.c update.c version.c
  23.  
  24. HFILES = gdbmdefs.h extern.h gdbmerrno.h systems.h dbm.h ndbm.h gdbmconst.h
  25.  
  26.  
  27. MSCFILES = COPYING ChangeLog Makefile README gdbm.proto conv2gdbm.c
  28.  
  29. TESTFILES = testdbm.c testndbm.c testgdbm.c
  30.  
  31.  
  32. GDBM_OF = gdbmopen.o gdbmdelete.o gdbmfetch.o  gdbmstore.o gdbmclose.o \
  33.     gdbmreorg.o gdbmseq.o \
  34.     bucket.o falloc.o findkey.o global.o hash.o update.o version.o
  35.  
  36.  
  37. LIBDIR = /usr/lib
  38. INCLUDE = /usr/include
  39.  
  40. default: gdbm.olb
  41. odefault:    
  42.     @echo "\"make gdbm.olb\" to make the library"
  43.     @echo "\"make testgdbm\" to make the gdbm test program"
  44.     @echo "\"make allgdbm\" to make all of the above"
  45.     @echo "\"make conv2gdbm\" to make the conversion program"
  46.     @echo "\"make all\" to make all of the above"
  47.     @echo "\"make install\" to install the library"
  48.     @echo "\"make dist\" to make gdbm.tar.Z distribution file"
  49.  
  50. all:    allgdbm conv2gdbm 
  51.  
  52.  
  53. allgdbm: gdbm.olb testgdbm 
  54.  
  55. gdbm.olb:    $(GDBM_OF) gdbm.h
  56.     rm -f gdbm.olb
  57.     car q gdbm.olb $(GDBM_OF)
  58.  
  59. gdbm.h:    gdbm.proto gdbmerrno.h
  60.     cp gdbm.proto gdbm.h
  61.     chmod +w gdbm.h
  62.     grep _ gdbmerrno.h >> gdbm.h
  63.  
  64. install: gdbm.olb gdbm.h
  65.     install -c -m 644 gdbm.olb $(LIBDIR)/libgdbm.olb
  66.     if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
  67.         then ranlib $(LIBDIR)/libgdbm.olb; fi
  68.     install -c -m 644 gdbm.h $(INCLUDE)/gdbm.h
  69.  
  70. testgdbm: testgdbm.o gdbm.olb
  71.     $(CC) $(CFLAGS) $(LDFLAGS) -o testgdbm testgdbm.o gdbm.olb $(LIBS)
  72.  
  73. conv2gdbm: conv2gdbm.o gdbm.olb
  74.     $(CC) $(CFLAGS) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(DBM) $(LIBC) \
  75.     gdbm.olb $(LIBS)
  76.  
  77. lintgdbm: 
  78.     lint $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
  79.  
  80. clean:
  81.     rm -f $(GDBM_OF) gdbm.h gdbm.olb \
  82.     testgdbm  testgdbm.o \
  83.     conv2gdbm conv2gdbm.o
  84.  
  85. dist:
  86.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/gdbm-\1/p' version.c` \
  87.     ;mkdir $$OF             \
  88.     ;ln $(MSCFILES) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) $(HFILES) \
  89.         $(TESTFILES)  $$OF      \
  90.     ;tar cvohf $$OF.tar $$OF  \
  91.     ;compress $$OF.tar        \
  92.     ;rm -rf $$OF
  93.  
  94.  
  95.  
  96. # gdbm files
  97. gdbmclose.o:    gdbmdefs.h 
  98. gdbmdelete.o:    gdbmdefs.h gdbmerrno.h 
  99. gdbmfetch.o:    gdbmdefs.h gdbmerrno.h 
  100. gdbmopen.o:    gdbmdefs.h gdbmerrno.h 
  101. gdbmreorg.o:    gdbmdefs.h gdbmerrno.h extern.h
  102. gdbmseq.o:    gdbmdefs.h 
  103. gdbmstore.o:    gdbmdefs.h gdbmerrno.h 
  104.  
  105. # gdbm support files
  106. bucket.o:    gdbmdefs.h
  107. falloc.o:    gdbmdefs.h
  108. findkey.o:    gdbmdefs.h
  109. global.o:    gdbmdefs.h gdbmerrno.h 
  110. hash.o:        gdbmdefs.h
  111. update.o:    gdbmdefs.h
  112. version.o:
  113. extern.h:
  114. gdbmdefs.h:    gdbmconst.h systems.h
  115.     touch gdbmdefs.h
  116.  
  117. # other programs
  118. testgdbm.o:    gdbmdefs.h extern.h gdbmerrno.h systems.h
  119. conv2gdbm.o:    gdbm.h
  120.