Index: /trunk/ArchTOIPipe/README
===================================================================
--- /trunk/ArchTOIPipe/README	(revision 1980)
+++ /trunk/ArchTOIPipe/README	(revision 1980)
@@ -0,0 +1,53 @@
+# ####################### ArchTOIPipe ###########################
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+# ###############################################################
+
+
+List of modules
+----------------
+
+   * Kernel : ArchTOIPipe architecture definition
+   * Processors : Basic processors/ independent of SOPHYA library
+   * ProcWSophya : Procssors using SOPHYA library
+   * TestPipes :  Simple assembled pipe test programs
+
+Build/Install instructions
+--------------------------
+
+   Two different procedures can be used to build ArchTOIPipe
+
+   1/ using configure
+
+      - Create a temporay build directory
+      csh> mkdir archtmp
+      csh> cd archtmp/
+      - Run the configure script 
+      csh> $ARCHSRC/configure --help 
+      - To build with sophya   
+      csh> ~/ArchTOIPipe/configure --with-sophya --prefix=/usr/local/ArchTOI
+      csh> make
+
+
+   2/ Using the scripts and makefiles suitable to be used with SOPHYA
+      (**** GNU make program should be used ****)
+      The SOPHYA environment should already be setup (DPCBASEREP)
+      
+      - Define the ArchTOIPipe build directory
+      csh> setenv ARCHPDEVREP /usr/local/Pipe
+      - Create the build directory tree
+      csh> ./crerep_pipe $ARCHPDEVREP
+      - Generate the libray module makefiles
+      csh> make -f SMakefile mkmf
+      - Build the libraries (libKernel.a libProcessors.a libProcWSophya.a
+      csh> make -f SMakefile libs
+      - Build the shared libraries (libpipe.so)
+      csh> make -f SMakefile slb
+      - Build some of the test programs
+      csh> cd TestPipes
+      csh> make -f SMakefile mesovh simtst
+
+
+
+
+NOTE:  To run the programs built with shared libraries, the LD_LIBRARY_PATH 
+-----  variable should be set.
Index: /trunk/ArchTOIPipe/SMakefile
===================================================================
--- /trunk/ArchTOIPipe/SMakefile	(revision 1979)
+++ /trunk/ArchTOIPipe/SMakefile	(revision 1980)
@@ -1,147 +1,123 @@
-USERFLAGS = -I$(EXTLIBDIR)/Include/FitsIO -DWITH_SOPHYA
-include $(DPCBASEREP)/Include/MakefileUser.h
+# ####################### ArchTOIPipe ###########################
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+# ###############################################################
+#   Top level makefile to build ArchTOIPipe library with SOPHYA
+# Usage : make -f SMakefile mkmf
+#         make -f SMakefile libs
+#         make -f SMakefile slb 
+# ###############################################################
 
-ALIB := ./$(MACHDIR)/
-AOBJ := ./$(MACHDIR)/
+# include files defining compiler/linker options 
+include SMakefile.h
+include ${DPCBASEREP}/Include/Makefile.slb
 
-$(AOBJ)%.o:%.cc
-	$(COMPILE.cc) $(USERFLAGS) -o $@ $<
-$(AOBJ)%.o:%.c
-	$(COMPILE.c) $(CFLAGS) $(USERFLAGS) -o $@ $<
+LIBF =  $(MYLIB)libKernel.a $(MYLIB)libProcessors.a $(MYLIB)libProcWSophya.a
 
-LIBOLIST := $(AOBJ)asciitoiwtr.o $(AOBJ)fitstoirdr.o $(AOBJ)fitstoiwtr.o \
-            $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)genwproc.o \
-            $(AOBJ)toisqfilter.o $(AOBJ)toiregwindow.o $(AOBJ)toiseqbuff.o \
-            $(AOBJ)toisegment.o \
-            $(AOBJ)simtoipr.o $(AOBJ)map2toi.o $(AOBJ)toi2map.o $(AOBJ)nooppr.o
-EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o $(AOBJ)simtst.o \
-            $(AOBJ)tstrztoi.o $(AOBJ)rztoi.o $(AOBJ)sfftc.o $(AOBJ)mesovh.o \
-            $(AOBJ)fits2ascii.o $(AOBJ)tgenw.o $(AOBJ)tstmap2toi.o $(AOBJ)tsttoi2map.o \
-            $(AOBJ)tstflag.o $(AOBJ)tstdemopipe.o
-EXELIST := $(AOBJ)sfftc $(AOBJ)simtst $(AOBJ)mesovh $(AOBJ)tstrztoi $(AOBJ)fits2asc $(AOBJ)tsttoi \
-           $(AOBJ)tsttoi2 $(AOBJ)fits2ascii $(AOBJ)tgenw $(AOBJ)tstmap2toi $(AOBJ)tsttoi2map \
-           $(AOBJ)tstflag $(AOBJ)tstdemopipe
+defaut: libs
 
-INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \
-           toiprocessor.h genwproc.h toimanager.h toiseqbuff.h toiregwindow.h \
-           simtoipr.h map2toi.h toi2map.h nooppr.h toisegment.h
+all: libs slb
 
-all : $(EXELIST) 
-lib : $(LIBOLIST)
+
+libs: archlibs
+slb: archslb
+
+archlibs: Kernel Processors ProcWSophya
+
+#--- Create directory and copy includes for install
+depend:
+ifdef ARCHPDEVREP
+ifdef EROSCXX
+	@echo "ArchTOIPipe will be installed under:"
+	@echo "  $(ARCHPDEVREP)/Include" 
+	@echo "  $(ARCHPDEVREP)/`uname`-$(EROSCXX)" 
+	./crerep_pipe $(ARCHPDEVREP) `uname`-$(EROSCXX); \
+#	./makefileuser.csh; \
+	./mkmflien -copy ; \
+else
+	@echo "Variable EROSCXX must be define with setenv"
+endif
+else
+	@echo "Variable ARCHPDEVREP must be define with setenv"
+endif
+#--------------------------------------------------------------------
+
+#--- Create library module Makefiles
+mkmf:
+	@echo 'Running ./smkmf'
+	./smkmf
+#--------------------------------------------------------------------
+
+.PHONY:  Kernel
+Kernel:
+	if [ -d Kernel ] ; then cd  Kernel ; $(MAKE) ; fi
+
+.PHONY:  Processors
+Processors:
+	if [ -d Processors ] ; then cd  Processors ; $(MAKE) ; fi
+
+.PHONY:  ProcWSophya
+ProcWSophya:
+	if [ -d ProcWSophya ] ; then cd  ProcWSophya ; $(MAKE) ; fi
+
+#  Shared library creation part of the Makefile
+ 
+#  List of libraries (.a)
+PSLB =  $(MYLIB)libKernel.a $(MYLIB)libProcessors.a $(MYLIB)libProcWSophya.a
+
+#  List of external library references
+EXTLIBL  = -L$(EXTLIBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+EXTSLBL  = -L$(EXTSLBPATH) -lcfitsio -lfftw -lrfftw -lxastro
+
+# 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 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
+
+
+
+# XPILIBS = $(LIBXPIPATH) $(LIBXPILIST)
+
+#  main dependence list
+archslb : $(SLB)libpipe.so 
+ 
+# List of .o files for each module
+# OBJKernel = $(shell echo `cat ./Kernel/objlist.list `)
+# OBJProcessors = $(shell echo `cat ./Processors/objlist.list `)
+# OBJProcWSophya = $(shell echo `cat ./ProcWSophya/objlist.list `)
+OBJKernel = $(shell echo `cat ./Kernel/Kernel.o.list `)
+OBJProcessors = $(shell echo `cat ./Processors/Processors.o.list `)
+OBJProcWSophya = $(shell echo `cat ./ProcWSophya/ProcWSophya.o.list `)
+
+ALLOBJS = $(OBJKernel) $(OBJProcessors) $(OBJProcWSophya) 
+ 
+# Building ArchTOIPipe shared library
+$(SLB)libpipe.so : $(PSLB)
+	cd  $(OBJ); \
+	$(CMDSHLCXX) -o $(MYSLB)libpipe.so  \
+	$(FGSHLACXX) $(ALLOBJS)  $(FGSHLNCXX)\
+	-L$(SLB) -lsophya -lextsophya $(EXTLIB) $(LIBLSHL)
+ 
+ 
 
 clean:
-	rm -f  $(LIBOLIST)
-	rm -f  $(EXEOLIST)
-	rm -f  $(EXELIST)
+	if [ -d $(MYLIB) ] ; then cd $(MYLIB)/. ; rm -f *.a  ; fi
+	if [ -d $(MYSLB) ] ; then cd $(MYSLB)/. ; rm -f *.so ; fi
+	if [ -d $(OBJ) ] ; then cd $(OBJ)/. ; rm -f *.o  rm -rf cxxrep* ; fi
 
-LIBF =  $(SLB)libsophya.so $(SLB)libextsophya.so 
-LIBS =  -L$(SLB) -lextsophya -lsophya -lpthread -lm
-####ifeq ($(MACHEROS),OSF1)
-####LIBS := $(LIBS) -lfor
-####endif
-
-########################################
-#### Les Executables des Programmes ####
-########################################
-tstrztoi: $(AOBJ)tstrztoi
-	@echo done
-$(AOBJ)tstrztoi: $(AOBJ)tstrztoi.o $(AOBJ)rztoi.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-sfftc: $(AOBJ)sfftc
-	@echo done
-$(AOBJ)sfftc: $(AOBJ)sfftc.o  $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-mesovh: $(AOBJ)mesovh
-	@echo done
-$(AOBJ)mesovh: $(AOBJ)mesovh.o  $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-simtst: $(AOBJ)simtst
-	@echo done
-$(AOBJ)simtst: $(AOBJ)simtst.o  $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-fits2asc: $(AOBJ)fits2asc
-	@echo done
-$(AOBJ)fits2asc: $(AOBJ)fits2asc.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tsttoi: $(AOBJ)tsttoi
-	@echo done
-$(AOBJ)tsttoi: $(AOBJ)tsttoi.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tsttoi2: $(AOBJ)tsttoi2
-	@echo done
-$(AOBJ)tsttoi2: $(AOBJ)tsttoi2.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-fits2ascii: $(AOBJ)fits2ascii
-	@echo done
-$(AOBJ)fits2ascii: $(AOBJ)fits2ascii.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tgenw: $(AOBJ)tgenw
-	@echo done
-$(AOBJ)tgenw: $(AOBJ)tgenw.o  $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tstmap2toi: $(AOBJ)tstmap2toi
-	@echo done
-$(AOBJ)tstmap2toi: $(AOBJ)tstmap2toi.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tsttoi2map: $(AOBJ)tsttoi2map
-	@echo done
-$(AOBJ)tsttoi2map: $(AOBJ)tsttoi2map.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tstflag: $(AOBJ)tstflag
-	@echo done
-$(AOBJ)tstflag: $(AOBJ)tstflag.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-tstdemopipe: $(AOBJ)tstdemopipe
-	@echo done
-$(AOBJ)tstdemopipe: $(AOBJ)tstdemopipe.o $(LIBOLIST)
-	$(LINK.cc)  -o $@ $^ $(LIBS)
-
-################################################
-#### Compilation des Sources des Programmes ####
-################################################
-$(AOBJ)simtst.o: simtst.cc $(INCLIST)
-$(AOBJ)sfftc.o: sfftc.cc $(INCLIST)
-$(AOBJ)mesovh.o: mesovh.cc $(INCLIST)
-$(AOBJ)tstrztoi.o: tstrztoi.cc rztoi.h $(INCLIST)
-$(AOBJ)rztoi.o: rztoi.cc rztoi.h $(INCLIST)
-$(AOBJ)fits2asc.o: fits2asc.cc $(INCLIST)
-$(AOBJ)tsttoi.o: tsttoi.cc $(INCLIST)
-$(AOBJ)tsttoi2.o: tsttoi2.cc $(INCLIST)
-$(AOBJ)fits2ascii.o: fits2ascii.cc $(INCLIST)
-$(AOBJ)tgenw.o: tgenw.cc $(INCLIST)
-$(AOBJ)tstmap2toi.o: tstmap2toi.cc $(INCLIST)
-$(AOBJ)tsttoi2map.o: tsttoi2map.cc $(INCLIST)
-$(AOBJ)tstflag.o: tstflag.cc $(INCLIST)
-$(AOBJ)tstdemopipe.o: tstdemopipe.cc $(INCLIST)
-
-
-################################################
-#### Compilation des Sources des Librairies ####
-################################################
-$(AOBJ)asciitoiwtr.o: asciitoiwtr.cc asciitoiwtr.h toi.h config.h conf.h toiprocessor.h toimanager.h 
-$(AOBJ)fitstoirdr.o: fitstoirdr.cc fitstoirdr.h toiprocessor.h config.h conf.h
-$(AOBJ)fitstoiwtr.o: fitstoiwtr.cc fitstoiwtr.h toi.h config.h conf.h
-$(AOBJ)toi.o: toi.cc toiprocessor.h config.h conf.h toi.h 
-$(AOBJ)toimanager.o: toimanager.cc toimanager.h
-$(AOBJ)toiprocessor.o: toiprocessor.cc toiprocessor.h config.h conf.h toi.h toimanager.h
-$(AOBJ)genwproc.o: genwproc.h toiprocessor.h toimanager.h
-$(AOBJ)toisqfilter.o: toisqfilter.cc toisqfilter.h toiprocessor.h config.h conf.h toi.h toimanager.h
-$(AOBJ)toiseqbuff.o: toiseqbuff.cc toiprocessor.h config.h conf.h toi.h toiseqbuff.h 
-$(AOBJ)toiregwindow.o: toiregwindow.cc toiprocessor.h config.h conf.h toi.h toiregwindow.h 
-$(AOBJ)simtoipr.o: simtoipr.cc toiprocessor.h config.h conf.h toi.h simtoipr.h 
-$(AOBJ)map2toi.o: map2toi.cc map2toi.h 
-$(AOBJ)toi2map.o: toi2map.cc toi2map.h 
-$(AOBJ)nooppr.o: nooppr.cc nooppr.h 
-$(AOBJ)toisegment.o: toisegment.cc toiprocessor.h config.h conf.h toi.h
Index: /trunk/ArchTOIPipe/SMakefile.h
===================================================================
--- /trunk/ArchTOIPipe/SMakefile.h	(revision 1980)
+++ /trunk/ArchTOIPipe/SMakefile.h	(revision 1980)
@@ -0,0 +1,46 @@
+#  -*- makefile -*-
+# ################## ArchTOIPipe-With-Sophya #################### 
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+# ############################################################### 
+#  Global definitions to be used for ArchTOIPipe makefiles 
+#  with SOPHYA (Uses Sophya/Makefile.h)
+#---------------------------------------------------------------------------
+
+MYBUILDDEVREP := ${ARCHPDEVREP}
+
+include ${DPCBASEREP}/Include/Makefile.h
+
+#-
+#-   Define ArchTOIPipe build paths
+#-  
+APP  := ${ARCHPDEVREP}/${MACHDIR}/
+ALIB := ${APP}/Libs/
+ASLB := ${APP}/ShLibs/
+OBJ  := ${APP}/Objs/
+# AOBJ := ${APP}/Objs/
+AEXE := ${APP}/Exec/
+AINC := ${ARCHPDEVREP}/Include/
+#--
+
+
+CPPFLAGS     :=  ${CPPFLAGS} -I${AINC} -I${EXTINCPATH}/FitsIO -DWITH_SOPHYA
+
+#- redefine implicit rule. Les .o sont dans $(OBJ).
+#$(AOBJ)%.o:%.c
+#	$(COMPILE.c) -o $@ $<
+
+#$(AOBJ)%.o:%.cc
+#	$(COMPILE.cc) -o $@ $<
+
+#$(AOBJ)%.o:%.f
+#	$(COMPILE.f) -o $@ $< 
+
+#OSF1
+#LDFC est f77
+#LDFCFLAGS est rien
+
+#parfois
+#LDFC est cc
+#LDFCFLAGS est -ltruc
+
+#------------------------------------------------- End of Makefile.h ------- 
Index: /trunk/ArchTOIPipe/TestPipes/SMakefile
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/SMakefile	(revision 1980)
+++ /trunk/ArchTOIPipe/TestPipes/SMakefile	(revision 1980)
@@ -0,0 +1,70 @@
+# ####################### ArchTOIPipe ###########################
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+# ###############################################################
+#  Makefile to build test ArchTOIPipe programs with ArchTOIPipe
+#  and SOPHYA libraries
+#  DPCBASEREP (for SOPHYA) and ARCHPDEVREP variable should be 
+#  defined 
+#  Usage: make -f SMakefile name_of_program
+#  *** Warning: GNU make should be used  ***
+# ###############################################################
+
+include ../SMakefile.h
+include ${DPCBASEREP}/Include/Makefile.slb
+
+
+ifdef NOSHLIB
+
+LIBS = -L$(MYLIB) -lKernel -lProcessors -lProcWSophya \
+       -L$(LIB) -lFitsIOServer -lSamba -lSkyMap -lSkyT -lNTools \
+        -lHiStats -lTArray -lBaseTools -lSysTools -lm
+
+ifeq ($(CXX),cxx)
+# librairie des instances de templates cxx
+LIBS := $(LIBS) -lrt
+endif
+
+else
+
+LIBF =  $(MYSLB)libpipe.so  $(SLB)libextsophya.so $(SLB)libsophya.so 
+LIBS = -L$(MYSLB) -lpipe -L$(SLB) -lextsophya -lsophya -lpthread -lm 
+ifeq ($(MACHEROS),OSF1)
+LIBS := $(LIBS) -lfor
+endif
+ifeq ($(MACHEROS),Linux)
+LIBS := $(LIBS) -ldl -lf2c
+endif
+
+endif
+
+LDLIBS := $(LIBS) $(LDLIBS) 
+
+%:%.cc
+%:%.o
+%.o:%.cc
+%.o:%.c
+%:%.c
+
+.PRECIOUS: $(EXE)% $(OBJ)%.o
+
+%:$(EXE)%
+	echo $@ " done"
+
+$(EXE)%:$(OBJ)%.o
+	$(LINK.cc)  -o $@ $< $(LIBS)
+
+$(OBJ)%.o:%.cc
+	$(COMPILE.cc)   $(USERFLAGS) -o $@ $<
+
+$(EXE)%:$(OBJ)%.cc
+	$(LINK.cc) $(USERFLAGS)  -o $@ $< $(LIBS) 
+
+$(EXE)%:$(OBJ)%.c
+	$(LINK.c)  $(USERFLAGS) -o $@ $< $(LIBS) 
+
+$(OBJ)%.o:%.c
+	$(COMPILE.c) -c $(CFLAGS) $(USERFLAGS) -o $@ $< 
+
+dump :
+	echo $(LIBS)
+
Index: /trunk/ArchTOIPipe/crerep_pipe
===================================================================
--- /trunk/ArchTOIPipe/crerep_pipe	(revision 1980)
+++ /trunk/ArchTOIPipe/crerep_pipe	(revision 1980)
@@ -0,0 +1,56 @@
+#!/bin/csh
+
+# ################## ArchTOIPipe-With-Sophya #################### 
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+#  Script for setting up ArchTOIPipe build/install directory
+# ###############################################################  
+
+if( $#argv < 1 ) then
+  echo "crerep_pipe <nom des repertoires> [nom_machine-compilateur]"
+  echo " - ex: crerep_pipe "\$"GROUP_DIR/PeidaWork HP-UX"
+  echo " - possibilites nom_machine-compilateur"
+  echo "    [AIX-xlC AIX-g++ HP-UX-aCC HP-UX-g++ OSF1-cxx OSF1-g++ Linux-g++ ...]"
+  if($?EROSCXX) then
+    echo "    defaut: `uname`-$EROSCXX"
+  else
+    echo "    pas de defaut donnez explicitement nom_machine-compilateur"
+  endif
+  exit -1
+endif
+
+set dirl = $1
+if ( ! -e ${dirl} ) then
+  echo ATTENTION REPERTOIRE INEXISTANT:
+  echo ${dirl}
+  exit -1
+endif
+echo "rep. de base: ${dirl}"
+
+shift
+if( $#argv > 0 ) then
+  set diru = $1
+  echo "machine-compilateur: ${diru}"
+else if ($?EROSCXX) then
+  echo uname=`uname` EROSCXX = $EROSCXX
+  set diru = `uname`-$EROSCXX
+  echo "AUTOMATIQUE machine-compilateur: ${diru}"
+else
+  echo "precisez nom_machine-compilateur ou EROSCXX"
+  exit -1
+endif
+
+foreach d ( ${dirl}/${diru} \
+            ${dirl}/Include \
+            ${dirl}/${diru}/Exec \
+            ${dirl}/${diru}/Libs ${dirl}/${diru}/ShLibs \
+            ${dirl}/${diru}/Objs )
+  if ( -e $d ) then
+    echo "rep. existant: $d"
+  else
+    echo "rep. cree: $d"
+    mkdir $d
+  endif
+end
+
+exit 0
+
Index: /trunk/ArchTOIPipe/smkmf
===================================================================
--- /trunk/ArchTOIPipe/smkmf	(revision 1980)
+++ /trunk/ArchTOIPipe/smkmf	(revision 1980)
@@ -0,0 +1,17 @@
+#!/bin/csh
+
+# ################## ArchTOIPipe-With-Sophya #################### 
+#  Top level script for ArchTOIPipe library module makefile 
+#  generation and Include directory setup
+# ###############################################################  
+
+echo 'Creating ArchTOIPipe library module Makefiles'
+echo ' ----- Running ./smkmflien'
+./smkmflien
+echo ' ----- Running ./smkmflib Kernel'
+./smkmflib Kernel
+echo ' ----- Running ./smkmflib Processors'
+./smkmflib Processors
+echo ' ----- Running ./smkmflib ProcWSophya'
+./smkmflib ProcWSophya
+exit 0
Index: /trunk/ArchTOIPipe/smkmflib
===================================================================
--- /trunk/ArchTOIPipe/smkmflib	(revision 1980)
+++ /trunk/ArchTOIPipe/smkmflib	(revision 1980)
@@ -0,0 +1,101 @@
+#!/bin/csh
+
+# ################## ArchTOIPipe-With-Sophya #################### 
+# ##### LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA #####
+#  Script for ArchTOIPipe library module makefile generation
+#  Usage: ./mkmflib lib_module_name
+# ###############################################################  
+
+cd $1
+
+if ( ! -f exclude ) touch exclude
+if ( ! -f flags_compil ) touch flags_compil
+if ( ! -f extlib_list ) touch extlib_list
+if ( ! -f extslb_list ) touch extslb_list
+
+if ( ! $?TMPDIR ) set TMPDIR = /tmp
+sort exclude >! $TMPDIR/exclude.sort
+
+##############################################
+########### fichier de la liste des .o #######
+##############################################
+
+set liblist = $1.o.list
+rm -f $liblist
+touch $liblist
+ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' >> $liblist
+unset liblist
+
+##############################################
+########### Creation de GNUmakefile ##########
+##############################################
+
+set libf='$(MYLIB)lib'$1'.a'
+
+#set hfcxxlibs = '-L$(LIB)' 
+#set i = 1
+#while ($i <= $#argv)
+#  set hfcxxlibs = "$hfcxxlibs -l$argv[$i]"
+#  @ i++
+#end
+
+#set extlib_list = `cat extlib_list`
+#set hfcxxlibs = ($hfcxxlibs '-L$(EXTLIBPATH)' $extlib_list)
+
+rm -f GNUmakefile
+touch GNUmakefile
+
+cat flags_compil >> GNUmakefile 
+echo 'include ../SMakefile.h' >> GNUmakefile 
+
+echo " " >> GNUmakefile
+echo 'all:' $libf  >> GNUmakefile 
+
+echo 'clean:' >> GNUmakefile
+set toto='rm -f'
+foreach f (*.cc *.c) 
+  set toto= ( $toto '$(OBJ)'$f:r.o )
+end
+echo '	'$toto >> GNUmakefile
+echo '	rm -f '$libf >> GNUmakefile
+
+echo $libf ':' \
+ `ls *.{c,cc} | comm -3 -1 $TMPDIR/exclude.sort - | sed -e 's/\.cc/.o/' | sed -e 's/\.c/.o/' | sed -e 's/^/$(OBJ)/'` >> GNUmakefile
+echo '	$(ARCXX) $(ARCXXFLAGS) $@ $($(ARARGS))' >> GNUmakefile
+#  Pour faire compiler les instantiations automatique de cxx (DEC)
+echo 'ifeq ($(CXX),cxx)' >> GNUmakefile
+#echo '	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS)' $hfcxxlibs '-o $(OBJ)xx.x -Hf' >> GNUmakefile
+echo '	$(CXX) $? $(CPPFLAGS) $(CXXFLAGS) -o $(OBJ)xx.x -Hf' >> GNUmakefile
+echo 'endif ' >> GNUmakefile
+
+rm -f $TMPDIR/exclude.sort
+
+echo " " >> GNUmakefile
+
+set inc = $DPCBASEREP/Include
+# set incxx = $inc/CxxInc
+set incext = $EXTLIBDIR/Include
+set incfitsio = $EXTLIBDIR/Include/FitsIO
+set ainc = $ARCHPDEVREP/Include
+set nomsys = `uname`
+
+foreach f ( *.cc )
+  grep -q '^'$f'$' exclude && continue
+  gcc -MM -D$nomsys -I$ainc -I$inc -I$incext -I$incfitsio $f  \
+#       | grep -v -e $inc -e $incfitsio -e $incext \
+       | sed -e 's/.*\.o/\$(OBJ)&/'  >> GNUmakefile
+#       | sed -e 's?'$inc/'?$(AINC)?g' \
+#       | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
+end
+
+foreach f ( *.c )
+  grep -q '^'$f'$' exclude && continue
+  gcc -MM -D$nomsys -I$ainc -I$inc -I$incext -I$incfitsio $f  \
+       | sed -e 's/.*\.o/\$(OBJ)&/'  >> GNUmakefile
+#       | sed -e 's?'$ainc/'?$(AINC)?g' >> GNUmakefile
+#       | sed -e 's?'$incext/'?$(EXTINCPATH)?g' >> GNUmakefile
+end 
+
+
+
+
Index: /trunk/ArchTOIPipe/smkmflien
===================================================================
--- /trunk/ArchTOIPipe/smkmflien	(revision 1980)
+++ /trunk/ArchTOIPipe/smkmflien	(revision 1980)
@@ -0,0 +1,109 @@
+#!/bin/csh
+# $Id: smkmflien,v 1.1 2002-05-03 15:05:31 ansari Exp $
+
+# ################## ArchTOIPipe-With-Sophya #################### 
+#Adaptation SOPHYA/Mgr/mkmflien a smkmflien pour ArchTOIPipe
+#                             Reza - Mai 2002
+# usage : smkmflien [-copy] [dir_dest]
+#  -copy : includes are copied (if not they are linked)
+#  -clean : after copy/link file are deleted if not existing (empty link)
+#  dir_dest : link/copy to dir_dest/
+#             default : $ARCHPDEVREP/Include
+
+#######################
+#### Decodage arguments
+#######################
+unset dst
+set cpln = "ln -sf"
+unset clln
+if( $?ARCHPDEVREP ) then
+  set dst = $ARCHPDEVREP/Include
+endif
+
+while( $#argv > 0 )
+  if( "$1" == "-copy" ) then
+    set cpln = "cp"
+  else if( "$1" == "-clean" ) then
+    set clln
+  else
+    set dst = $1
+  endif
+  shift
+end
+
+if( ! $?dst ) then
+  echo "Variable ARCHPDEVREP must be set"
+  echo "OR you must give a directory for linking/copying"
+  exit -1
+endif
+
+#############################################################
+#### repertoire contenant les liens a creer pour les includes
+#############################################################
+if ( ! -d $dst/ ) then
+  echo repertoire $dst inconnu
+  exit -1
+endif
+
+#########################################################
+#### repertoire contenant les repertoires du code+include
+#########################################################
+#RZCOMM--- pushd ../. > /dev/null
+set src = `pwd | sed 's?/tmp_mnt??'`
+set src = `echo $src | sed 's?/.automount/dapservfic/root??'`
+#RZCOMM--- popd       > /dev/null
+
+#########################################################
+### Les includes a mettre dans Include pour les Makefiles
+#########################################################
+if( -d $src ) then
+  cd $src/.
+  echo $cpln from src
+  set FILE = ( SMakefile.h )
+  pushd $dst/. > /dev/null
+  rm -f $FILE
+  foreach f ( $FILE )
+    if( -e $src/$f ) then
+      $cpln $src/$f ./
+    endif
+  end
+  popd       > /dev/null
+endif
+
+
+####################################################
+####  Les includes du code C++ a mettre dans Include
+####################################################
+foreach d (Kernel Processors ProcWSophya )
+  if ( -d $src/$d ) then
+    cd $src/$d/.
+    echo $cpln from $d
+    set FILE = ( *.h )
+    pushd $dst/. > /dev/null
+    rm -f $FILE
+    $cpln $src/$d/*.h ./
+    popd         > /dev/null
+  endif
+end
+
+############################################
+####  Le cas particulier de sophya_config.h
+############################################
+if ( -e $src/sophya_config.h ) then
+  echo $cpln from $src/sophya_config.h
+  $cpln $src/sophya_config.h $dst/config.h
+endif
+
+###############################
+####  Nettoyage des liens vides
+###############################
+if( $?clln ) then
+  foreach f ( $dst/*.h )
+    if( ! -e $f ) then
+      echo remove empty link : $f
+      rm -f $f
+    endif
+  end
+endif
+
+exit 0
Index: /trunk/ArchTOIPipe/sophya_config.h
===================================================================
--- /trunk/ArchTOIPipe/sophya_config.h	(revision 1980)
+++ /trunk/ArchTOIPipe/sophya_config.h	(revision 1980)
@@ -0,0 +1,15 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* config.h file for ArchTOIPipe, to be used with smkmf */
+/*                            R. Ansari - Mai 2002      */
+
+#include "machdefs.h"
+
+
+#ifndef WITH_SOPHYA
+#define WITH_SOPHYA
+#endif
+
+#endif
+
