Index: /trunk/SophyaLib/Mgr/makefile.darwin
===================================================================
--- /trunk/SophyaLib/Mgr/makefile.darwin	(revision 2150)
+++ /trunk/SophyaLib/Mgr/makefile.darwin	(revision 2150)
@@ -0,0 +1,212 @@
+# include files defining compiler/linker options 
+MODULECXXREPNAME := PI
+include Mgr/Makefile.h
+include Mgr/Makefile.slb
+
+LIBF =  $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a
+LIBS = -L$(LIB) -lBaseTools -lSysTools -lSUtils -lTArray -lNTools -lHiStats -lSkyMap -lSamba -lSkyT
+
+defaut: libs
+
+all: libs extlibs PI
+
+libs: cxxlibs
+
+extlibs: cxxextlibs
+
+cxxlibs:  BaseTools SysTools SUtils TArray NTools HiStats SkyMap Samba SkyT
+
+cxxextlibs:  FitsIOServer IFFTW LinAlg XAstroPack
+# cxxextlibs:  FitsIOServer 
+
+#--- Create directory and copy includes for install
+depend:
+ifdef DPCDEVREP
+ifdef EROSCXX
+	@echo "Sophya will be installed under:"
+	@echo "  $(DPCDEVREP)/Include" 
+	@echo "  $(DPCDEVREP)/`uname`-$(EROSCXX)" 
+	if [ -d Mgr ] ; then cd Mgr; \
+	./crerep_sophya $(DPCDEVREP) `uname`-$(EROSCXX); \
+	./makefileuser.csh; \
+	./mkmflien -copy ; \
+	fi
+else
+	@echo "Variable EROSCXX must be define with setenv"
+endif
+else
+	@echo "Variable DPCDEVREP must be define with setenv"
+endif
+#--------------------------------------------------------------------
+
+.PHONY:  BaseTools
+BaseTools:
+	if [ -d BaseTools ] ; then cd  BaseTools ; $(MAKE) ; fi
+
+.PHONY:  SysTools
+SysTools:
+	if [ -d SysTools ] ; then cd  SysTools ; $(MAKE) ; fi
+
+.PHONY:  SUtils
+SUtils:
+	if [ -d SUtils ] ; then cd  SUtils ; $(MAKE) ; fi
+ 
+.PHONY:  TArray
+TArray:
+	if [ -d TArray ] ; then cd  TArray ; $(MAKE) ; fi
+ 
+.PHONY:  NTools
+NTools:
+	if [ -d NTools ] ; then cd  NTools ; $(MAKE) ; fi
+ 
+.PHONY:  HiStats
+HiStats:
+	if [ -d HiStats ] ; then cd  HiStats ; $(MAKE) ; fi
+ 
+.PHONY:  SkyMap
+SkyMap:
+	if [ -d SkyMap ] ; then cd  SkyMap ; $(MAKE) ; fi
+ 
+.PHONY:  Samba
+Samba:
+	if [ -d Samba ] ; then cd  Samba ; $(MAKE) ; fi
+ 
+.PHONY:  SkyT
+SkyT:
+	if [ -d SkyT ] ; then cd  SkyT ; $(MAKE) ; fi
+ 
+.PHONY:  FitsIOServer
+FitsIOServer:
+	if [ -d FitsIOServer ] ; then cd  FitsIOServer ; $(MAKE) ; fi
+ 
+.PHONY:  IFFTW
+IFFTW:
+	if [ -d IFFTW ] ; then cd  IFFTW ; $(MAKE) ; fi
+ 
+.PHONY:  LinAlg
+LinAlg:
+	if [ -d LinAlg ] ; then cd  LinAlg ; $(MAKE) ; fi
+ 
+.PHONY:  XAstroPack
+XAstroPack:
+	if [ -d XAstroPack ] ; then cd  XAstroPack ; $(MAKE) ; fi
+ 
+.PHONY: PI
+PI:
+	if [ -d PI ] ; then cd PI ; $(MAKE) ; fi
+	if [ -d PIGcont ] ; then cd PIGcont ; $(MAKE) ; fi
+	if [ -d PIext ] ; then cd PIext ; $(MAKE) ; fi
+#  Shared library creation part of the Makefile
+ 
+#  List of libraries (.a)
+PSLB =  $(LIB)libBaseTools.a $(LIB)libSysTools.a $(LIB)libSUtils.a $(LIB)libTArray.a $(LIB)libNTools.a $(LIB)libHiStats.a $(LIB)libSkyMap.a $(LIB)libSamba.a $(LIB)libSkyT.a $(LIB)libSysSpec.a
+#EXTPSLB =  $(LIB)libFitsIOServer.a $(LIB)libIFFTW.a $(LIB)libLinAlg.a $(LIB)libXAstroPack.a
+EXTPSLB =  $(LIB)libFitsIOServer.a 
+PIPSLB =  $(LIB)libPIext.a $(LIB)libPI.a $(LIB)libPIGcont.a 
+
+#  List of external library references
+EXTLIBL  = -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+EXTSLBL  = -L$(EXTSLBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+#EXTLIBL  = -L$(EXTLIBPATH) -lcfitsio 
+#EXTSLBL  = -L$(EXTSLBPATH) -lcfitsio 
+
+# defining the other external libraries needed on different systems
+
+# On Linux   lapack and blas and f2c/g2c ere needed
+ifeq ($(MACHEROS),Linux)
+#EXTLIB = $(EXTLIBL) -llapack -lblas -lf2c
+#EXTSLB = $(EXTSLBL) -llapack -lblas -lf2c
+EXTLIB = $(EXTLIBL) -llapack -lblas -lg2c
+EXTSLB = $(EXTSLBL) -llapack -lblas -lg2c
+endif
+
+# On Linux   lapack and blas and f2c/g2c ere needed
+# ifeq ($(MACHEROS),Darwin)
+# EXTLIB = $(EXTLIBL) -llapack -lblas -lg2c
+# EXTSLB = $(EXTSLBL) -llapack -lblas -lg2c
+# endif
+
+# On OSF1 libdxml contains Lapack, but the fortran support library is needed
+ifeq ($(MACHEROS),OSF1)
+EXTLIB = $(EXTLIBL) -ldxml -lfor
+EXTSLB = $(EXTSLBL) -ldxml -lfor
+endif
+
+# On IRIX , complib.sgimath contains Lapack
+ifeq ($(MACHEROS),IRIX64)
+EXTLIB = $(EXTLIBL) -lcomplib.sgimath 
+EXTSLB = $(EXTSLBL) -lcomplib.sgimath 
+endif
+
+EXTLIB = $(EXTLIBL) 
+EXTSLB = $(EXTSLBL) 
+
+
+XPILIBS = $(LIBXPIPATH) $(LIBXPILIST)
+
+#  main dependence list
+slball : slb slbext slbpi 
+slb : $(SLB)libsophya.dylib 
+slbext : $(SLB)libextsophya.dylib   
+slbpi : $(SLB)libPI.dylib
+ 
+# List of .o files for each module
+OBJBaseTools = $(shell echo `cat ./BaseTools/objlist.list `)
+OBJSysTools = $(shell echo `cat ./SysTools/objlist.list `)
+OBJSUtils = $(shell echo `cat ./SUtils/objlist.list `)
+OBJTArray = $(shell echo `cat ./TArray/objlist.list `)
+OBJNTools = $(shell echo `cat ./NTools/objlist.list `)
+OBJHiStats = $(shell echo `cat ./HiStats/objlist.list `)
+OBJSkyMap = $(shell echo `cat ./SkyMap/objlist.list `)
+OBJSamba = $(shell echo `cat ./Samba/objlist.list `)
+OBJSkyT = $(shell echo `cat ./SkyT/objlist.list `)
+OBJSysSpec = $(shell echo `cat ./SysSpec/objlist.list `)
+ALLOBJS = $(OBJBaseTools) $(OBJSysTools) $(OBJSUtils) $(OBJTArray) $(OBJNTools) $(OBJHiStats) $(OBJSkyMap) $(OBJSamba) $(OBJSkyT) $(OBJSysSpec) 
+ 
+# List of .o files modules with reference to external libraries
+OBJFitsIOServer = $(shell echo `cat ./FitsIOServer/objlist.list `)
+OBJIFFTW = $(shell echo `cat ./IFFTW/objlist.list `)
+OBJLinAlg = $(shell echo `cat ./LinAlg/objlist.list `)
+OBJXAstroPack = $(shell echo `cat ./XAstroPack/objlist.list `)
+# ALLEXTOBJS = $(OBJFitsIOServer) $(OBJIFFTW) $(OBJLinAlg) $(OBJXAstroPack)
+ALLEXTOBJS = $(OBJFitsIOServer) $(OBJIFFTW) $(OBJXAstroPack)
+# ALLEXTOBJS = $(OBJFitsIOServer) 
+
+# List of .o files for PI modules 
+OBJPI = $(shell echo `cat ./PI/objlist.list `)
+OBJPIGcont = $(shell echo `cat ./PIGcont/objlist.list `)
+OBJPIext = $(shell echo `cat ./PIext/objlist.list `)
+ALLPIOBJS = $(OBJPIext) $(OBJPI)  $(OBJPIGcont) 
+# ALLPIOBJS = $(OBJPI)  $(OBJPIGcont) 
+ 
+# Building Sophya shared library
+$(SLB)libsophya.dylib : $(PSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libsophya.dylib  \
+	$(FGSHLACXX) $(ALLOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) $(LIBLSHL)
+ 
+# Building ExtSophya shared library
+$(SLB)libextsophya.dylib : $(EXTPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libextsophya.dylib  \
+	$(FGSHLACXX) $(ALLEXTOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) -lsophya $(EXTLIB) $(LIBLSHL)
+ 
+# Building PI shared library
+$(SLB)libPI.dylib : $(PIPSLB)
+	$(CMDTILSHL) 
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(SLB)libPI.dylib  \
+	$(FGSHLACXX) $(ALLPIOBJS) $(FGSHLNCXX) \
+	-L$(SLB) -lextsophya -lsophya -L/sw/lib -L/usr/X11R6/lib -lXm -lXt -lX11  $(LIBLSHL)
+ 
+
+clean:
+	if [ -d $(LIB) ] ; then cd $(LIB)/. ; rm -f *.a  ; fi
+	if [ -d $(SLB) ] ; then cd $(SLB)/. ; rm -f *.so ; fi
+	if [ -d $(OBJ) ] ; then cd $(OBJ)/. ; rm -f *.o  rm -rf cxxrep* ; fi
+#	if [ -d PI ]     ; then cd PI/.     ; $(MAKE) clean ; fi
+
