Index: trunk/SophyaLib/BuildMgr/Makefile
===================================================================
--- trunk/SophyaLib/BuildMgr/Makefile	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/Makefile	(revision 2739)
@@ -28,4 +28,5 @@
 	if [ -d ../LinAlg ] ; then cd  ../LinAlg ; $(MAKE) ; fi
 	if [ -d ../XAstroPack ] ; then cd  ../XAstroPack ; $(MAKE) ; fi
+	if [ -d ../MinuitAdapt ] ; then cd  ../MinuitAdapt ; $(MAKE) ; fi
  
 PI::
@@ -38,6 +39,6 @@
 #  List of libraries (.a)
 PSLB =  $(SOPHYALIBP)libBaseTools.a $(SOPHYALIBP)libSysTools.a $(SOPHYALIBP)libSUtils.a $(SOPHYALIBP)libTArray.a $(SOPHYALIBP)libNTools.a $(SOPHYALIBP)libHiStats.a $(SOPHYALIBP)libSkyMap.a $(SOPHYALIBP)libSamba.a $(SOPHYALIBP)libSkyT.a
-EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a $(SOPHYALIBP)libXAstroPack.a
-EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a 
+EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a $(SOPHYALIBP)libXAstroPack.a $(SOPHYALIBP)libMinuitAdapt.a
+#EXTPSLB =  $(SOPHYALIBP)libFitsIOServer.a $(SOPHYALIBP)libIFFTW.a $(SOPHYALIBP)libLinAlg.a 
 PIPSLB =  $(SOPHYALIBP)libPI.a $(SOPHYALIBP)libPIGcont.a $(SOPHYALIBP)libPIext.a
 
Index: trunk/SophyaLib/BuildMgr/README
===================================================================
--- trunk/SophyaLib/BuildMgr/README	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/README	(revision 2739)
@@ -6,10 +6,13 @@
    ./mkmflib -sbase /tmp/sbase SUtils
 
-3/ domkmf : c-shell script : calls mkmflib for all modules 
+3/ mkmfprog : c-shell script for creation of programs module Makefile / smakefile
+   ./mkmfprog -sbase /tmp/sbase SUtils
+
+4/ domkmf : c-shell script : calls mkmflib for all modules 
    ./domkmf -sbase /tmp/sbase
 
-4/ Makefile : Top level makefile for library modules 
+5/ Makefile : Top level makefile for library modules 
 
-5/ Configuration files :
+6/ Configuration files :
    - Linux_g++_make.inc : Linux with g++ compiler 
    - OSF1_cxx_make.inc : (HP/Compaq/Digital Tru64 with native cxx compiler)
Index: trunk/SophyaLib/BuildMgr/configure
===================================================================
--- trunk/SophyaLib/BuildMgr/configure	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/configure	(revision 2739)
@@ -34,5 +34,5 @@
   echo 'configure [-sbase SOPHYABASE] [-scxx SOPHYACXX] [-incln] [-minc mymake.inc] '
   echo '  [-extp dir1 -extp dir2 ...] [-extip dir1 -extip dir2 ... ] [-extlp dir1 -extlp dir2 ... ]'
-  echo '  [-noext fits -noext fftw -noext lapack -noext astro -noext minuit]'
+  echo '  [-noextlib -noext fits -noext fftw -noext lapack -noext astro -noext minuit]'
   exit -1
 endif
@@ -63,4 +63,11 @@
   set extpathlib = ( $extpathlib $2 )
   shift
