diff --git a/NPLib/Makefile b/NPLib/Makefile
index a4dd0f88fcbcf92b67baad70464986185855b165..ab3361e4866524e3e06d1dd823b3b997fc6d2617 100644
--- a/NPLib/Makefile
+++ b/NPLib/Makefile
@@ -268,22 +268,18 @@ GLIBS         = $(ROOTGLIBS) $(SYSLIBS)
 INCLUDE		= -I$(CLHEP_BASE_DIR)/include
  
 #------------------------------------------------------------------------------
-SHARELIB      =	CalibManager Vdetec InputOutputRoot InitCond	InterCoord \
-		Must2All	GaspardData	ParisData	ShieldData \
-		AnnularS1Data	PlasticData	DummyDetectorData SSSDData \
-		Reaction	EnergyLoss
-
-FILLINC		= fillinc
-FILLLIB		= filllib
+SHARELIB	= SharedLib
+FILLINC		= FillIncludeDir
+FILLLIB		= FillLibraryDir
 LIBLIST		= liblistfile
 
 all:	$(FILLINC) $(SHARELIB) $(FILLLIB) $(LIBLIST)
 #------------------------------------------------------------------------------
 ############### fillinclib ##############
-fillinc:
+FillIncludeDir:
 		./scripts/fillincdir.sh
 
-filllib:
+FillLibraryDir:
 		./scripts/filllibdir.sh
 ifeq ($(ARCH),macosx)
 		./scripts/filllibmacdir.sh
@@ -291,114 +287,22 @@ endif
 
 ############### liblist ##############
 liblistfile:
-		echo "Building liblist"
 		./scripts/buildliblist.sh
 
-############### Calibration ##############
-## CalibrationManager ##
-CalibManager:
-		make -C ./CalibrationManager
-
-############### Detector ##############
-## VDetector ##
-Vdetec:
-		make -C ./VDetector
-		
-## MUST2 ##
-Must2All:
-		make -C ./MUST2
-
-## SSSD ##
-SSSDData:
-		make -C ./SSSD
-
-## AnnularS1 ##
-AnnularS1Data:
-		make -C ./AnnularS1
-
-## Gaspard ##
-GaspardData:
-		make -C ./GASPARD
-
-## Paris ##
-ParisData:
-		make -C ./Paris
-
-## Shield ##
-ShieldData:
-		make -C ./Shield
-
-## Plastic ##
-PlasticData:
-		make -C ./Plastic
-
-## DUMMY Detector ##
-DummyDetectorData:
-		make -C ./DummyDetector
-
-
-############# Simulation ##############
-## InitialConditions ##
-InitCond:
-		make -C ./InitialConditions
-
-## InteractionCoordinates ##
-InterCoord:	
-		make -C ./InteractionCoordinates
-
-############# I/O Root File ############
-InputOutputRoot:
-	make -C ./IORoot
-	cp ./IORoot/*.h ./include
-
-
-############# Various Tools ############
-## Reaction ##
-Reaction:
-		make libReaction.so -C ./Tools
-
-EnergyLoss:
-		make libEnergyLoss.so -C ./Tools
-		
-#######################################
+############### sharedlib ##############
+SharedLib:
+		./scripts/makefile.sh
 
 ############# Clean and More ##########
 clean:
-	make clean -C ./Tools
-	make clean -C ./IORoot
-	make clean -C ./VDetector
-	make clean -C ./CalibrationManager
-	make clean -C ./MUST2
-	make clean -C ./SSSD
-	make clean -C ./AnnularS1
-	make clean -C ./GASPARD
-	make clean -C ./Paris
-	make clean -C ./Shield
-	make clean -C ./InteractionCoordinates
-	make clean -C ./InitialConditions
-	make clean -C ./DummyDetector
+	./scripts/makefile.sh clean
 	
 distclean:
-	rm -f ./lib/*.so
-ifeq ($(ARCH),macosx)
-	rm -f ./lib/*.dylib
-endif
+	rm -f ./lib/*
 	rm -f ./include/*.h 
 	rm -f liblist
-	make distclean -C ./Tools
-	make distclean -C ./IORoot
-	make distclean -C ./VDetector
-	make distclean -C ./CalibrationManager
-	make distclean -C ./MUST2
-	make distclean -C ./SSSD
-	make distclean -C ./AnnularS1
-	make distclean -C ./GASPARD
-	make distclean -C ./Paris
-	make distclean -C ./Shield
-	make distclean -C ./InteractionCoordinates
-	make distclean -C ./InitialConditions
-	make distclean -C ./DummyDetector
-	make distclean -C ./Plastic
+	./scripts/makefile.sh distclean
+
 .SUFFIXES: .$(SrcSuf)
 
 ###
diff --git a/NPLib/scripts/makefile.sh b/NPLib/scripts/makefile.sh
new file mode 100755
index 0000000000000000000000000000000000000000..bf7e778f472a0b7d2fd135be081d211886c00507
--- /dev/null
+++ b/NPLib/scripts/makefile.sh
@@ -0,0 +1,40 @@
+# *****************************************************************************
+# * Copyright (C) 2009   this file is part of the NPTool Project              *
+# *                                                                           *
+# * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
+# * For the list of contributors see $NPTOOL/Licence/Contributors             *
+# *****************************************************************************/
+
+# *****************************************************************************
+# * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
+# *                                                                           *
+# * Creation Date  : 16/11/10                                                 *
+# * Last update    :                                                          *
+# *---------------------------------------------------------------------------*
+# * Decription: This script loops on all subdirectories containing a Makefile *
+# *             and call it with the argument passed to the script.           *
+# *             Supported arguments are:                                      *
+# *               + no arguments: compile everything                          *
+# *               + clean: remove temporary files but not shared library      *
+# *               + distclean: remove temporary files and shared library      *
+# *                                                                           *
+# *---------------------------------------------------------------------------*
+# * Comment:                                                                  *
+# *                                                                           *
+# *                                                                           *
+# *****************************************************************************
+
+#! /bin/bash
+
+# loop recursively on Makefile files in sub-directories
+for file in */Makefile
+do
+   # remove "Makefile" string from file name
+   name=${file%\/*}
+   # print informations
+   echo "Entering $name directory..."
+   # add "-C ./" pattern at the beginning of the name
+   cmd="-C ./$name"
+   # execute make command with target specified on command line
+   make $1 $cmd
+done