-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
98 lines (76 loc) · 2.45 KB
/
Makefile
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
DEPENDROOT = $(shell [ -n "${ROOTSYS}" ] && echo ${ROOTSYS} || echo "ROOTSYS_NOTSET" )
include ${ROOTSYS}/etc/Makefile.arch
MODULE = TStarJetPico
MODDICTSBASE = $(MODULE)RootDict
MODDICTS = $(MODDICTSBASE).$(SrcSuf)
MODDICTO = $(MODDICTSBASE).$(ObjSuf)
LINKDEFFILE = $(MODULE)LinkDef.h
SRCTMP = $(wildcard $(MODULE)*.h)
SRCTMP += $(wildcard TStarJetVector*.h)
SRCTMP += $(wildcard TStarJetReader*.h)
SRCTMPC = $(patsubst $(MODDICTSBASE).h,,$(SRCTMP))
MODHEADERS = $(patsubst $(MODULE)LinkDef.h,,$(SRCTMPC))
MODSRCS = $(patsubst %.h,%.$(SrcSuf),$(MODHEADERS)) \
$(MODDICTS)
MODO = $(patsubst %.h,%.$(ObjSuf),$(MODHEADERS)) \
$(MODDICTO)
MODSO = lib$(MODULE).$(DllSuf)
# uncomment for debug info in the library
# CXXFLAGS += -g
# kk: some additions require c++11
CXXFLAGS += -std=c++11
ifeq ($(PLATFORM),win32)
MODLIB = lib$(MODULE).lib
else
MODLIB = $(shell pwd)/$(MODSO)
endif
OBJS = $(MODO)
# # suppress warnings during dictionary creation
CXXFLAGS += -Wno-return-type-c-linkage -Wno-undefined-bool-conversion
.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
all: $(MODSO)
$(MODSO): $(MODO)
ifeq ($(ARCH),aix)
/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^
else
ifeq ($(ARCH),aix5)
/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^
else
ifeq ($(PLATFORM),macosx)
# We need to make both the .dylib and the .so
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
ifneq ($(subst $(MACOSX_MINOR),,1234),1234)
ifeq ($(MACOSX_MINOR),4)
ln -sf $@ $(subst .$(DllSuf),.so,$@)
else
$(LD) -m64 -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \
$(OutPutOpt) $(subst .$(DllSuf),.so,$@)
endif
endif
else
ifeq ($(PLATFORM),win32)
bindexplib $* $^ > $*.def
lib -nologo -MACHINE:IX86 $^ -def:$*.def \
$(OutPutOpt)$(MODLIB)
$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
$(OutPutOpt)$@
$(MT_DLL)
else
$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
endif
endif
endif
endif
@echo "$@ done"
clean:
@rm -f $(OBJS) $(MODSO) $(MODDICTS) $(MODDICTSBASE).h core
distclean: clean
-@mv -f linearIO.root linearIO.roott
@rm -f $(MODSO) $(MODLIB) *Dict.* *.def *.exp \
*.root *.ps *.so *.lib *.dll *.d *.log .def so_locations
.SUFFIXES: .$(SrcSuf)
$(MODDICTS): $(MODHEADERS) $(LINKDEFFILE)
@echo "[i] Generating dictionary $@..."
@rootcint -f $@ -c $^
.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) -c $<