1 |
nikolas |
1.1 |
# $Id: Makefile,v 1.0 2007/06/01 |
2 |
|
|
|
3 |
|
|
############################### geant4vmc Makefile ########################### |
4 |
|
|
|
5 |
|
|
|
6 |
nikolas |
1.2 |
PACKAGE = PamVMC_fc |
7 |
nikolas |
1.1 |
|
8 |
|
|
ifeq ($(PLATFORM),) |
9 |
|
|
PLATFORM = $(shell root-config --arch) |
10 |
|
|
endif |
11 |
|
|
|
12 |
nikolas |
1.3 |
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 |
nikolas |
1.1 |
|
18 |
|
|
ifeq ($(ROOTSYS),) |
19 |
|
|
ROOT_INCDIR = $(shell root-config --incdir) |
20 |
|
|
ROOT_BINDIR = $(shell root-config --prefix)/bin |
21 |
nikolas |
1.2 |
ROOT_ETCDIR = $(shell root-config --prefix)/etc/vmc |
22 |
nikolas |
1.1 |
else |
23 |
|
|
ROOT_INCDIR = $(ROOTSYS)/include |
24 |
|
|
ROOT_BINDIR = $(ROOTSYS)/bin |
25 |
nikolas |
1.2 |
ROOT_ETCDIR = $(ROOTSYS)/etc/vmc |
26 |
nikolas |
1.1 |
endif |
27 |
|
|
|
28 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/Makefile.$(PLATFORM) |
29 |
nikolas |
1.1 |
|
30 |
|
|
############################### Sources ####################################### |
31 |
|
|
|
32 |
|
|
# Rules |
33 |
|
|
# |
34 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/MakeRules |
35 |
nikolas |
1.1 |
|
36 |
|
|
# Dictionary |
37 |
|
|
# |
38 |
|
|
GDICT := $(BINDIR)/$(PACKAGE)Cint.cxx |
39 |
|
|
GDICTH := $(GDICT:.cxx=.h) |
40 |
nikolas |
1.2 |
GDICTO := $(patsubst %.cxx,%.o,$(GDICT)) |
41 |
nikolas |
1.1 |
|
42 |
|
|
# Sources |
43 |
|
|
# |
44 |
nikolas |
1.2 |
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 |
nikolas |
1.1 |
|
58 |
|
|
# C++ Headers |
59 |
|
|
# |
60 |
nikolas |
1.2 |
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 |
nikolas |
1.1 |
|
71 |
|
|
# Objects |
72 |
|
|
# |
73 |
nikolas |
1.2 |
CXXOBJ := $(patsubst %.cxx,$(BINDIR)/%.o,$(SRCS)) |
74 |
|
|
FOBJ := $(patsubst %.F,$(BINDIR)/%.o,$(FSRCS)) |
75 |
|
|
OBJS := $(CXXOBJ) $(GDICTO) $(FOBJ) |
76 |
nikolas |
1.1 |
|
77 |
|
|
# PAMELA LIBS |
78 |
|
|
# |
79 |
nikolas |
1.3 |
PAMLIBS := -L${PAM_LIB} -lTrkLevel2 |
80 |
nikolas |
1.1 |
SHLIBS := ${PAMLIBS} |
81 |
|
|
# Make include list |
82 |
|
|
# |
83 |
nikolas |
1.2 |
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 |
nikolas |
1.3 |
-I$(G4VMC_DIR)/include \ |
92 |
nikolas |
1.2 |
-I$(CLHEP_BASE_DIR)/include \ |
93 |
|
|
-Iinclude -I$(G4INCLUDE) |
94 |
nikolas |
1.1 |
|
95 |
nikolas |
1.2 |
FINCDIR := -Itrk/include/f77 |
96 |
nikolas |
1.1 |
# C++ compilation flags |
97 |
|
|
# |
98 |
|
|
CXXFLAGS := $(CXXOPTS) -I. $(INCDIR) -I$(ROOT_INCDIR) ${PAMOPTS} |
99 |
nikolas |
1.2 |
FFLAGS := $(FINCDIR) -fvxt -fno-automatic -Wno-globals |
100 |
nikolas |
1.1 |
|
101 |
|
|
DEPINC += -I. -I$(ROOT_INCDIR) $(INCDIR) |
102 |
|
|
|
103 |
|
|
############################### Targets ####################################### |
104 |
|
|
|
105 |
nikolas |
1.2 |
RM_FILE=$(shell rm -f $(LIBDIR)/resxy_new.root)\ |
106 |
|
|
$(shell rm -f $(LIBDIR)/CalibTrk_00110_000_000.root) |
107 |
|
|
|
108 |
nikolas |
1.3 |
AUXDIR='aux' |
109 |
nikolas |
1.2 |
CP_FILE=$(shell mkdir -p ${LIBDIR})\ |
110 |
nikolas |
1.3 |
$(shell cp -rf ${AUXDIR}/resxy_new.root ${AUXDIR}/CalibTrk_00110_000_000.root ${LIBDIR}/) |
111 |
nikolas |
1.1 |
|
112 |
|
|
SLIBRARY = $(LIBDIR)/lib$(PACKAGE).$(SL) |
113 |
|
|
ALIBRARY = $(LIBDIR)/lib$(PACKAGE).a |
114 |
|
|
|
115 |
|
|
default: depend $(SLIBRARY) |
116 |
|
|
|
117 |
|
|
|
118 |
nikolas |
1.2 |
$(LIBDIR)/lib$(PACKAGE).$(SL):$(CP_FILE) $(OBJS) $(FOBS) |
119 |
|
|
|
120 |
|
|
$(LIBDIR)/lib$(PACKAGE).a: $(CP_FILE) $(OBJS) $(FOBS) |
121 |
nikolas |
1.1 |
|
122 |
|
|
DICT:= $(GDICT) |
123 |
|
|
|
124 |
|
|
$(DICT): $(HDRS) |
125 |
|
|
|
126 |
nikolas |
1.2 |
depend: $(SRCS) $(FSRCS) |
127 |
|
|
|
128 |
|
|
TOCLEAN = $(BINDIR) $(RM_FILE) |
129 |
|
|
TOCLEANALL = $(BINDIR) $(LIBDIR) $(RM_FILE) |
130 |
nikolas |
1.1 |
|
131 |
nikolas |
1.2 |
include $(ROOT_ETCDIR)/MakeMacros |
132 |
nikolas |
1.1 |
|
133 |
|
|
|
134 |
|
|
############################### Dependencies ################################## |
135 |
|
|
|
136 |
|
|
-include $(BINDIR)/Make-depend |