- rm -f $(CURDIR)/$@ ;\
- $(SHLD) $(SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\
- cd $(CURDIR) ; rm -rf $$TMPDIR
- $(MUTE)chmod a-w $@
+ \rm -f $(CURDIR)/$@ ;\
+ TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\
+ $(SHLD) $(@PACKAGE@SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\
+ chmod a-w $(CURDIR)/$@ ;\
+ cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
+
+ifneq ($(DYEXT),)
+$(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
+ifndef ALIQUIET
+ @echo "***** Linking library $@ *****"
+endif
+ $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
+ export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
+ find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
+ \rm -f $(CURDIR)/$@ ;\
+ $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB);\
+ chmod a-w $(CURDIR)/$@ ;\
+ cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
+endif
+
+#------------------------------------------------------------------------