#######################################################################
##                  pC++/Sage++  Copyright (C) 1993                  ##
##  Indiana University  University of Oregon  University of Rennes   ##
#######################################################################
 
SHELL       = /bin/sh

VERSION     = @VERSION@

srcdir      = @srcdir@
libdir      = @libdir@
top_srcdir  = @top_srcdir@

config_dir  = ../include

prefix      = @prefix@

exec_prefix = ${prefix}
bindir      = ${exec_prefix}/bin

VPATH       = .:${srcdir}

INCLUDEDIR  = ${top_srcdir}/src/include

CFLAGS = -g -DHAVE_CONFIG_H -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR) -I./OmegaForSage/include

CC = gcc


SAGEROOT = ../../..
CONFIG_ARCH=i386-linux

LIBDIR = $(SAGEROOT)/lib/$(CONFIG_ARCH)
LIBINCLUDE = $(SAGEROOT)/lib/include
HINCLUDE = $(SAGEROOT)/h
INSTALLDEST = $(SAGEROOT)/bin/$(CONFIG_ARCH)
INSTALL = /bin/cp

#HP-ALLOCA#LDLIBS  = -lPW#ENDIF#
#HP_CFLAGS#CEXTRA = -Aa#ENDIF#

CC = @CC@
#USE_CC#CC=cc#ENDIF#

CXX =@CXX@
#USE_CFRONT#CXX=CC#ENDIF#

LOADER = $(CXX)

INCLUDE = -I$(LIBINCLUDE) -I$(HINCLUDE) -I./OmegaForSage/include

#CFLAGS	= $(INCLUDE) -g # $(CEXTRA)
LDFLAGS	= 

LIBS =
#LIBS = $(LIBDIR)/libann.a $(LIBDIR)/libsage.a $(LIBDIR)/libdb.a $(LIBDIR)/libSage++.a

OMEGATEST_OBJ       = OmegaForSage/add-assert.o OmegaForSage/cover.o  OmegaForSage/ddomega-build.o OmegaForSage/ddomega.o  OmegaForSage/kill.o OmegaForSage/affine.o  OmegaForSage/sagedriver.o OmegaForSage/ddomega-use.o OmegaForSage/debug.o  OmegaForSage/ip.o  OmegaForSage/refine.o

HFILE = annotationDriver.h constanteSet.h depGraph.h inducVar.h set.h arrayRef.h definitionSet.h dependence.h intrinsic.h depInterface.h definesValues.h


LIB = libDep.a

OBJS =  set.o controlFlow.o flowAnalysis.o defUse.o  constanteProp.o computeInducVar.o arrayRef.o dependence.o invariant.o depGraph.o intrinsic.o loopTransform.o annotationDriver.o depInterface.o

SRCS =  set.C controlFlow.C flowAnalysis.C defUse.C constanteProp.C computeInducVar.C arrayRef.C dependence.C invariant.C depGraph.C intrinsic.C loopTransform.C annotationDriver.C depInterface.C




all:
	cd OmegaForSage ; make
	make $(LIB)

$(LIB): $(OBJS)
	/bin/rm -f libDep.a
	ar qc $(LIB) $(OBJS) $(LIBS) $(OMEGATEST_OBJ)
	ranlib libDep.a

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

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

set.o: set.C $(HFILE)
	$(CXX) $(CFLAGS) -c set.C

controlFlow.o: controlFlow.C $(HFILE)
	$(CXX) $(CFLAGS) -c controlFlow.C

flowAnalysis.o: flowAnalysis.C $(HFILE)
	$(CXX) $(CFLAGS) -c flowAnalysis.C

defUse.o: defUse.C $(HFILE)
	$(CXX) $(CFLAGS) -c defUse.C

constanteProp.o: constanteProp.C $(HFILE)
	$(CXX) $(CFLAGS) -c constanteProp.C

computeInducVar.o: computeInducVar.C $(HFILE)
	$(CXX) $(CFLAGS) -c computeInducVar.C

arrayRef.o: arrayRef.C $(HFILE)
	$(CXX) $(CFLAGS) -c arrayRef.C

dependence.o: dependence.C $(HFILE)
	$(CXX) $(CFLAGS) -c dependence.C

invariant.o: invariant.C $(HFILE)
	$(CXX) $(CFLAGS) -c invariant.C

depGraph.o: depGraph.C $(HFILE)
	$(CXX) $(CFLAGS) -c depGraph.C

intrinsic.o: intrinsic.C $(HFILE)
	$(CXX) $(CFLAGS) -c intrinsic.C


loopTransform.o: loopTransform.C $(HFILE)
	$(CXX) $(CFLAGS) -c loopTransform.C

annotationDriver.o :  annotationDriver.C $(HFILE)
	$(CXX) $(CFLAGS) -c annotationDriver.C

depInterface.o :  depInterface.C $(HFILE)
	$(CXX) $(CFLAGS) -c depInterface.C

clean:
	cd OmegaForSage ; make clean
	cd DemoDataDep ; make clean
	/bin/rm -f *.o *.dep a.out libDep.a
#	cd DemoDataDep ; make clean


