####################################################################
#   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       = /bin/sh

VERSION     = @VERSION@

srcdir      = @srcdir@
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 @DEFS@ -I. -I${srcdir} -I$(config_dir) -I$(INCLUDEDIR)
CXXFLAGS = -g -I../xsageop -I$(INCLUDEDIR)

CC  = @CC@
CXX = @CXX@

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

PROGRAM = transG

OBJS = hf.o dad.o forall.o reference.o distarray.o disttarget.o definition.o transforall.o frefop.o \
       transprocstmt.o io.o assign.o detect_comm.o

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

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

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

all: Makefile $(PROGRAM)

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

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

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

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

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


############
# file dependence information
############

hf.o: anls_att.h ../xsageop/fromsage++.h
dad.o: anls_att.h  ../xsageop/fromsage++.h
forall.o: anls_att.h  ../xsageop/fromsage++.h
reference.o: anls_att.h ../xsageop/fromsage++.h
disttarget.o: anls_att.h ../xsageop/fromsage++.h
distarray.o: anls_att.h ../xsageop/fromsage++.h
definition.o: anls_att.h ../xsageop/fromsage++.h
transforall.o: anls_att.h ../xsageop/fromsage++.h
frefop.o: anls_att.h ../xsageop/fromsage++.h
transprocstmt.o: anls_att.h ../xsageop/fromsage++.h
io.o: anls_att.h ../xsageop/fromsage++.h
assign.o: anls_att.h ../xsageop/fromsage++.h  

detect_comm.o: detect_comm.h

#############

location = ${prefix}/src
test:
	@echo ${target}
	${location}/hpf2dep/hpf2dep ${target}.f
	${location}/hpfsc/hpfsc -c ${target}.dep
	${location}/tools/dump/dumpdep ${target}.dep > ${target}.dep.lnk
	${location}/tools/unparse/unparse ${target}.dep > ${target}.dep.src










