]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/module.tpl
Force remove shared lib
[u/mrichter/AliRoot.git] / build / module.tpl
index 7f1b79f43749331a9c436dfb2c4b521640552120..589c5346b418dda8204e53a04e6d6d6da0677ee1 100644 (file)
@@ -30,7 +30,9 @@ endif
 @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT))
 
 
-#Extra include,libs etc.
+#Extra include,libs, defines etc.
+
+@PACKAGE@DEFINE:=$(EDEFINE)
 
 @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@
 
@@ -123,27 +125,43 @@ ifdef @PACKAGE@EXPORT
 #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
 
 $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
-         @echo "***** Copying file @MODULE@/$(notdir $@) to $@ *****"
+ifndef ALIQUIET
+         @echo "***** Copying file $^ to $@ *****"
+endif
          @[ -d $(dir $@) ] || mkdir $(dir $@)
-         @cp @MODULE@/$(notdir $@) $@  
+         @cp $^ $@     
 endif
 
 $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
+ifndef ALIQUIET
          @echo "***** Linking library $@ *****"
-         $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS)  -o $@ $(@PACKAGE@O) $(@PACKAGE@DO) $(SHLIB)
+endif
+         $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
+         export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \
+         find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
+      rm -f $@ ;\
+         $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(SHLIB) ;\
+      cd $(CURDIR) ; rm -rf $$TMPDIR
+         $(MUTE)chmod a-w $@
  
 $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
-         @echo "***** Makeing executable $@ *****"
-         $(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ 
+ifndef ALIQUIET
+         @echo "***** Making executable $@ *****"
+endif
+         $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ 
 
-$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
+$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk
+ifndef ALIQUIET
         @echo "***** Creating $@ *****";       
+endif
         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-        rootcint -f $@ -c $(CINTFLAGS) $(@PACKAGE@INC) $^
+        $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) 
 
 $(@PACKAGE@DO): $(@PACKAGE@DS)
-               @echo "***** (Re)compiling $< *****";
-               $(CXX) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@CXXFLAGS)
+ifndef ALIQUIET
+               @echo "***** Compiling $< *****";
+endif
+               $(MUTE)$(CXX) -c $(@PACKAGE@INC)  -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@CXXFLAGS)
 
 #Different targets for the module
 
@@ -152,44 +170,69 @@ all-@PACKAGE@: $(@PACKAGE@LIB)
 depend-@PACKAGE@: $(@PACKAGE@DEP)
 
 # determination of object files
+$(MODDIRO)/%.o: $(MODDIRO)/%.cxx $(MODDIRO)/%.d 
+ifndef ALIQUIET
+       @echo "***** Compiling $< *****";
+endif
+       @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
+       $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC)   $< -o $@ $(@PACKAGE@CXXFLAGS)
+
 $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d 
-       @echo "***** (Re)compiling $< *****";
+ifndef ALIQUIET
+       @echo "***** Compiling $< *****";
+endif
        @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-       $(CXX) -c $(@PACKAGE@INC)   $< -o $@ $(@PACKAGE@CXXFLAGS)
+       $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC)   $< -o $@ $(@PACKAGE@CXXFLAGS)
 
 $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d 
-       @echo "***** (Re)compiling $< *****";
+ifndef ALIQUIET
+       @echo "***** Compiling $< *****";
+endif
        @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-       $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
+       $(MUTE)$(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
 
 $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d 
-       @echo "***** (Re)compiling $< *****";
+ifndef ALIQUIET
+       @echo "***** Compiling $< *****";
+endif
        @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-       $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
+       $(MUTE)$(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
 
 $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d 
-       @echo "***** (Re)compiling $< *****";
+ifndef ALIQUIET
+       @echo "***** Compiling $< *****";
+endif
        @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-       $(CC) -c  $(@PACKAGE@INC)  $< -o $@   $(@PACKAGE@CFLAGS)
+       $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c  $(@PACKAGE@INC)  $< -o $@   $(@PACKAGE@CFLAGS)
 
 $(@PACKAGE@DDEP): $(@PACKAGE@DS)
+ifndef ALIQUIET
                @echo "***** Making dependencies for $< *****";
+endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
                @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
 
 $(MODDIRO)/%.d: $(MODDIRS)/%.cxx
+ifndef ALIQUIET
                @echo "***** Making dependencies for $< *****";
+endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-               @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
+               @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
 $(MODDIRO)/%.d: $(MODDIRS)/%.f
+ifndef ALIQUIET
                @echo "***** Making dependencies for $< *****";
+endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
                @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
 $(MODDIRO)/%.d: $(MODDIRS)/%.F
+ifndef ALIQUIET
                @echo "***** Making dependencies for $< *****";
+endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-               share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
+               $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
 $(MODDIRO)/%.d: $(MODDIRS)/%.c
+ifndef ALIQUIET
                @echo "***** Making dependencies for $< *****";
+endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
-               @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
+               @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@