####################################################################
#   Copyright (c) 1996 NPACT Working Group. You may copy,          #
#   distribute, and modify it freely as long as you preserve this  #
#   copyright and permission notice.                               #
#                                                                  #
#   NPACT Working Group is a joint force of                        #
#      NPAC at Syracuse University,                                #
#      PACT at Harbin Institute of Technology, and                 #
#      PACT at Peking University                                   #   
####################################################################

#
#

SHELL       = /bin/sh

VERSION     = @VERSION@

srcdir      = @srcdir@
top_srcdir  = @top_srcdir@

prefix      = @prefix@
exec_prefix = @exec_prefix@

bindir      = @bindir@
libdir      = @libdir@

config_dir  = ../include

VPATH       = .:${srcdir}

INCLUDEDIR  = ${top_srcdir}/src/include

CFLAGS   = @CFLAGS@ @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)
CXXFLAGS = @CXXFLAGS@ @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)

CC  = @CC@
CXX = @CXX@

RANLIB = @RANLIB@

LIB = libxsage.a

OBJS = make_nodes.o db.o dbutils.o low_level.o \
       mapping.o attribute.o fromsage++.o finline.o \
       baseClasses.o sgCallGraph.o sgClassHierarchy.o 

ULIBS = -lbasic
LIBDIR = ../basicop

AR      = ar
ARFLAGS = ru

.SUFFIXES:
.SUFFIXES: .o .c .C

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

.C.o:
	$(CXX) -c $(CXXFLAGS) $<

all: Makefile $(LIB)

Makefile: Makefile.in
	@echo 
	@echo Please configure the package to generate new makefile ...
	@exit 1

$(LIB): $(OBJS)
	$(AR) $(ARFLAGS) $(LIB) $(OBJS)
	if test ${RANLIB} != ':' ; then ${RANLIB} $(LIB) ; fi

clean:
	rm -f *.o core $(LIB)

install: $(LIB)
	if [ ! -d ${libdir} ] ; then mkdir ${libdir} ; fi
	cp $(LIB) ${libdir}

uninstall:
	rm -f ${libdir}/$(LIB)

############
# file dependence information
# there must be more...
############

make_nodes.o: make_nodes.c
db.o: db.c
dbutils.o: dbutils.c 
low_level.o: low_level.c $(INCLUDEDIR)/bif_node.def
mapping.o: mapping.C mapping.h
attribute.o: attribute.C $(INCLUDEDIR)/fromsage++.h
finline.o: finline.C $(INCLUDEDIR)/fromsage++.h
fromsage++.o: fromsage++.C $(INCLUDEDIR)/fromsage++.h
baseClasses.o: baseClasses.C $(INCLUDEDIR)/fromsage++.h
sgCallGraph.o: sgCallGraph.C $(INCLUDEDIR)/fromsage++.h
sgClassHierarchy.o: sgClassHierarchy.C $(INCLUDEDIR)/fromsage++.h 











