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