]>
Commit | Line | Data |
---|---|---|
615bb363 | 1 | # $Id$ |
2 | ||
3 | ############################### TGeant4 Makefile ############################### | |
4 | ||
5 | # Include Geant4 specific definitions | |
6 | ||
7 | include $(G4INSTALL)/config/architecture.gmk | |
8 | ||
9 | # Include machine specific definitions | |
10 | ||
11 | include $(ALICE_ROOT)/conf/GeneralDef | |
12 | include $(ALICE_ROOT)/conf/MachineDef.$(ALICE_TARGET) | |
13 | ||
14 | # Include Alice Geant4 specific definitions | |
15 | ||
16 | include $(ALICE_ROOT)/conf/Geant4.gmk | |
17 | ||
18 | PACKAGE = TGeant4 | |
19 | ||
20 | # C++ sources | |
21 | ||
22 | #SRCS1 = $(wildcard *.cxx) | |
23 | ||
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 ) | |
26 | ||
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 ) | |
33 | ||
34 | # C++ Headers | |
35 | ||
36 | HDRS = $(wildcard *.icc) $(wildcard *.h) | |
37 | ||
38 | # Library Root dictionary | |
39 | # only for selected classes | |
40 | # (temporarily excluded for OSF1 due to compilation errors) | |
41 | ||
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 \ | |
47 | TGeant4LinkDef.h | |
48 | DICTO = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT)) | |
49 | endif | |
50 | ||
51 | # C++ Objects | |
52 | ||
53 | OBJS1 = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS1)) | |
54 | OBJS2 = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS2)) $(DICTO) | |
55 | ||
56 | # C++ compilation flags | |
57 | ||
58 | CXXFLAGS = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/ | |
59 | ||
60 | ||
61 | ##### TARGETS ##### | |
62 | ||
63 | # Target | |
64 | ||
65 | SLIBRARY = $(LIBDIR)/libTGeant4_1.$(SL) $(LIBDIR)/libTGeant4_2.$(SL) | |
66 | ALIBRARY = $(LIBDIR)/libTGeant4_1.a $(LIBDIR)/libTGeant4_2.a | |
67 | ||
68 | default: $(SLIBRARY) | |
69 | ||
70 | $(LIBDIR)/libTGeant4_1.$(SL): $(OBJS1) | |
71 | $(LIBDIR)/libTGeant4_1.a: $(OBJS1) | |
72 | ||
73 | $(LIBDIR)/libTGeant4_2.$(SL): $(OBJS2) | |
74 | $(LIBDIR)/libTGeant4_2.a: $(OBJS2) | |
75 | ||
76 | $(DICT): $(DICTH) | |
77 | ||
78 | depend: $(SRCS1) $(SRCS2) | |
79 | ||
80 | clean: macroclean | |
81 | ||
82 | #HEADERS = $(filter-out %LinkDef.h,$(HDRS)) | |
83 | ||
84 | TOCLEAN = $(OBJS1) $(OBJS2) *Cint.cxx *Cint.h | |
85 | ||
86 | CHECKS = $(patsubst %.cxx,check/%.viol,$(SRCS)) | |
87 | ||
88 | ############################### General Macros ################################ | |
89 | ||
90 | include $(ALICE_ROOT)/conf/GeneralMacros | |
91 | ||
92 | # Geant4 specific compiler flags | |
93 | ||
94 | CXXFLAGS += $(CPPFLAGS) | |
95 | ||
96 | # Remove optimisation for TG4PhysicsConstructorHadron | |
97 | ||
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 | |
105 | else | |
106 | $(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx | |
107 | endif | |
108 | endif | |
109 | endif | |
110 | ||
111 | ifeq ($(ALICE_TARGET),HP-UX.aCC) | |
112 | # remove optimisation for TG4PhysicsConstructorHadron | |
113 | # to be tested | |
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 | |
121 | else | |
122 | $(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o | |
123 | endif | |
124 | endif | |
125 | endif | |
126 | ||
127 | ||
128 | ############################ Dependencies ##################################### | |
129 | ||
130 | -include tgt_$(ALICE_TARGET)/Make-depend |