]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Makefile
Adding profile target (Linux with gcc and icc)
[u/mrichter/AliRoot.git] / Makefile
index fddfdd82e915ddc55ad60d2628762188c7e6a5f3..9555672ddb9d3bdf7278167d4b4a7c59350a2f92 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,20 @@ LDFLAGS := -g $(filter-out -O%,$(LDFLAGS))
 endif
 ##################################################################
 
 endif
 ##################################################################
 
+##################################################################
+# 
+#               Check if called with profile
+
+ifeq ($(ALIPROFILE),YES)
+override ALICE_TARGET:=$(ALICE_TARGET)PROF
+FFLAGS += -pg
+CXXFLAGS += -pg
+CFLAGS += -pg
+SOFLAGS += -pg
+LDFLAGS += -pg
+endif
+##################################################################
+
 ##################################################################
 #
 #                   Modules to build 
 ##################################################################
 #
 #                   Modules to build 
@@ -187,14 +201,18 @@ include build/dummy.d
 
 # targets
 
 
 # targets
 
-.PHONY:                alilibs aliroot makedistr clean htmldoc
+.PHONY:                alilibs aliroot makedistr clean htmldoc profile
 
 modules: $(patsubst %,%/module.mk,$(MODULES))  
 
 
 aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
 
 
 modules: $(patsubst %,%/module.mk,$(MODULES))  
 
 
 aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
 
+ifeq ($(ALIPROFILE),YES)
+alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules
+else
 alilibs: $(LIBPATH) $(ALLLIBS) lib modules
 alilibs: $(LIBPATH) $(ALLLIBS) lib modules
+endif
 
 # Single Makefile "distribution": Makefile + modules + mkdepend scripts
 makedistr: $(MODULES)   
 
 # Single Makefile "distribution": Makefile + modules + mkdepend scripts
 makedistr: $(MODULES)   
@@ -211,6 +229,11 @@ ifndef ALIQUIET
        @echo "***** Entering DEBUG mode. *****"
 endif
        @(export ALIDEBUG=YES && $(MAKE))
        @echo "***** Entering DEBUG mode. *****"
 endif
        @(export ALIDEBUG=YES && $(MAKE))
+profile:
+ifndef ALIQUIET
+       @echo "***** Entering PROFILE mode. *****"
+endif
+       @(export ALIPROFILE=YES && $(MAKE))
 lib: 
        @mkdir lib
        @mkdir lib/tgt_$(ALICE_TARGET)
 lib: 
        @mkdir lib
        @mkdir lib/tgt_$(ALICE_TARGET)