home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / db02_src.zip / Makefile.gen < prev    next >
Makefile  |  1993-11-05  |  8KB  |  310 lines

  1. ##########################################################
  2. # Generic Makefile for Diamondbase.
  3. # This is the Ultrix version. Modify the sections below to suit your machine.
  4. # PLEASE read the normal Makefile for descriptions of what everything is.
  5. #
  6. ##########################################################
  7.  
  8. ifndef BINDIR
  9. BINDIR=/usr/local/bin
  10. endif
  11. ifndef LIBDIR
  12. LIBDIR=/usr/local/lib
  13. endif
  14. ifndef INCDIR
  15. INCDIR=/usr/local/include
  16. endif
  17.  
  18. ################
  19. # Source files
  20.  
  21. OBJ=o
  22.  
  23. ALLSRC=btree.cc bucket.cc d_types.cc dbase.cc dbobj.cc dbotest.cc \
  24.        diarel.cc dispr.cc generate.cc idxinfo.cc main.cc \
  25.        myobj.cc nserver.cc rand.cc rserv.cc rtest.cc search.cc \
  26.        test1.cc tester.cc dberr.cc cache.cc btdump.cc version.cc \
  27.        mystring.cc mserv.cc diagrel.cc db2txt.cc utils.cc
  28.  
  29. MULTISRC=gib.cc dclient.cc
  30.  
  31. MULTIHEAD=gib.h dcdefs.h dclient.h ipcproto.h
  32.  
  33. INSTALLMULTIHEAD=dclient.h dcdefs.h
  34.  
  35. DOCSRC=doc.tex dsc.tex fileform.tex mycprog.sty fancyheadings.sty dirstruc.tex multi.tex strings.tex
  36.  
  37. XTRACLEAN= doc.aux doc.dvi doc.log doc.ps
  38.  
  39. OTHERSRC=dsc.l dsc.y ns.dbc
  40.  
  41. RELATIONHEAD=btree.h d_types.h dbase.h dbobj.h defs.h diarel.h \
  42.         idxinfo.h nserver.h object.h dbstr.h \
  43.         rserv.h dberr.h cache.h version.h mystring.h mserv.h \
  44.         diagrel.h ordcomp.h utils.h
  45.  
  46. ALLHEAD=$(RELATIONHEAD) generate.h myobj.h pathinfo.h rand.h 
  47.  
  48. OTHERDIST=Makefile Makefile.gen BETA README Copyright Diamond.cfg CHANGES lex.yy.c
  49.  
  50. DIST=$(ALLSRC) $(DOCSRC) $(OTHERSRC) $(ALLHEAD) $(OTHERDIST) $(MULTISRC) $(MULTIHEAD)
  51.  
  52. BINARIES=dsc db2txt
  53.  
  54. ################
  55. # List of object files
  56.  
  57. OBJS=btree.$(OBJ) bucket.$(OBJ) d_types.$(OBJ) dbase.$(OBJ) dbobj.$(OBJ) \
  58.     diarel.$(OBJ) generate.$(OBJ) idxinfo.$(OBJ) nserver.$(OBJ) \
  59.     rserv.$(OBJ) dberr.$(OBJ) cache.$(OBJ) mystring.$(OBJ) mserv.$(OBJ)
  60.  
  61. CC = g++
  62. CFLAGS = -g -Wall
  63. LOAD = -o 
  64. LDFLAGS = -L. -ldiamond # -lg++
  65. DEP =
  66. #
  67. # If your lex or yacc leave extern malloc declarations at the front of
  68. # their output, then use the FLEXFIX and STRIPHEAD in the sunos section
  69. # of Makefile.
  70. #
  71. FLEXFIX =
  72. PARSERGEN = yacc
  73. LIBRARIAN = ar rcv
  74. RANLIB = ranlib
  75. INSTALLBIN = install -m 755 -s -c
  76. INSTALL = install -m 644 -c
  77. LIBNAME = libdiamond.a
  78. LIBOBJS = $(OBJS)
  79. STRIPHEAD = cp y.tab.c dsc.cc
  80. RM = rm
  81. RMFLAGS = -f
  82. CP = cp
  83. MKDIR = mkdir
  84.  
  85. .SUFFIXES:
  86. .SUFFIXES: .$(OBJ) .y,v .l,v .y .l .cc,v .cc .h,v .h 
  87.  
  88. ######################################################
  89. # Targets start here
  90. #
  91. # Do not change anything under this comment.
  92. #
  93. ######################################################
  94.  
  95. all: lib $(BINARIES)
  96.  
  97. install: all
  98.     -$(MKDIR) $(BINDIR)
  99.     -$(MKDIR) $(LIBDIR)
  100.     -$(MKDIR) $(INCDIR)
  101.     $(INSTALLBIN) $(BINARIES) $(BINARIES)
  102.     $(INSTALL) $(LIBNAME) $(LIBDIR)/$(LIBNAME)
  103.     $(CP) $(RELATIONHEAD) $(INCDIR)
  104.     
  105. installmulti: multi
  106.     -$(MKDIR) $(LIBDIR)
  107.     -$(MKDIR) $(INCDIR)
  108.     $(INSTALL) $(MULTILIB) $(LIBDIR)/$(MULTILIB)
  109.     $(CP) $(INSTALLMULTIHEAD) $(INCDIR)
  110.  
  111. depend: $(ALLSRC) $(ALLHEAD) dsc.y
  112.     @echo -n "Backing up Makefile, "
  113.     @mv -f Makefile Makefile.bak
  114.     @awk '/^\#Do not remove/{n = 1;print $0} n==0' Makefile.bak >Makefile
  115.     @echo "now making dependencies"
  116.     @sh -c 'for a in $(ALLSRC) $(MULTISRC); do gcc -I. -M $$a; done' | sed -e 's/\.o/.$$(OBJ)/;s| /[^ ]*||g;/^ *\\$$/d' >> Makefile
  117.  
  118. clean:
  119.     rm -f lex.yy.c y.tab.c dsc.cc *.$(OBJ) $(MULTILIB) $(LIBNAME) dsc $(XTRACLEAN) version
  120.     rcsclean RCS/*
  121.  
  122. trans: db2txt
  123.  
  124. db2txt: db2txt.$(OBJ) $(LIBNAME)
  125.     $(CC) $(CFLAGS) $(LOAD)db2txt db2txt.$(OBJ) $(LDFLAGS)
  126.  
  127. lib: $(LIBNAME)
  128.  
  129. multi: $(MULTILIB) jeweler
  130.  
  131. $(MULTILIB): dclient.$(OBJ)
  132.     -$(RM) $(RMFLAGS) $(MULTILIB)
  133.     $(LIBRARIAN) $(MULTILIB) dclient.$(OBJ)
  134.     $(RANLIB) $(MULTILIB)
  135.  
  136. $(LIBNAME): $(LIBOBJ)
  137.     -$(RM) $(RMFLAGS) $(LIBNAME)
  138.     $(LIBRARIAN) $(LIBNAME) $(LIBOBJS)
  139.     $(RANLIB) $(LIBNAME)
  140.  
  141. lex.yy.c: dsc.l
  142.     flex dsc.l
  143.     $(FLEXFIX)
  144.  
  145. dsc.cc: lex.yy.c dsc.y
  146.     -$(RM) $(RMFLAGS) dsc.cc
  147.     $(PARSERGEN) dsc.y
  148.     $(STRIPHEAD)
  149.  
  150. dsc: lex.yy.c dsc.$(OBJ) $(LIBNAME)
  151.     $(CC) $(CFLAGS) $(LOAD)dsc dsc.$(OBJ) $(LDFLAGS)
  152.  
  153. jeweler: gib.$(OBJ) $(LIBNAME)
  154.     $(CC) $(CFLAGS) $(LOAD)jeweler gib.$(OBJ) $(LDFLAGS)
  155.  
  156. version: version.$(OBJ) $(LIBNAME) ns.dbc
  157.     $(CC) $(CFLAGS) $(LOAD)version version.$(OBJ) $(LDFLAGS)
  158.  
  159. dispr: dispr.$(OBJ) $(LIBNAME)
  160.     $(CC) $(CFLAGS) $(LOAD)dispr dispr.$(OBJ) $(LDFLAGS)
  161.  
  162. dist: $(DIST)
  163.     (cd ..; tar cf - $(DISTFILES) | compress > diamond.tar.Z)
  164.  
  165. ######################
  166. # Test suite....
  167. ######################
  168.  
  169. dbotest: $(LIBNAME) 
  170.     dsc $(TESTDBFILES) $(TESTSCHEMA) test
  171.     $(CC) $(CFLAGS) $(LOAD)dbotest test.cc dbotest.cc $(LDFLAGS)
  172.  
  173. tester: tester.$(OBJ) $(LIBNAME)
  174.     $(CC) $(CFLAGS) $(LOAD)tester tester.$(OBJ) $(LDFLAGS)
  175.  
  176. btdump: btdump.$(OBJ) $(LIBNAME)
  177.     $(CC) $(CFLAGS) $(LOAD)btdump btdump.$(OBJ) $(LDFLAGS)
  178.  
  179. RTEST_O=rtest.$(OBJ) rand.$(OBJ) $(LIBNAME)
  180.  
  181. rtest: $(RTEST_O)
  182.     $(CC) $(CFLAGS) $(LOAD)rtest $(CFLAGS) $(RTEST_O) $(LDFLAGS) -lm
  183.  
  184. test1: test1.$(OBJ) myobj.$(OBJ) $(LIBNAME)
  185.     $(CC) $(CFLAGS) $(LOAD)test1 test1.$(OBJ) $(LDFLAGS)
  186.  
  187.  
  188. #########################
  189. # Automatic dependancies.
  190. #########################
  191.  
  192. dsc.$(OBJ) : dsc.cc idxinfo.h d_types.h rserv.h defs.h btree.h object.h generate.h cache.h dberr.h mserv.h
  193.  
  194. #Do not remove this line or I will be very very angry (and broken).
  195. btree.$(OBJ) : btree.cc \
  196.   ./btree.h ./defs.h ./dberr.h \
  197.   ./rserv.h ./cache.h ./object.h ./dbstr.h ./mystring.h 
  198. bucket.$(OBJ) : bucket.cc ./defs.h ./dberr.h \
  199.   ./object.h ./dbstr.h ./mystring.h \
  200.   
  201. d_types.$(OBJ) : d_types.cc ./d_types.h ./dbstr.h ./mystring.h \
  202.   ./defs.h ./dberr.h 
  203. dbase.$(OBJ) : dbase.cc \
  204.   ./dbase.h ./nserver.h \
  205.   ./defs.h ./dberr.h ./dbobj.h ./idxinfo.h \
  206.   ./rserv.h ./cache.h ./btree.h ./object.h ./dbstr.h ./mystring.h ./mserv.h \
  207.   ./diarel.h \
  208.   ./d_types.h ./version.h 
  209. dbobj.$(OBJ) : dbobj.cc \
  210.   ./dbobj.h ./idxinfo.h \
  211.   ./rserv.h ./defs.h ./dberr.h ./cache.h \
  212.   ./btree.h ./object.h ./dbstr.h ./mystring.h \
  213.   ./mserv.h \
  214.   ./d_types.h 
  215. diarel.$(OBJ) : diarel.cc ./diarel.h ./object.h ./defs.h ./dberr.h \
  216.   ./dbstr.h \
  217.   ./mystring.h \
  218.   ./dbase.h ./nserver.h \
  219.   ./dbobj.h ./idxinfo.h \
  220.   ./rserv.h ./cache.h ./btree.h ./mserv.h \
  221.   ./d_types.h 
  222. dispr.$(OBJ) : dispr.cc \
  223.   idxinfo.h \
  224.   d_types.h ./dbstr.h ./mystring.h \
  225.   ./defs.h ./dberr.h 
  226. generate.$(OBJ) : generate.cc \
  227.   ./defs.h ./dberr.h ./utils.h ./idxinfo.h ./d_types.h ./dbstr.h ./mystring.h 
  228. idxinfo.$(OBJ) : idxinfo.cc \
  229.   ./idxinfo.h \
  230.   
  231. main.$(OBJ) : main.cc myobj.h object.h ./defs.h ./dberr.h \
  232.   ./dbstr.h ./mystring.h \
  233.   
  234. myobj.$(OBJ) : myobj.cc myobj.h object.h ./defs.h ./dberr.h \
  235.   ./dbstr.h ./mystring.h \
  236.   
  237. nserver.$(OBJ) : nserver.cc \
  238.   ./nserver.h \
  239.   ./defs.h ./dberr.h \
  240.   
  241. rand.$(OBJ) : rand.cc rand.h \
  242.   
  243. rserv.$(OBJ) : rserv.cc \
  244.   ./rserv.h ./defs.h ./dberr.h \
  245.   ./cache.h 
  246. rtest.$(OBJ) : rtest.cc \
  247.   rserv.h ./defs.h ./dberr.h \
  248.   ./cache.h rand.h 
  249. search.$(OBJ) : search.cc 
  250. test1.$(OBJ) : test1.cc myobj.h object.h ./defs.h ./dberr.h \
  251.   ./dbstr.h ./mystring.h \
  252.   rserv.h ./cache.h 
  253. tester.$(OBJ) : tester.cc myobj.h object.h ./defs.h ./dberr.h \
  254.   ./dbstr.h ./mystring.h \
  255.   rserv.h ./cache.h 
  256. dberr.$(OBJ) : dberr.cc \
  257.   ./dberr.h 
  258. cache.$(OBJ) : cache.cc \
  259.   ./cache.h ./defs.h ./dberr.h \
  260.   
  261. btdump.$(OBJ) : btdump.cc \
  262.   btree.h ./defs.h ./dberr.h \
  263.   ./rserv.h \
  264.   ./cache.h ./object.h ./dbstr.h ./mystring.h \
  265.   
  266. version.$(OBJ) : version.cc dbase.h ./nserver.h \
  267.   ./defs.h \
  268.   ./dberr.h ./dbobj.h ./idxinfo.h \
  269.   ./rserv.h ./cache.h ./btree.h ./object.h \
  270.   ./dbstr.h ./mystring.h \
  271.   ./mserv.h \
  272.   
  273. mystring.$(OBJ) : mystring.cc \
  274.   ./mystring.h \
  275.   ./defs.h ./dberr.h 
  276. mserv.$(OBJ) : mserv.cc ./mserv.h \
  277.   ./mystring.h \
  278.   ./defs.h ./dberr.h 
  279. diagrel.$(OBJ) : diagrel.cc \
  280.   ./diagrel.h ./diarel.h ./object.h ./defs.h ./dberr.h ./dbstr.h \
  281.   ./mystring.h \
  282.   ./dbase.h ./nserver.h \
  283.   ./dbobj.h ./idxinfo.h \
  284.   ./rserv.h ./cache.h ./btree.h ./mserv.h \
  285.   ./d_types.h ./ordcomp.h 
  286. db2txt.$(OBJ) : db2txt.cc \
  287.   ./diagrel.h ./diarel.h ./object.h ./defs.h ./dberr.h \
  288.   ./dbstr.h ./mystring.h \
  289.   ./dbase.h ./nserver.h \
  290.   ./dbobj.h ./idxinfo.h \
  291.   ./rserv.h ./cache.h ./btree.h ./mserv.h \
  292.   ./d_types.h \
  293.   ./generate.h 
  294. utils.$(OBJ) : utils.cc \
  295.   
  296. gib.$(OBJ) : gib.cc gib.h diagrel.h ./diarel.h ./object.h ./defs.h ./dberr.h \
  297.   ./dbstr.h ./mystring.h \
  298.   ./dbase.h ./nserver.h \
  299.   ./dbobj.h ./idxinfo.h ./rserv.h ./cache.h \
  300.   ./btree.h ./mserv.h \
  301.   ./d_types.h \
  302.   dcdefs.h \
  303.   ipcproto.h \
  304.   
  305. dclient.$(OBJ) : dclient.cc \
  306.   ipcproto.h \
  307.   dclient.h defs.h ./dberr.h \
  308.   dcdefs.h object.h ./defs.h ./dbstr.h \
  309.   ./mystring.h 
  310.