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