Index: trunk/MagicSoft/Mars/Makefile
===================================================================
--- trunk/MagicSoft/Mars/Makefile	(revision 8615)
+++ trunk/MagicSoft/Mars/Makefile	(revision 8913)
@@ -20,6 +20,7 @@
 #
 #PROGRAMS = readraw merpp mars test mona status
-PROGRAMS = readdaq merpp readraw sinope callisto star ganymed sponde showlog showplot mars mars-config
-SOLIB    = libmars.so
+PROGRAMS := readdaq merpp readraw sinope callisto star ganymed sponde showlog showplot mars mars-config
+SOLIB    := libmars.so
+
 CINT     = M
 
@@ -35,5 +36,5 @@
 #  ----->>>   mars libraries
 #
-SUBDIRS = mbase \
+SUBDIRS := mbase \
 	  mastro \
 	  mmain \
@@ -74,9 +75,9 @@
 
 #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
-LIBRARIES = $(SUBDIRS:=.a)
-CONDOR    = $(SUBDIRS:=.condor)
-MRPROPERS = $(SUBDIRS:=.mrproper)
-CLEANERS  = $(SUBDIRS:=.clean)
-LIBS      = $(SOLIB)
+LIBRARIES := $(SUBDIRS:=.a)
+CONDOR    := $(SUBDIRS:=.condor)
+MRPROPERS := $(SUBDIRS:=.mrproper)
+CLEANERS  := $(SUBDIRS:=.clean)
+LIBS      := $(SOLIB)
 
 #------------------------------------------------------------------------------
@@ -86,4 +87,6 @@
 
 ############################################################
+RNDMNAME:=$(shell mktemp)
+
 all: $(SOLIB) $(PROGRAMS)
 	@echo " Done. "
@@ -104,5 +107,6 @@
 $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
 	@echo " Linking shared object $(SOLIB) ..."
-	$(CXX) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
+	$(CXX) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o ${RNDMNAME}
+	mv ${RNDMNAME} $@
 
 # This is a special workaround to create the shared object (bundle, plugin)
