-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
137 lines (102 loc) · 3.67 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
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
# Makefile to build Andrei's merge library.
# Adopted from the twtools suite.
# Requires GNU make.
#
# A.Gaponenko, 2003, 2004
#
default: agmerge agwmerge agxmerge
.PHONY: default
TOPDIR = .
OBJDIR = $(TOPDIR)
DEPDIR = $(TOPDIR)
vpath %.o $(OBJDIR)
vpath %.d $(DEPDIR)
################################################################
##include $(TWTCTOP)/BuildConf.mk
CXX = g++
CXXFLAGS = -O -Wall
LD = g++
LDFLAGS =
# set var for the included Module.mk file
AGMERGETOP = $(TOPDIR)
include $(AGMERGETOP)/Module.mk
#================================================================
# agmerge:
AGMERGEPROGSRCS := agmerge.cxx
AGMERGEPROGOBJS := $(AGMERGEPROGSRCS:%.cxx=%.o)
AGMERGEPROGDEPENDS := $(AGMERGEPROGSRCS:%.cxx=$(DEPDIR)/%.d)
AGMERGEPROGCXXFLAGS := $(CXXFLAGS) $(shell root-config --cflags)
agmerge: $(AGMERGEPROGOBJS) $(AGMERGELIB)
$(LD) -o $@ $(AGMERGEPROGCXXFLAGS) $(LDFLAGS) \
$(AGMERGEPROGOBJS:%.o=$(OBJDIR)/%.o) \
$(AGMERGELIB) $(shell root-config --libs) \
-Xlinker -rpath -Xlinker $(shell root-config --libdir)
clean: cleanagmergeprog
.PHONY: cleanagmergeprog
cleanagmergeprog:
$(RM) $(TOPDIR)/agmerge
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
include $(AGMERGEPROGDEPENDS)
endif
$(AGMERGEPROGDEPENDS): $(DEPDIR)/%.d: %.cxx
$(SHELL) -ec '$(CXX) -MM $(AGMERGEPROGCXXFLAGS) $< \
| sed s#$*.o#$*.o\ $*.d# > $@ ;\
[ -s $@ ] || rm -f $@; test -r $@ || exit 1'
$(AGMERGEPROGOBJS): %.o : %.cxx
$(CXX) $(AGMERGEPROGCXXFLAGS) -c $< -o $(OBJDIR)/$(*F).o
#================================================================
# agwmerge:
AGWMERGEPROGSRCS := agwmerge.cxx
AGWMERGEPROGOBJS := $(AGWMERGEPROGSRCS:%.cxx=%.o)
AGWMERGEPROGDEPENDS := $(AGWMERGEPROGSRCS:%.cxx=$(DEPDIR)/%.d)
AGWMERGEPROGCXXFLAGS := $(CXXFLAGS) $(shell root-config --cflags)
agwmerge: $(AGWMERGEPROGOBJS) $(AGMERGELIB)
$(LD) -o $@ $(AGWMERGEPROGCXXFLAGS) $(LDFLAGS) \
$(AGWMERGEPROGOBJS:%.o=$(OBJDIR)/%.o) \
$(AGMERGELIB) $(shell root-config --libs) \
-Xlinker -rpath -Xlinker $(shell root-config --libdir)
clean: cleanagwmergeprog
.PHONY: cleanagwmergeprog
cleanagwmergeprog:
$(RM) $(TOPDIR)/agwmerge
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
include $(AGWMERGEPROGDEPENDS)
endif
$(AGWMERGEPROGDEPENDS): $(DEPDIR)/%.d: %.cxx
$(SHELL) -ec '$(CXX) -MM $(AGWMERGEPROGCXXFLAGS) $< \
| sed s#$*.o#$*.o\ $*.d# > $@ ;\
[ -s $@ ] || rm -f $@; test -r $@ || exit 1'
$(AGWMERGEPROGOBJS): %.o : %.cxx
$(CXX) $(AGWMERGEPROGCXXFLAGS) -c $< -o $(OBJDIR)/$(*F).o
#================================================================
# agxmerge:
AGXMERGEPROGSRCS := agxmerge.cxx
AGXMERGEPROGOBJS := $(AGXMERGEPROGSRCS:%.cxx=%.o)
AGXMERGEPROGDEPENDS := $(AGXMERGEPROGSRCS:%.cxx=$(DEPDIR)/%.d)
AGXMERGEPROGCXXFLAGS := $(CXXFLAGS) $(shell root-config --cflags)
agxmerge: $(AGXMERGEPROGOBJS) $(AGMERGELIB)
$(LD) -o $@ $(AGXMERGEPROGCXXFLAGS) $(LDFLAGS) \
$(AGXMERGEPROGOBJS:%.o=$(OBJDIR)/%.o) \
$(AGMERGELIB) $(shell root-config --libs) \
-Xlinker -rpath -Xlinker $(shell root-config --libdir)
clean: cleanagxmergeprog
.PHONY: cleanagxmergeprog
cleanagxmergeprog:
$(RM) $(TOPDIR)/agxmerge
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
include $(AGXMERGEPROGDEPENDS)
endif
$(AGXMERGEPROGDEPENDS): $(DEPDIR)/%.d: %.cxx
$(SHELL) -ec '$(CXX) -MM $(AGXMERGEPROGCXXFLAGS) $< \
| sed s#$*.o#$*.o\ $*.d# > $@ ;\
[ -s $@ ] || rm -f $@; test -r $@ || exit 1'
$(AGXMERGEPROGOBJS): %.o : %.cxx
$(CXX) $(AGXMERGEPROGCXXFLAGS) -c $< -o $(OBJDIR)/$(*F).o
################################################################
#also clean up the library by default
clean: cleanagmergelib
$(RM) $(OBJDIR)/*.o $(DEPDIR)/*.d
cleanall: clean
.PHONY: cleanall clean
.DELETE_ON_ERROR:
#EOF