]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/module.tpl
Adding profile target (Linux with gcc and icc)
[u/mrichter/AliRoot.git] / build / module.tpl
index d20c3ee5b440c1512ea6536b02f9ad0d865311df..c8bb6b7252037b3316be5ee981d87f67a9b1b7f9 100644 (file)
@@ -18,6 +18,16 @@ else
 @PACKAGE@CXXFLAGS:=$(PACKCXXFLAGS)
 endif
 
+ifndef PACKDCXXFLAGS
+ifeq ($(PLATFORM),linuxicc)
+@PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS)) -O0
+else
+@PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS))
+endif
+else
+@PACKAGE@DCXXFLAGS:=$(PACKCXXFLAGS)
+endif
+
 
 ifdef DHDR
 WITHDICT=YES
@@ -92,9 +102,11 @@ endif
 #The actual library file
 
 @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
+@PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT)
 
 #Add this to the modules libs
 @MODULE@LIBS += $(@PACKAGE@LIB)
+@MODULE@ALIBS += $(@PACKAGE@ALIB)
 
 #The actual binary file
 
@@ -107,6 +119,7 @@ endif
 
 ifeq ($(TYPE),lib)
 ALLLIBS += $(@PACKAGE@LIB)
+ALLALIBS += $(@PACKAGE@ALIB)
 BINLIBS += -l@PACKAGE@
 else
 ALLEXECS += $(@PACKAGE@BIN)
@@ -139,15 +152,35 @@ 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 {} . \; ;\
-         $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(SHLIB) ;\
+      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 $@
+
+$(@PACKAGE@ALIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
+ifndef ALIQUIET
+         @echo "***** Linking static library $@ *****"
+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 $(CURDIR)/$@ ;\
+         $(ALLD) $(ALFLAGS) $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO))  $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(ALLIB);\
       cd $(CURDIR) ; rm -rf $$TMPDIR
          $(MUTE)chmod a-w $@
+
+
 $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
 ifndef ALIQUIET
          @echo "***** Making executable $@ *****"
 endif
-         $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ 
+ifeq ($(ALIPROFILE),YES)
+       @echo "Not implemented yet"
+       $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(LIBS) $(EXEFLAGS) -o $@
+#$(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@
+else
+         $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@
+endif
 
 $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk
 ifndef ALIQUIET
@@ -160,11 +193,15 @@ $(@PACKAGE@DO): $(@PACKAGE@DS)
 ifndef ALIQUIET
                @echo "***** Compiling $< *****";
 endif
-               $(MUTE)$(CXX) -c $(@PACKAGE@INC)  -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@CXXFLAGS)
+               $(MUTE)$(CXX) -c $(@PACKAGE@INC)  -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS)
 
 #Different targets for the module
 
-all-@PACKAGE@: $(@PACKAGE@LIB)
+ifeq ($(TYPE),lib)
+all-@PACKAGE@: $(@PACKAGE@LIB $(@PACKAGE@ALIB)
+else
+all-@PACKAGE@: $(@PACKAGE@BIN)
+endif
 
 depend-@PACKAGE@: $(@PACKAGE@DEP)
 
@@ -235,3 +272,37 @@ ifndef ALIQUIET
 endif
                @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
                @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
+
+@PACKAGE@CHECKS := $(patsubst %.cxx,@PACKAGE@/check/%.viol,$(SRCS))
+
+check-@PACKAGE@: $(@PACKAGE@CHECKS)
+
+# IRST coding rule check 
+@PACKAGE@/check/%.i : @PACKAGE@/%.cxx
+       @[ -d $(dir $@) ] || mkdir -p $(dir $@)
+       $(MUTE)$(CXX) -E $(@PACKAGE@DEFINE) $(@PACKAGE@INC) $< > $@ $(@PACKAGE@CXXFLAGS)
+       @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@)
+
+# IRST coding rule check
+@PACKAGE@/check/%.viol : @PACKAGE@/check/%.i
+       @cd @PACKAGE@ ; [ -r @PACKAGE@ ] || ln -s ../@PACKAGE@ @PACKAGE@
+       -@echo $@ ; $(CODE_CHECK) $< ./@PACKAGE@ > $@
+
+@PACKAGE@PREPROC       = $(patsubst %.viol,%.i,$(@PACKAGE@CHECKS))
+
+@PACKAGE@REVENGS       = $(patsubst %.viol,%.ii,$(@PACKAGE@CHECKS))
+
+.SECONDARY: $(@PACKAGE@REVENGS) $(@PACKAGE@PREPROC)
+
+reveng-@PACKAGE@:              @PACKAGE@/check/classDiagram.dot
+
+@PACKAGE@/check/classDiagram.dot:      $(@PACKAGE@PREPROC)
+       @$(REV_ENG) $^
+       @-mv classDiagram.dot $@
+
+revdisp-@PACKAGE@:     reveng-@PACKAGE@
+       @echo revdisp for @PACKAGE@
+       @cd @PACKAGE@/check ; \
+      $(IRST_INSTALLDIR)/webreveng/create-class-diagram-pages.sh
+       @sed -e "s/\@PACKAGE\@/@PACKAGE@/g" < $(ALICE_ROOT)/build/HomePage.html > @PACKAGE@/check/HomePage.html
+