+endif
+if( "$1" == "-noextlib" ) then
+  set i = 0
+  while ( $i < $#SOPEXTOK )
+    @ i += 1
+    set SOPEXTOK[$i] = 0
+  end  
 endif
 if( "$1" == "-noext" ) then
@@ -172,5 +179,5 @@
         set file
         foreach f ( *.h )
-          grep "$f" excludeinc > /dev/null
+          grep -q "$f:r\.h" excludeinc
           if( $status != 0 ) set file = ( $file $f )
         end
@@ -350,9 +357,12 @@
 echo " 7.b/ Creating $objlistname "
 rm -f $objlistname ; touch $objlistname
-foreach d ( $SOPEXT ) 
-  if ( -d ../$d ) then 
-    cat ../$d/objlist.list >> $objlistname
-  endif
-end
+set i = 0
+while ( $i < $#SOPEXT )
+  @ i += 1
+  if( $SOPEXTOK[$i] <= 0 ) continue
+  set d = $SOPEXT[$i]
+  if ( ! -d ../$d ) continue
+  cat ../$d/objlist.list >> $objlistname
+end  
 
 set objlistname = $sconf/libPI.objlist
Index: trunk/SophyaLib/BuildMgr/domkmf
===================================================================
--- trunk/SophyaLib/BuildMgr/domkmf	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/domkmf	(revision 2739)
@@ -26,7 +26,8 @@
 end
 
-###echo " ==== Creation smakefile pour les modules de Programmes ====" 
-###foreach f ( ProgPI PrgUtil PrgMap Tests PMixer )
-###  set cmd = "./mkmfprog $* $f" 
-###  $DO $cmd 
-###end
+echo " ==== Creation smakefile pour les modules de Programmes ====" 
+#foreach f ( ProgPI PrgUtil PrgMap Tests PMixer )
+foreach f ( ProgPI PrgUtil PrgMap PMixer )
+  set cmd = "./mkmfprog $* $f" 
+  $DO $cmd 
+end
Index: trunk/SophyaLib/BuildMgr/mkdepend.csh
===================================================================
--- trunk/SophyaLib/BuildMgr/mkdepend.csh	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/mkdepend.csh	(revision 2739)
@@ -30,5 +30,5 @@
        | sed -e 's?'$inc/'?$(SOPHYAINCP)?g'
 else
-  echo "extension $ext not reated"
+  echo "extension $ext not treated"
 endif
 
Index: trunk/SophyaLib/BuildMgr/mkmflib
===================================================================
--- trunk/SophyaLib/BuildMgr/mkmflib	(revision 2734)
+++ trunk/SophyaLib/BuildMgr/mkmflib	(revision 2739)
@@ -3,4 +3,14 @@
 #  librairies SOPHYA  
 #  C. Magneville / R. Ansari - Mai 2005
+#------
+#  Option controlant la generation des smakefile OU Makefile
+#  smakefile utilise pour le developpement - contient une reference 
+#  a $(SOPHYABASE)/include/sophyamake.inc
+#  les Makefile reference ../BuildMgr/sophyamake.inc
+#------
+
+if ( ! $?TMPDIR ) set TMPDIR = /tmp
+set makname = "Makefile"
+unset targetdir 
 
 if ( $#argv < 1) then 
@@ -8,12 +18,4 @@
   exit -1
 endif
-
-#  Option controlant la generation des smakefile OU Makefile
-#  smakefile utilise pour le developpement - contient une reference 
-#  a $(SOPHYABASE)/include/sophyamake.inc
-#  les Makefile reference ../BuildMgr/sophyamake.inc
-
-set makname = "Makefile"
-unset targetdir 
 
 while ( $#argv > 0 )
@@ -44,27 +46,12 @@
 cd ../$targetdir
 
+#--- fichier des fichiers a exclure
 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
-if (-f exclude_dpc ) then 
-#  CHECK !!! qque chose a faire ...
-#  On utilise alors le fichier exclude_dpc
-  echo ' DBG - utilisation du fichier exclude_dpc pour ' $targetdir
-  sort exclude_dpc >! $TMPDIR/exclude.sort
-  set exclfile = 'exclude_dpc'
-else
-  sort exclude >! $TMPDIR/exclude.sort
-  set exclfile = 'exclude'
-endif
+sort exclude >! $TMPDIR/exclude.sort
+set exclfile = 'exclude'
 
 echo "mkmflib: Creating $targetdir/objlist.list , $targetdir/$makname" 
 
-##############################################
-########### fichier de la liste des .o #######
-##############################################
-
+#--- fichier de la liste des .o
 set liblist = objlist.list
 rm -f $liblist
@@ -73,13 +60,7 @@
 unset liblist
 
-##############################################
-########### Creation de smakefile ##########
-##############################################
-
+#--- Creation de smakefile
 set libf='$(SOPHYALIBP)lib'$targetdir'.a'
-
-
-rm -f $makname
-touch $makname
+rm -f $makname; touch $makname
 
 if ($makname == "smakefile") then 
@@ -89,5 +70,5 @@
 endif
 
-echo " " >> $makname
+echo ' ' >> $makname
 echo 'all:' $libf  >> $makname 
 echo ' ' >> $makname
@@ -95,8 +76,8 @@
 echo 'clean:' >> $makname
 set toto='rm -f'
-foreach f (*.cc *.c) 
+foreach f ( *.cc *.c ) 
   set toto= ( $toto '$(SOPHYAOBJP)'$f:r.o )
 end
-echo '	'$toto >> $makname
+echo '	' $toto >> $makname
 echo '	rm -f '$libf >> $makname
 echo ' ' >> $makname
@@ -109,5 +90,7 @@
 echo " " >> $makname
 
-set inc = `echo $SOPHYABASE/include | sed "s?//?/?g"`
+
+#--- Creation des dependances
+set inc = `echo $SOPHYABASE/include | sed "s?//?/?g" | sed 's?/$??'`
 set nomsys = `uname`
 
@@ -130,3 +113,10 @@
 end 
 
+foreach f ( *.f )
+  grep -q '^'$f'$' $exclfile && continue
+  echo '$(SOPHYAOBJP)'$f:r'.o: '$f >> $makname
+  echo '	$(FCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end 
+
 exit 0
Index: trunk/SophyaLib/BuildMgr/mkmfprog
===================================================================
--- trunk/SophyaLib/BuildMgr/mkmfprog	(revision 2739)
+++ trunk/SophyaLib/BuildMgr/mkmfprog	(revision 2739)
@@ -0,0 +1,142 @@
+#!/bin/csh
+#  Script de generation des Makefile/smakefile pour modules
+#  programmes SOPHYA  
+#  C. Magneville / R. Ansari - Mai 2005
+#--- Cf commentaires dans mkmflib
+
+if ( ! $?TMPDIR ) set TMPDIR = /tmp
+set makname = "Makefile"
+unset targetdir 
+
+if ( $#argv < 1) then 
+  echo ' Usage: mkmfprog [-dev] [-sbase SOPHYABASE] ModuleName '
+  exit -1
+endif
+
+while ( $#argv > 0 )
+  if( "$1" == "-h" ) then
+    echo ' Usage: mkmfprog [-dev] [-sbase SOPHYABASE] ModuleName '
+    exit -1
+  else if ( "$1" == "-dev" ) then 
+   set makname = "smakefile"
+  else if( "$1" == "-sbase" ) then
+    setenv SOPHYABASE $2
+    shift
+  else 
+    set targetdir = $1
+  endif
+  shift
+end
+
+if( ! $?SOPHYABASE ) then
+  echo 'ERROR: (mkmfprog) define SOPHYABASE or use script arguments'
+  exit -2
+endif
+
+if( ! $?targetdir ) then
+  echo 'ERROR: (mkmfprog) No target module (directory) specified'
+  exit -3
+endif
+
+cd ../$targetdir
+
+if ( ! -f programs ) touch programs
+if ( ! -f usedslibs ) touch usedslibs
+
+echo "mkmfprog: Creating $targetdir/$makname" 
+
+#--- La liste des programmes a compiler et de tous les .o
+set prog = ( `cat programs | awk '{print $1}'` )
+set obj = 
+foreach f ( $prog )
+  set obj = ( `grep ^$f programs | awk -F"$f " '{print $2}'` $obj )
+end
+
+#--- Creation de smakefile
+rm -f $makname; touch $makname
+
+if ($makname == "smakefile") then 
+  echo 'include $(SOPHYABASE)/include/sophyamake.inc' >> $makname 
+else 
+  echo 'include ../BuildMgr/sophyamake.inc' >> $makname 
+endif
+echo ' ' >> $makname
+
+set dum = 'PROGS = '
+foreach f ( $prog )
+  set dum = ( $dum  '$(SOPHYAEXEP)'$f )
+end
+echo $dum >> $makname
+echo ' ' >> $makname
+
+echo 'all: $(PROGS)' >> $makname
+echo ' ' >> $makname
+
+set dum = 
+foreach f ( $obj )
+  set dum = ( $dum '$(SOPHYAOBJP)'$f )
+end
+echo 'clean:' >> $makname
+echo '	rm -f $(PROGS)' >> $makname
+echo '	rm -f '$dum >> $makname
+echo ' ' >> $makname
+
+#--- Les programmes
+unset sopok extok piok
+grep -q ^sophya usedslibs
+if( $status == 0 ) set sopok
+grep -q ^extsophya usedslibs
+if( $status == 0 ) set extok
+grep -q ^PI usedslibs
+if( $status == 0 ) set piok
+set lib = '$(SOPHYAALLSLBLIST)'
+if( $?sopok ) set lib = '$(SOPHYASLBLIST)'
+if( $?extok ) set lib = '$(SOPHYAEXTSLBLIST)'
+if( $?piok )  set lib = '$(SOPHYAALLSLBLIST)'
+
+foreach f ( $prog )
+  echo $f': $(SOPHYAEXEP)'$f >> $makname
+  echo '	echo $@ " done"' >> $makname
+  set oo = ( `grep ^$f programs | awk -F"$f " '{print $2}'` )
+  set dum = '$(SOPHYAEXEP)'$f':'
+  foreach fo ( $oo )
+    set dum = " $dum "'$(SOPHYAOBJP)'$fo
+  end
+  echo $dum  >> $makname
+  echo '	$(CXXLINK) -o $@ $? '$lib >> $makname
+  echo ' ' >> $makname
+end
+
+#--- Les dependances
+set inc = `echo $SOPHYABASE/include | sed "s?//?/?g" | sed 's?/$??'`
+set nomsys = `uname`
+
+foreach f ( *.cc )
+  grep -q "$f:r\.o" programs
+  if( $status != 0 ) continue
+  gcc -MM -D$nomsys -I$inc $f  \
+       | sed -e 's/.*\.o/\$(SOPHYAOBJP)&/'  \
+       | sed -e 's?'$inc/'?$(SOPHYAINCP)?g'  >> $makname
+  echo '	$(CXXCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end
+
+foreach f ( *.c )
+  grep -q "$f:r\.o" programs
+  if( $status != 0 ) continue
+  gcc -MM -D$nomsys -I$inc $f  \
+       | sed -e 's/.*\.o/\$(SOPHYAOBJP)&/'  \
+       | sed -e 's?'$inc/'?$(SOPHYAINCP)?g' >> $makname
+  echo '	$(CCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end 
+
+foreach f ( *.f )
+  grep -q "$f:r\.o" programs
+  if( $status != 0 ) continue
+  echo '$(SOPHYAOBJP)'$f:r'.o: '$f >> $makname
+  echo '	$(FCOMPILE) -o $@ $<' >> $makname
+  echo ' ' >> $makname
+end 
+
+exit 0
