]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/module.tpl
Force remove shared lib
[u/mrichter/AliRoot.git] / build / module.tpl
index 852603fc3fcc3e3fca27ca331e16eb38d69828b8..589c5346b418dda8204e53a04e6d6d6da0677ee1 100644 (file)
@@ -30,8 +30,9 @@ endif
 @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT))
 
 
-#Extra include,libs etc.
-#@PACKAGE@INC:=$(patsubst %,-I@MODULE@/%,$(EINCLUDE)) -I@MODULE@
+#Extra include,libs, defines etc.
+
+@PACKAGE@DEFINE:=$(EDEFINE)
 
 @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@
 
@@ -73,6 +74,8 @@ TEMP:=$(FSRCS:.F=.o)
 @PACKAGE@FO:=$(patsubst %,$(MODDIRO)/%, $(TEMP:.f=.o))
 @PACKAGE@O:= $(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o)) $(@PACKAGE@FO) $(@PACKAGE@CO)
 
+
+
 ifdef WITHDICT
   @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx
   @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o
@@ -90,10 +93,15 @@ endif
 
 @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
 
+#Add this to the modules libs
+@MODULE@LIBS += $(@PACKAGE@LIB)
+
 #The actual binary file
 
 @PACKAGE@BIN:=$(BINPATH)/@PACKAGE@
 
+#Add to modules list of binaries
+@MODULE@BINS += $(@PACKAGE@BIN)
 
 # Use in the main Makefile
 
@@ -114,93 +122,117 @@ EXPORTFILES += $(@PACKAGE@EXPORTDEST)
 #The exportfiles only include if any!!
 
 ifdef @PACKAGE@EXPORT
-$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
-         @echo "***** Copying file @MODULE@/$(notdir $@) to $@ WRONG !!!*****"
+#$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
+
+$(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
+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
 
 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 $(EXPORTFILES)
+$(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)  $<" > $@
-$(MODDIRO)/%.d: $(MODDIRS)/%.f $(EXPORTFILES)
+               @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  $(EXPORTFILES)
+               @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)  $<" > $@
-$(MODDIRO)/%.d: $(MODDIRS)/%.c $(EXPORTFILES)
+               $(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) $<" > $@
-
-
-#Directory creation
-
-#$(MODDIRO):
-#      @echo "***** Making $@ *****"
-#      mkdir -p $@
-   
-
-
-
-
-
-
-
-
-
-
+               @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@