####################################################################
#   Copyright (c)
#
#   You may copy, distribute, and modify it freely as long as you  #
#   preserve distribute, and modify it freely as long as you       # 
#   preserve this copyright and permission notice.                 #
#                                                                  #
#
####################################################################

#
#  Makefile for Adlib/src/include  
#

SHELL       = /bin/sh

srcdir      = @srcdir@
top_src_dir = @top_srcdir@

prefix      = @prefix@
exec_prefix = @exec_prefix@

includedir  = @includedir@

INSTALL     = cp

VPATH       = .:${srcdir}

all: ad++.h transformations.h

ad++.h : adlib.h Seq.h SArray.h Array.h
	touch ${srcdir}/ad++.h

adlib.h : MPIinclude.h Procs.h Range.h Frame.h threads.h ProcTree.h \
	schedule.h TreeSchedule.h MessSchedule.h \
	DataSchedule.h Remap.h Reduce.h Gather.h io.h block.h
	touch ${srcdir}/adlib.h

Range.h : RangeRep.h CollapsedRangeRep.h BlockRangeRep.h CyclicRangeRep.h StepRangeRep.h
	touch ${srcdir}/Range.h

block.h: block.h.in
	generate_block

Array.h: Array.h.in
	generate_Array

transformations.h: transformations.h.in
	generate_transformations

clean:
	rm -f transformations.h Array.h block.h

distclean:
	rm -f Makefile config.h 

install: 
	if [ ! -d ${includedir} ] ; then mkdir ${includedir} ; fi
	for i in Array.h                Gather.h               Reduce.h               Sum.h                  io.h \
	MPIinclude.h           Remap.h                TreeSchedule.h         platform.h \
	BlockRangeRep.h        MessSchedule.h         SArray.h               ad++.h                 schedule.h \
	CollapsedRangeRep.h    ProcTree.h             SFrame.h               adlib.h                adtags.h     \
	CyclicRangeRep.h       Procs.h                Seq.h                  admacros.h             threads.h  \
	DataSchedule.h         Range.h                StepRangeRep.h         block.h   \
	Frame.h                RangeRep.h             globals.h;\
	do ($(INSTALL) ${srcdir}/$$i ${includedir}); done

uninstall:
	for i in Array.h                Gather.h               Reduce.h               Sum.h                  io.h \
	MPIinclude.h           Remap.h                TreeSchedule.h         platform.h \
	BlockRangeRep.h        MessSchedule.h         SArray.h               ad++.h                 schedule.h \
	CollapsedRangeRep.h    ProcTree.h             SFrame.h               adlib.h                adtags.h     \
	CyclicRangeRep.h       Procs.h                Seq.h                  admacros.h             threads.h  \
	DataSchedule.h         Range.h                StepRangeRep.h         block.h   \
	Frame.h                RangeRep.h             globals.h;\
	do (rm -f ${includedir}/$$i); done

	  


