Index: /trunk/MagicSoft/Mars/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/Makefile	(revision 4023)
+++ /trunk/MagicSoft/Mars/Makefile	(revision 4024)
@@ -22,5 +22,5 @@
 #PROGRAMS = readraw merpp mars test mona status
 PROGRAMS = readdaq readraw merpp star status mars mona
-DYLIB    = libmars.so
+SOLIB    = libmars.so
 CINT     = M
 
@@ -98,14 +98,14 @@
 	@echo " Linking $(SOLIB) ..."
 	$(CXX) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
-
 # This is a special workaround to create the shared object (bundle, plugin)
 # for root and the dynlib (to be linked with the executable) on Mac OSX
-$(DYLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
+ifdef DYFLAG
 	@echo " Linking $(DYLIB) ..."
-	$(CXX) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
+	$(CXX) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $(@:.so=.dylib)
+endif
 
-$(PROGRAMS): $(DYLIB) $(PROGRAMS:=.o)
+$(PROGRAMS): $(SOLIB) $(PROGRAMS:=.o)
 	@echo " Linking $@ ..." 
-	$(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(DYLIB) $@.o $(MARS_LIB) -o $@
+	$(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(SOLIB) $@.o $(MARS_LIB) -o $@
 
 dox: $(SOLIB)
Index: /trunk/MagicSoft/Mars/Makefile.conf.darwin
===================================================================
--- /trunk/MagicSoft/Mars/Makefile.conf.darwin	(revision 4023)
+++ /trunk/MagicSoft/Mars/Makefile.conf.darwin	(revision 4024)
@@ -30,6 +30,4 @@
 DYFLAG   = -dynamiclib
 
-SOLIB    = $(DYLIB:.so=.dylib)
-
 # For debugging information use '-g'
 # For producing gmon.out use    '-pg'
