]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 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 | SRCS = $(wildcard *.cxx) | |
23 | ||
24 | # C++ Headers | |
25 | ||
26 | HDRS = $(wildcard *.icc) $(wildcard *.h) | |
27 | ||
28 | # Library Root dictionary | |
29 | # only for selected classes | |
56a00aec | 30 | # (temporarily excluded for OSF1 due to compilation errors) |
2817d3e2 | 31 | |
56a00aec | 32 | ifneq ($(ALICE_TARGET),OSF1) |
2817d3e2 | 33 | DICT = TGeant4Cint.cxx |
466ac87b | 34 | DICTH = TGeant4.h TG4VRunConfiguration.h \ |
35 | TG4Editor.h TG4GUI.h TG4GeometryGUI.h TG4GuiVolume.h \ | |
36 | TGeant4LinkDef.h | |
2817d3e2 | 37 | DICTO = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT)) |
56a00aec | 38 | endif |
2817d3e2 | 39 | |
40 | # C++ Objects | |
41 | ||
42 | OBJS = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS)) $(DICTO) | |
43 | ||
44 | # C++ compilation flags | |
45 | ||
46 | CXXFLAGS = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/ | |
47 | ||
48 | ||
49 | ##### TARGETS ##### | |
50 | ||
51 | # Target | |
52 | ||
53 | SLIBRARY = $(LIBDIR)/libTGeant4.$(SL) | |
56a00aec | 54 | ALIBRARY = $(LIBDIR)/libTGeant4.a |
2817d3e2 | 55 | |
56 | default: $(SLIBRARY) | |
57 | ||
58 | $(LIBDIR)/libTGeant4.$(SL): $(OBJS) | |
56a00aec | 59 | $(LIBDIR)/libTGeant4.a: $(OBJS) |
2817d3e2 | 60 | |
61 | $(DICT): $(DICTH) | |
62 | ||
63 | depend: $(SRCS) | |
64 | ||
2f5a2f2d | 65 | clean: macroclean |
66 | ||
2817d3e2 | 67 | #HEADERS = $(filter-out %LinkDef.h,$(HDRS)) |
68 | ||
69 | TOCLEAN = $(OBJS) *Cint.cxx *Cint.h | |
70 | ||
71 | CHECKS = $(patsubst %.cxx,check/%.viol,$(SRCS)) | |
72 | ||
73 | ############################### General Macros ################################ | |
74 | ||
75 | include $(ALICE_ROOT)/conf/GeneralMacros | |
76 | ||
2817d3e2 | 77 | # Geant4 specific compiler flags |
78 | ||
79 | CXXFLAGS += $(CPPFLAGS) | |
80 | ||
75777b5a | 81 | # Remove optimisation for TG4PhysicsConstructorHadron |
82 | ||
83 | ifeq ($(ALICE_TARGET),Linux) | |
84 | COMPILER := $(shell g++ -v 2>&1 | grep version | grep egcs) | |
85 | ifeq ($(findstring 1.1,$(COMPILER)),1.1) | |
86 | CXXFLAGS_WITHOUT_O := $(filter-out -O% -Wuninitialized, $(CXXFLAGS)) | |
87 | tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx | |
88 | ifeq ($(CXXVERBOSE),) | |
89 | @$(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx | |
90 | else | |
91 | $(CXX) $(CXXFLAGS_WITHOUT_O) -c -o $@ TG4PhysicsConstructorHadron.cxx | |
92 | endif | |
93 | endif | |
94 | endif | |
95 | ||
96 | ifeq ($(ALICE_TARGET),HP-UX.aCC) | |
97 | # remove optimisation for TG4PhysicsConstructorHadron | |
98 | # to be tested | |
99 | COMPILER := $(shell aCC -V 2>&1) | |
100 | ifeq ($(COMPILER), aCC: HP ANSI C++ B3910B A.01.15) | |
101 | CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS)) | |
102 | CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O)) | |
103 | tgt_$(ALICE_TARGET)/TG4PhysicsConstructorHadron.o : TG4PhysicsConstructorHadron.cxx | |
104 | ifeq ($(CXXVERBOSE),) | |
105 | @$(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o | |
106 | else | |
107 | $(CXX) $(CXXFLAGS_WITHOUT_O) -c $*.cxx -o tgt_$(ALICE_TARGET)/$*.o | |
108 | endif | |
109 | endif | |
110 | endif | |
111 | ||
2817d3e2 | 112 | |
113 | ############################ Dependencies ##################################### | |
114 | ||
115 | -include tgt_$(ALICE_TARGET)/Make-depend |