forked from ROBAST/ROBAST
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
149 lines (118 loc) · 3.83 KB
/
Copy pathMakefile
File metadata and controls
149 lines (118 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Author: Akira Okumura 2009/09/28
###############################################################################
# Copyright (C) 2009-, Akira Okumura #
# All rights reserved. #
###############################################################################
# Since revision 40240 (Thu Jul 14 15:17:53 2011 UTC), Makefile.arch and
# test/Makefile have been changed. In addition, since revision 41594
# (Wed Oct 26 12:38:25 2011 UTC), $ROOTSYS/test/Makefile.arch has been moved
# to $ROOTSYS/etc/Makefile.arch.
# In order to make ROBAST work with older ROOT releases, Makefile.arch must be
# checked here
# older version
MAKEARCH := $(shell find -L $(ROOTSYS)/test -name Makefile.arch 2> /dev/null)
ifeq ($(MAKEARCH), )
# 41594 or later
MAKEARCH := $(shell find -L $(ROOTSYS)/etc -name Makefile.arch)
endif
ifeq ($(MAKEARCH), )
RC := root-config
MAKEARCH := $(wildcard $(shell $(RC) --etcdir)/Makefile.arch)
endif
include $(MAKEARCH)
ifeq ($(ROOTCLING),)
ROOTCLING := $(ROOTCINT)
else
ROOTCLING_FOUND := 1
endif
NAME := ROBAST
DEPEND := libCore libGeom libGeomPainter libPhysics libGraf libGraf3d
SRCDIR := src
INCDIR := include
BINCDIR := $(INCDIR)/bernlohr
DICT := $(NAME)Dict
DICTS := $(SRCDIR)/$(NAME)Dict.$(SrcSuf)
DICTI := $(SRCDIR)/$(NAME)Dict.h
DICTO := $(SRCDIR)/$(NAME)Dict.$(ObjSuf)
INCS := $(filter-out $(INCDIR)/LinkDef.h,$(wildcard $(INCDIR)/*.h))
SRCS := $(filter-out $(SRCDIR)/$(DICT).%,$(wildcard $(SRCDIR)/*.$(SrcSuf)))
OBJS := $(patsubst %.$(SrcSuf),%.$(ObjSuf),$(SRCS)) $(DICTO)
PCM := $(NAME)Dict_rdict.pcm
BSRCS := $(wildcard $(SRCDIR)/bernlohr/*.c)
BOBJS := $(patsubst %.c,%.$(ObjSuf),$(BSRCS))
# Replace similar lines in Makefile.arch because it does not support 10.10 or
# later
ifeq ($(subst $(MACOSX_MINOR),,4321),4321)
DllSuf = so
else
DllSuf = dylib
endif
LIB = lib$(NAME).$(DllSuf)
CXXFLAGS += $(ROBASTFLAGS)
ifneq ($(EXPLLINKLIBS), )
EXPLLINKLIBS += -lGeom -lGeomPainter
else
EXPLLINKLIBS = $(ROOTGLIBS) $(ROOTLIBS) -lGeom -lGeomPainter
endif
RMAP = lib$(NAME).rootmap
.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
.PHONY: all clean doc htmldoc
ifeq ($(ROOTCLING_FOUND),)
# ROOT 5
all: $(LIB) $(RMAP)
$(RMAP): $(LIB) $(INCDIR)/LinkDef.h
rlibmap -f -o $@ -l $(LIB) -d $(DEPEND) -c $(INCDIR)/LinkDef.h
$(DICTS): $(INCS) $(INCDIR)/LinkDef.h
@echo "Generating dictionary ..."
$(ROOTCLING) -f $@ -c -p $^
else
# ROOT 6
all: $(LIB) $(PCM)
$(SRCDIR)/$(PCM): $(DICTS)
$(DICTS): $(INCS) $(INCDIR)/LinkDef.h
@echo "Generating dictionary ..."
$(ROOTCLING) -f $@ -c -p -I$(INCDIR) -rmf $(RMAP) -rml $(LIB) $^
endif
$(LIB): $(OBJS) $(BOBJS)
ifeq ($(PLATFORM),macosx)
# We need to make both the .dylib and the .so
$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
ifneq ($(subst $(MACOSX_MINOR),,4321),4321)
ifeq ($(MACOSX_MINOR),4)
ln -sf $@ $(subst .$(DllSuf),.so,$@)
else
ifneq ($(UNDEOPT), )
$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
$(OutPutOpt) $(subst .$(DllSuf),.so,$@)
endif
endif
endif
else
ifeq ($(PLATFORM),win32)
bindexplib $* $^ > $*.def
lib -nologo -MACHINE:IX86 $^ -def:$*.def \
$(OutPutOpt)$(EVENTLIB)
$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
$(OutPutOpt)$@
$(MT_DLL)
else
$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
endif
endif
@echo "$@ done"
$(SRCDIR)/%.$(ObjSuf): $(SRCDIR)/%.$(SrcSuf) $(INCDIR)/%.h
@echo "Compiling" $<
$(CXX) $(CXXFLAGS) -Wall -g -I$(INCDIR) -c $< -o $@
$(SRCDIR)/%.$(ObjSuf): $(SRCDIR)/%.c
@echo "Compiling" $<
$(CC) $(CCFLAGS) -I$(BINCDIR) -fPIC -c $< -o $@
$(PCM): $(SRCDIR)/$(PCM)
cp $^ $@
$(DICTO): $(DICTS)
@echo "Compiling" $<
$(CXX) $(CXXFLAGS) -I. -c $< -o $@
doc: all htmldoc
htmldoc:
sh mkhtml.sh
clean:
rm -rf $(LIB) $(OBJS) $(BOBJS) $(DICTI) $(DICTS) $(DICTO) $(PCM) $(SRCDIR)/$(PCM) $(RMAP)