1 |
# $Id: Makefile,v 1.0 2007/06/01 |
2 |
|
3 |
############################### geant4vmc Makefile ########################### |
4 |
|
5 |
|
6 |
PACKAGE = PamVMC_fc |
7 |
|
8 |
ifeq ($(PLATFORM),) |
9 |
PLATFORM = $(shell root-config --arch) |
10 |
endif |
11 |
|
12 |
TOPDIR = $(G4VMC_DIR) |
13 |
BINDIR = $(G4WORKDIR)/tmp/tgt_$(PLATFORM)/$(PACKAGE) |
14 |
LIBDIR = $(G4WORKDIR)/lib/tgt_$(PLATFORM) |
15 |
|
16 |
ifeq ($(ROOTSYS),) |
17 |
ROOT_INCDIR = $(shell root-config --incdir) |
18 |
ROOT_BINDIR = $(shell root-config --prefix)/bin |
19 |
ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc |
20 |
else |
21 |
ROOT_INCDIR = $(ROOTSYS)/include |
22 |
ROOT_BINDIR = $(ROOTSYS)/bin |
23 |
ROOT_ETCDIR = $(ROOTSYS)/etc/vmc |
24 |
endif |
25 |
|
26 |
include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) |
27 |
|
28 |
############################### Sources ####################################### |
29 |
|
30 |
# Rules |
31 |
# |
32 |
include $(ROOT_ETCDIR)/MakeRules |
33 |
|
34 |
# Dictionary |
35 |
# |
36 |
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
37 |
GDICTH := $(GDICT:.cxx=.h) |
38 |
GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) |
39 |
|
40 |
# Sources |
41 |
# |
42 |
CXXSRC := $(wildcard src/*.cxx) |
43 |
CALSRC := $(wildcard cal/src/*.cxx) |
44 |
TRKSRC := $(wildcard trk/src/*.cxx) |
45 |
TRKFSRCS :=$(wildcard trk/src/f77/*.F) |
46 |
TOFSRC := $(wildcard tof/src/*.cxx) |
47 |
ACSRC := $(wildcard ac/src/*.cxx) |
48 |
S4SRC := $(wildcard s4/src/*.cxx) |
49 |
NDSRC := $(wildcard nd/src/*.cxx) |
50 |
|
51 |
|
52 |
SRCS := $(CXXSRC) $(CALSRC) $(TRKSRC) $(TOFSRC) $(ACSRC) $(S4SRC) $(NDSRC) |
53 |
FSRCS := $(TRKFSRCS) |
54 |
|
55 |
|
56 |
# C++ Headers |
57 |
# |
58 |
HDRS := $(wildcard include/*.h) |
59 |
HDRS += $(wildcard cal/include/*.h) |
60 |
HDRS += $(wildcard trk/include/*.h) |
61 |
HDRS += $(wildcard tof/include/*.h) |
62 |
HDRS += $(wildcard ac/include/*.h) |
63 |
HDRS += $(wildcard s4/include/*.h) |
64 |
HDRS += $(wildcard nd/include/*.h) |
65 |
|
66 |
HDRS := $(filter-out include/$(PACKAGE)LinkDef.h,$(HDRS)) |
67 |
HDRS += include/$(PACKAGE)LinkDef.h |
68 |
|
69 |
# Objects |
70 |
# |
71 |
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(SRCS)) |
72 |
FOBJ := $(patsubst %.F,$(BINDIR)/%.o,$(FSRCS)) |
73 |
OBJS := $(CXXOBJ) $(GDICTO) $(FOBJ) |
74 |
|
75 |
# PAMELA LIBS |
76 |
# |
77 |
#ALIROOT=/home/nikolas/francesco/aliroot/test/pro/ |
78 |
ALIROOT=/home/nikolas/francesco/vmc/fluka_vmc/ |
79 |
#PAMLIBS := -L${PAM_LIB} -lTrkLevel2 -L${ALIROOT}/lib/tgt_linux/ -lTFluka |
80 |
PAMLIBS := -L${PAM_LIB} -lTrkLevel2 -L${ALIROOT}/lib/tgt_linux/ -lfluka |
81 |
SHLIBS := ${PAMLIBS} |
82 |
# Make include list |
83 |
# |
84 |
#PAMINC := -I${PAM_INC} -I${PAM_INC}/yoda -I${ALIROOT}/TFluka/ |
85 |
#PAMINC := -I${PAM_INC} -I${PAM_INC}/yoda -I${ALIROOT}/source/ |
86 |
PAMINC := -I$(PAMELA_SOFTWARE)/include/yoda -I$(PAMELA_SOFTWARE)/inc -I${ALIROOT}/source |
87 |
INCDIR := -Iinclude $(PAMINC) \ |
88 |
-Ical/include \ |
89 |
-Itrk/include \ |
90 |
-Itof/include \ |
91 |
-Iac/include \ |
92 |
-Is4/include \ |
93 |
-Ind/include \ |
94 |
-I$(TOPDIR)/include \ |
95 |
-I$(CLHEP_BASE_DIR)/include \ |
96 |
-Iinclude -I$(G4INCLUDE) |
97 |
|
98 |
FINCDIR := -Itrk/include/f77 |
99 |
# C++ compilation flags |
100 |
# |
101 |
CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) -I$(ROOT_INCDIR) ${PAMOPTS} |
102 |
FFLAGS := $(FINCDIR) -fvxt -fno-automatic -Wno-globals |
103 |
|
104 |
DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) |
105 |
|
106 |
############################### Targets ####################################### |
107 |
|
108 |
|
109 |
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
110 |
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
111 |
|
112 |
default: depend $(SLIBRARY) |
113 |
|
114 |
|
115 |
$(LIBDIR)/lib$(PACKAGE).$(SL): $(OBJS) $(FOBS) |
116 |
$(LIBDIR)/lib$(PACKAGE).a: $(OBJS) $(FOBS) |
117 |
|
118 |
DICT:= $(GDICT) |
119 |
|
120 |
$(DICT): $(HDRS) |
121 |
|
122 |
depend: $(SRCS) $(FSRCS) |
123 |
|
124 |
TOCLEAN = $(BINDIR) |
125 |
TOCLEANALL = $(BINDIR) $(LIBDIR) |
126 |
|
127 |
include $(ROOT_ETCDIR)/MakeMacros |
128 |
|
129 |
############################### Dependencies ################################## |
130 |
|
131 |
-include $(BINDIR)/Make-depend |