# 
# ========================================================================
# CORAL 
#   Copyright R. Ramakrishnan and The CORAL Group, 
# University of Wisconsin at Madison.
# 1992 All Rights Reserved.
# Version 0.1
# ========================================================================
#
#
#
# ------------------------------------------------------------------------
# CORAL Version 0.1
# RESEARCH SOFTWARE DISCLAIMER -------------------------------------------
# ------------------------------------------------------------------------
#
#    As unestablished, research software, this program is provided free of 
#    charge on an "as is" basis without warranty of any kind, either 
#    express or implied.  Acceptance and use of this program constitutes 
#    the user's understanding that she will have no recourse for any 
#    actual or consequential damages, including, but not limited to, 
#    lost profits or savings, arising out of the use of or inability to 
#    use this program.  
#
# ------------------------------------------------------------------------
# USER AGREEMENT ---------------------------------------------------------
# ------------------------------------------------------------------------
#
#     BY ACCEPTANCE AND USE OF THIS EXPERIMENTAL PROGRAM
#     THE USER AGREES TO THE FOLLOWING:
#
#     a.  This program is provided free of charge for the user's personal, 
#	 non-commercial, experimental use.
#
#     b.  All title, ownership and rights to this program and any copies 
#         remain with the copyright holder, irrespective of the ownership 
#	 of the media on which the program resides.
#
#     c.  The user is permitted to create derivative works to this program.  
#         However, all copies of the program and its derivative works must
#         contain the CORAL copyright notice, the UNESTABLISHED SOFTWARE 
#         DISCLAIMER and this USER AGREEMENT.
#
#     d.  The user understands and agrees that this program and any 
#         derivative works are to be used solely for experimental purposes 
#	 and are not to be sold or commercially exploited in any manner 
#	 WITHOUT EXPRESS WRITTEN PERMISSION.
#
#     e.  We request that the user supply us with a copy of any changes, 
#         enhancements, or derivative works which the user may create,
#	 with the user's permission to redistribute it.
#	 Copies of such material should be sent to:  CORAL@CS.WISC.EDU
#
# -------------------------------------------------------------------------

#
#  File of defaults to be included in all Makefiles
#
include	../make_include

CFLAGS=-I$(CORALROOT)/includes -I../includes -I$(EXODUS) $(DFLAGS)
CPlusFlags=$(CFLAGS)

CPLUS_SRCS= annotations.C \
    apply.C \
    arg.C \
    arrays.C \
    backtrack.C \
    bitvector.C \
    builtin-rel.C \
    compile.C \
    compile_rule.C \
    cor_error.C \
    database.C \
    db-builtin.C \
    derived-rel.C \
    dir.c \
    execute.C \
    generic-index.C \
    generic-rel.C \
    grouping.C \
    hash-index.C \
    hash-rel.C \
    hashtab.C \
    hashtable.C \
    incr-loader.C \
    interface.C \
    join.C \
    ordsearch.C \
    parse-actions.C \
    parse-utils.C \
    pipelined.C \
    profile.C \
    set-hash-cons.C \
    symbol.C \
    term.C \
    unparse.C \
    user-builtin1.C \
    user-builtin2.C \
    util.C\
    builtin-persist.C \
    catalog.C \
    generic-sm.C \
    persistent-index.C \
    persistent-rel.C 
    
    
CPLUS_OBJS=\
    annotations.o \
    apply.o \
    arg.o \
    arrays.o \
    backtrack.o \
    bitvector.o \
    builtin-rel.o \
    compile.o \
    compile_rule.o \
    cor_error.o \
    database.o \
    db-builtin.o \
    derived-rel.o \
    dir.o \
    execute.o \
    generic-index.o \
    generic-rel.o \
    grouping.o \
    hash-index.o \
    hash-rel.o \
    hashtab.o \
    hashtable.o \
    incr-loader.o \
    interface.o \
    join.o \
    ordsearch.o \
    parse-actions.o \
    parse-utils.o \
    pipelined.o \
    profile.o \
    set-hash-cons.o \
    symbol.o \
    term.o \
    unparse.o \
    user-builtin1.o \
    user-builtin2.o \
    util.o\
    builtin-persist.o \
    catalog.o \
    generic-sm.o \
    persistent-index.o \
    persistent-rel.o 

    
FILES=y.tab.o lex.yy.o $(CPLUS_OBJS)
SRCS=gram.y scanner.l $(CPLUS_SRCS) coral-int.C att_fns.c
OTHERS=README Makefile hash.h hashfunc.h
# This is to help makedepend find include files.
OTHERINCLUDES=-I$(CPlusROOT)/include
LIBS=-ll -lm

all: coral 

coral: coral-int.o libcoral.a
	$(CPlus) $(IMP_OPS) -o coral coral-int.o libcoral.a $(LIBS)
	chmod a+x coral

libcoral.a: $(FILES)
	ar cr libcoral.a $(FILES) $(EXODUS_LIB)
	ranlib libcoral.a

dir.o: dir.c
	$(CC) -c $(CFLAGS) dir.c

.C.o:
	$(CPlus) -c $(CPlusFlags) $*.C

.c.o:
	$(CC) -c $(CPlusFlags) $*.c

y.tab.c y.tab.h: gram.y ../includes/arg.h \
	../includes/term.h ../includes/externs.h \
           ../includes/rules.h ../includes/generic-rel.h\
	   ../includes/collection.h ../includes/parser.h \
           ../includes/builtin-syms.h ../includes/parse-utils.h
	yacc -d gram.y

y.tab.o: y.tab.c
	$(CPlus) -c $(CPlusFlags) y.tab.c

lex.yy.c: scanner.l y.tab.h
	$(SCANNER) scanner.l

lex.yy.o: lex.yy.c
	$(CPlus) -c $(CPlusFlags) lex.yy.c

builtin-syms.hh: ../includes/builtin-syms.h
	../utils/encode-syms ../includes/builtin-syms.h >builtin-syms.hh

clean:
	rm -f *.o *~ core y.tab.c y.tab.h lex.yy.c builtin-syms.hh

depend:
	makedepend -- $(CFLAGS) -- $(SRCS) $(OTHERINCLUDES)

coq:  
	co -q RCS/*

col:  
	co -l $(CPLUS_SRCS) $(SRCS) $(OTHERS) 

co:  
	co RCS/*

ci:  
	ci $(CPLUS_SRCS) $(SRCS) $(OTHERS)

ciu:  
	ci -u $(CPLUS_SRCS) $(SRCS) $(OTHERS)

# DO NOT DELETE THIS LINE -- make depend depends on it.

