3 ############################### TGeant4 Makefile ###############################
5 # Include Geant4 specific definitions
7 include $(G4INSTALL)/config/architecture.gmk
9 # Include machine specific definitions
11 include $(ALICE_ROOT)/conf/GeneralDef
12 include $(ALICE_ROOT)/conf/MachineDef.$(ALICE_TARGET)
14 # Include Alice Geant4 specific definitions
16 include $(ALICE_ROOT)/conf/Geant4.gmk
22 #SRCS1 = $(wildcard *.cxx)
24 SRCS1 = $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: global" {} \; | sed sx./xxg )
25 SRCS1 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: geometry" {} \; | sed sx./xxg )
27 SRCS2 = $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: digits+hits" {} \; | sed sx./xxg )
28 SRCS2 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: physics" {} \; | sed sx./xxg )
29 SRCS2 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: event" {} \; | sed sx./xxg )
30 SRCS2 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: run" {} \; | sed sx./xxg )
31 SRCS2 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: visualization" {} \; | sed sx./xxg )
32 SRCS2 += $(shell find . -maxdepth 1 -name "*.cxx" -exec grep -l "Category: interfaces" {} \; | sed sx./xxg )
36 HDRS = $(wildcard *.icc) $(wildcard *.h)
38 # Library Root dictionary
39 # only for selected classes
40 # (temporarily excluded for OSF1 due to compilation errors)
42 ifneq ($(ALICE_TARGET),OSF1)
43 DICT = TGeant4Cint.cxx
44 DICTH = TGeant4.h TG4VRunConfiguration.h \
45 TG4Editor.h TG4MainFrame.h TG4GeometryGUI.h TG4GuiVolume.h \
46 TG4MaterialsFrames.h TG4VolumesFrames.h TG4ListTreeFrame.h \
48 DICTO = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT))
53 OBJS1 = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS1))
54 OBJS2 = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS2)) $(DICTO)
56 # C++ compilation flags
58 CXXFLAGS = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/
65 SLIBRARY = $(LIBDIR)/libTGeant4_1.$(SL) $(LIBDIR)/libTGeant4_2.$(SL)
66 ALIBRARY = $(LIBDIR)/libTGeant4_1.a $(LIBDIR)/libTGeant4_2.a
70 $(LIBDIR)/libTGeant4_1.$(SL): $(OBJS1)
71 $(LIBDIR)/libTGeant4_1.a: $(OBJS1)
73 $(LIBDIR)/libTGeant4_2.$(SL): $(OBJS2)
74 $(LIBDIR)/libTGeant4_2.a: $(OBJS2)
78 depend: $(SRCS1) $(SRCS2)
82 #HEADERS = $(filter-out %LinkDef.h,$(HDRS))
84 TOCLEAN = $(OBJS1) $(OBJS2) *Cint.cxx *Cint.h
86 CHECKS = $(patsubst %.cxx,check/%.viol,$(SRCS))
88 ############################### General Macros ################################
90 include $(ALICE_ROOT)/conf/GeneralMacros
92 # Geant4 specific compiler flags
94 CXXFLAGS += $(CPPFLAGS)
96 # Remove optimisation for TG4PhysicsConstructorHadron
98 ifeq ($(ALICE_TARGET),Linux)
99 COMPILER := $(shell g++ -v 2>&1 | grep version | grep egcs)
100 ifeq ($(findstring 1.1,$(COMPILER)),1.1)
101 CXXFLAGS_WITHOUT_O := $(filter-out -O% -Wuninitialized, $(CXXFLAGS))
102 tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx
103 ifeq ($(CXXVERBOSE),)
104 @$(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx
106 $(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx
111 ifeq ($(ALICE_TARGET),HP-UX.aCC)
112 # remove optimisation for TG4PhysicsConstructorHadron
114 COMPILER := $(shell aCC -V 2>&1)
115 ifeq ($(COMPILER), aCC: HP ANSI C++ B3910B A.01.15)
116 CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
117 CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))
118 tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx
119 ifeq ($(CXXVERBOSE),)
120 @$(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o
122 $(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o
128 ############################ Dependencies #####################################
130 -include tgt_$(ALICE_TARGET)/Make-depend