####################################################################
#   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                                   #   
####################################################################

#
#  Makefile for Basic lib 
#

SHELL       = @CONFIGSHELL@

VERSION     = @VERSION@

srcdir      = @srcdir@
top_srcdir  = @top_srcdir@

config_dir  = ../include

prefix      = @prefix@

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

htmldir	    = $(HOME)/index

VPATH       = .:${srcdir}

INCLUDEDIR  = ${top_srcdir}/src/include
#SageOpInc   = ${top_srcdir}/src/xsageop

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@

PROGRAM =trans2 

LIB=../xsageop/libxsage.a ../basicop/libbasic.a
LIBS = -lxsage -lbasic
LIBDIR = -L../xsageop -L../basicop

TOBJ =trans2.o  assign.o  where.o wherec.o consw.o basic_fun.o forallc.o ele_intrin.o
.SUFFIXES:
.SUFFIXES: .o .c .cc

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

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

all: Makefile $(PROGRAM)

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

$(PROGRAM): $(LIB) $(TOBJ) 
	$(CXX) -g -o $@ $(TOBJ) $(LIBDIR) $(LIBS)

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

uninstall:
	rm -f ${bindir}/$(PROGRAM)

############
# file dependence information
############
trans2.o : trans2.cc 	global_var.h  basic_fun.h ../include/strategy.h
assign.o: assign.cc	global_var.h  basic_fun.h
where.o: where.cc     global_var.h    basic_fun.h
wherec.o: wherec.cc     global_var.h    basic_fun.h
consw.o : consw.cc
forallc.o: forallc.cc global_var.h	 basic_fun.h
basic_fun.o: basic_fun.cc global_var.h	 basic_fun.h
ele_intrin.o:ele_intrin.cc

html: $(htmldir)/trans2/index.html

$(htmldir)/trans2/index.html: trans2.h
	doc++ -d $(htmldir)/trans2 trans2.h
