# 
# $Id: Makefile.in,v 1.3.2.4 2000/07/03 11:07:03 yamauchi Exp $
#	for (M\pi)^2 : mpi2dataReader
#	(C) Copyright 1999 By YAMAUCHI Hitoshi 山内斉
# 	
# X を仮定しにくくなってきたので，環境に依存する部分を imake から configure 
# へと移行する．山内 1999年10月16日(土)
# 
#------------------------------
# compiler, library
#------------------------------
# CXX    	= g++
CXX	= @CXX@
CC     	= ${CXX}
RM	= @RM@ -f

LOCAL_LIBRARIES +=
SYS_LIBRARIES   += -lm

#------------------------------
# Debugging 
#------------------------------
#----- for profile
# CDEBUGFLAGS      = @WALLFLAG@ -pg
#----- for develop
# CDEBUGFLAGS      = @WALLFLAG@ -g
#----- for run
CDEBUGFLAGS      = 

CXXDEBUGFLAGS    = $(CDEBUGFLAGS)

#------------------------------
# Statistics 
#------------------------------
# MPI2STAT  = -DUSE_STAT -DCOUNT_SKIP_SPACE -DTRACE_RAY
# MPI2STAT  = -DTRACE_RAY
MPI2STAT  =

#------------------------------
#  compiler optimization option
#------------------------------
#----- for profile
# OPTIMIZE_OPT     = -O  -DNDEBUG -DREDUCE_VERBOSE_INFO
#----- for develop 
# OPTIMIZE_OPT     =
#----- for run
OPTIMIZE_OPT     = -O2 -DNDEBUG -DREDUCE_VERBOSE_INFO -DNO_OUT_SHADE_ERROR

#----------------------------------------------------------------------
# If you do not know the description of flags, do not edit under this
# line.  YAMAUCHI Hitoshi  
#----------------------------------------------------------------------
#----- for profile
# CFLAGS		= $(CDEBUGFLAGS) $(MPI2STAT) $(OPTIMIZE_OPT) -DMPI2 -DFOR_STANDALONE 
#----- for develop
# CFLAGS		= $(CDEBUGFLAGS) $(MPI2STAT) $(OPTIMIZE_OPT) -DMPI2 -DTRACE_RAY -DFOR_STANDALONE 
#----- for run
CFLAGS		= $(CDEBUGFLAGS) $(MPI2STAT) $(OPTIMIZE_OPT) -DMPI2 -DFOR_STANDALONE 
CXXFLAGS	= $(CFLAGS)


#----------------------------------------------------------------------
# do not edit under this line.  YAMAUCHI Hitoshi
#----------------------------------------------------------------------
# source file and objects
#----------------------------------------------------------------------
# 
# for read datafile (geometry, space, view, material) 	
#	実装の関係で read data files は 2 つに分割されている。
#      READMPI2BASEFILES にはテストできる読み込みルーチンが書かれてい
#	る。
#	最終的には READMPI2FILES に統一されると良い。
#------------------------------
READMPI2BASEFILES = 					\
	mpi2ReaderClass.cc 				\
	triangleObject.cc sphereObject.cc		\
	material.cc ray.cc vector.cc			\
	getvals.cc myString.cc fileUtil.cc 		\
	SLList.cc DLList.cc outputObjectSize.cc


READMPI2FILES = ${READMPI2BASEFILES}			\
	spc2PE.cc objectSet.cc objectDatas.cc		\
	readSysinfo.cc readSpcParam.cc readView.cc 	\
	getopt.cc lineParser.cc FileInfo.cc 

#------------------------------
# Ray-Tracing
#------------------------------
RAYTRACEFILES	=					\
	calcRayTrFRG.cc calcRayTrIC.cc calcRayTrSRG.cc	\
	PERayTracing.cc calcRayTrSRGDist.cc frustumSRG.cc

#------------------------------
# Radiosity 
#------------------------------
RADIOSITYFILES	=					\
	calcRadioFRG.cc calcRadioIC.cc hemicube.cc	\
	PERadiosity.cc  calcRadioSRG.cc

#------------------------------
#  Multi-Pass Common and Units 
#------------------------------
#
# 3DDDA 
# 
DDAFILES	=  					\
	ddaInfo.cc searchNextSpcDDA.cc PEGetNextSpace.cc	

#
# Proximitry Clouds 
# 
PRCFILES	=  					\
	PRC_PErecvStandAlone.cc PRC_readDistInfo.cc 	\
	PRC_searchNextSpc.cc PRC_deliverSkipInfo.cc

#
# communication
# 
COMMONUNITFILES = ${DDAFILES} ${PRCFILES}		\
	host.cc hostNetIntUnit.cc PE.cc NetIntUnit.cc	\
	prepareShading.cc frameBuffer.cc

#
# for volume rendering
#
VOLUMEFILES	= 					\
	volumeInit.cc volumeRayCast.cc			\
	PEvolume.cc hostVolume.cc volumeSerializable.cc	\
	readVolumeInfile.cc volumeReader.cc volume.cc	\
	pnmReader.cc volumeSet.cc deliverVolume.cc	\
	boundtest.cc 
#
# for stand alone
#
STANDALONEFILES = 					\
	main.cc mpi2communStandAlone.cc PErecvStandAlone.cc

#------------------------------
# ALL Source Files
#------------------------------
FILES	= 						\
	${COMMONUNITFILES} ${VOLUMEFILES} 		\
	${RAYTRACEFILES}   ${RADIOSITYFILES} 		\
	${READMPI2FILES} 				\
	${STANDALONEFILES}

#------------------------------
# objects
#------------------------------
OBJS  = ${FILES:.cc=.o}

#----------------------------------------------------------------------
# targets
#----------------------------------------------------------------------
PROGRAM = mpi21PE

all: $(PROGRAM)

# mylink:
# 	chmod u+x linkfor1PE.sh

mpi21PE: $(OBJS) $(DEPLIBS)
	$(RM) $@
	$(CXX) -o $@ $(CXXFLAGS) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES)

depend:
	$(CXX) -MM $(CFLAGS) $(FILES) > Makefile.depend

etags:
	find . \( -name '*.cc' -o -name '*.h' \) -print | xargs etags -d -t -a
	@echo "\`TAGS' is updated."

#----------------------------------------------------------------------
# include dependencies
#----------------------------------------------------------------------
include Makefile.depend

#----------------------------------------------------------------------
# common rules for all Makefiles - do not edit
#----------------------------------------------------------------------
.c.i:
	$(RM) $@
	 $(CC) -E $(CFLAGS) $(_NOOP_) $*.c > $@

emptyrule::

clean::
	$(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut *.core "#"* ${PROGRAM} a a.out 
	$(RM) -r Templates.DB

distclean::	clean
	$(RM) config.log config.cache config.status
	# chmod u+x dellink.sh
	# dellink.sh
