]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TGeant4/Makefile.flugg
Initial version
[u/mrichter/AliRoot.git] / TGeant4 / Makefile.flugg
diff --git a/TGeant4/Makefile.flugg b/TGeant4/Makefile.flugg
new file mode 100644 (file)
index 0000000..f49056e
--- /dev/null
@@ -0,0 +1,130 @@
+# $Id$
+
+############################### TGeant4 Makefile ###############################
+
+# Include Geant4 specific definitions
+
+include $(G4INSTALL)/config/architecture.gmk
+
+# Include machine specific definitions
+
+include $(ALICE_ROOT)/conf/GeneralDef
+include $(ALICE_ROOT)/conf/MachineDef.$(ALICE_TARGET)
+
+# Include Alice Geant4 specific definitions
+
+include $(ALICE_ROOT)/conf/Geant4.gmk
+
+PACKAGE = TGeant4
+
+# C++ sources
+
+#SRCS1           = $(wildcard *.cxx)
+
+SRCS1            = $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: global" {} \; | sed sx./xxg )
+SRCS1           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: geometry" {} \; | sed sx./xxg )
+
+SRCS2            = $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: digits+hits" {} \; | sed sx./xxg )
+SRCS2           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: physics" {} \; | sed sx./xxg )
+SRCS2           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: event" {} \; | sed sx./xxg )
+SRCS2           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: run" {} \; | sed sx./xxg )
+SRCS2           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: visualization" {} \; | sed sx./xxg )
+SRCS2           += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: interfaces" {} \; | sed sx./xxg )
+
+# C++ Headers
+
+HDRS          =  $(wildcard *.icc) $(wildcard *.h)
+
+# Library Root dictionary
+# only for selected classes
+# (temporarily excluded for OSF1 due to compilation errors)
+
+ifneq ($(ALICE_TARGET),OSF1)
+DICT          = TGeant4Cint.cxx
+DICTH         = TGeant4.h TG4VRunConfiguration.h \
+               TG4Editor.h TG4MainFrame.h TG4GeometryGUI.h TG4GuiVolume.h \
+               TG4MaterialsFrames.h TG4VolumesFrames.h TG4ListTreeFrame.h \
+               TGeant4LinkDef.h
+DICTO         = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT))
+endif
+
+# C++ Objects
+
+OBJS1          = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS1))
+OBJS2          = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS2)) $(DICTO)
+
+# C++ compilation flags
+
+CXXFLAGS      = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/
+##### TARGETS #####
+# Target
+
+SLIBRARY       = $(LIBDIR)/libTGeant4_1.$(SL) $(LIBDIR)/libTGeant4_2.$(SL)
+ALIBRARY       = $(LIBDIR)/libTGeant4_1.a $(LIBDIR)/libTGeant4_2.a
+
+default:       $(SLIBRARY)
+
+$(LIBDIR)/libTGeant4_1.$(SL):          $(OBJS1)
+$(LIBDIR)/libTGeant4_1.a:              $(OBJS1)
+
+$(LIBDIR)/libTGeant4_2.$(SL):          $(OBJS2)
+$(LIBDIR)/libTGeant4_2.a:              $(OBJS2)
+
+$(DICT):                               $(DICTH)
+
+depend:                                        $(SRCS1) $(SRCS2)
+
+clean: macroclean
+
+#HEADERS =     $(filter-out %LinkDef.h,$(HDRS))
+
+TOCLEAN        =       $(OBJS1) $(OBJS2)  *Cint.cxx *Cint.h
+
+CHECKS  =       $(patsubst %.cxx,check/%.viol,$(SRCS))
+
+############################### General Macros ################################
+
+include $(ALICE_ROOT)/conf/GeneralMacros
+
+# Geant4 specific compiler flags
+
+CXXFLAGS += $(CPPFLAGS)
+
+# Remove optimisation for TG4PhysicsConstructorHadron
+
+ifeq ($(ALICE_TARGET),Linux)
+  COMPILER := $(shell g++ -v 2>&1 | grep version | grep egcs)
+  ifeq ($(findstring 1.1,$(COMPILER)),1.1)
+    CXXFLAGS_WITHOUT_O := $(filter-out -O% -Wuninitialized, $(CXXFLAGS))
+    tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx
+      ifeq ($(CXXVERBOSE),)
+       @$(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx
+      else
+       $(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx
+      endif
+  endif
+endif      
+
+ifeq ($(ALICE_TARGET),HP-UX.aCC)
+  # remove optimisation for TG4PhysicsConstructorHadron
+  # to be tested
+  COMPILER := $(shell aCC -V 2>&1)
+  ifeq ($(COMPILER), aCC: HP ANSI C++ B3910B A.01.15)
+    CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
+    CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))  
+    tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx
+      ifeq ($(CXXVERBOSE),)
+       @$(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o
+      else
+       $(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o
+      endif
+  endif    
+endif      
+
+
+############################ Dependencies #####################################
+
+-include tgt_$(ALICE_TARGET)/Make-depend