This repository has been archived by the owner on Mar 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
243 lines (209 loc) · 7.02 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#
# TopLevel Makefile for the Paradyn (and DyninstAPI) system.
#
# $Id: Makefile,v 1.95 2008/10/03 21:12:39 legendre Exp $
#
TO_CORE = .
# Include additional local definitions (if available)
-include ./make.config.local
# Include the make configuration specification (site configuration options)
include ./make.config
BUILD_ID = "$(SUITE_NAME) v$(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)"
# "basicComps" is the list of components which need to be built first
# with "make world", since they are used building the rest of the system.
#
# "subSystems" is the list of all other pieces which should be built
# as part of Paradyn.
#
# "DyninstAPI" is the list of additional API components (optional).
basicComps = igen pdutil
ParadynD = pdutil igen sharedMem rtinst paradynd
ParadynFE = pdthread paradyn
ParadynVC = visi \
visiClients/tclVisi visiClients/barchart \
visiClients/tableVisi visiClients/phaseTable \
visiClients/histVisi visiClients/terrain \
visiClients/termWin
subSystems = $(ParadynD) $(ParadynFE) $(ParadynVC)
allSubdirs = $(subSystems)
allSubdirs_noinstall =
# "fullSystem" is the list of all Paradyn & DyninstAPI components to build:
# set DONT_BUILD_PARADYN or DONT_BUILD_DYNINST in make.config.local if desired
ifndef DONT_BUILD_PARADYN
fullSystem += $(basicComps)
Build_list += basicComps
ifndef DONT_BUILD_FE
fullSystem += $(ParadynFE)
Build_list += ParadynFE
endif
ifndef DONT_BUILD_DAEMON
fullSystem += $(ParadynD)
Build_list += ParadynD
endif
ifndef DONT_BUILD_VISIS
fullSystem += $(ParadynVC)
Build_list += ParadynVC
endif
endif
# Note that the first rule listed ("all") is what gets made by default,
# i.e., if make is given no arguments. Don't add other targets before all!
all: ready world
# This rule makes most of the normal recursive stuff. Just about any
# target can be passed down to the lower-level Makefiles by listing it
# as a target here:
clean depend distclean:
+@for subsystem in $(fullSystem); do \
if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then \
$(MAKE) -C $$subsystem/$(PLATFORM) $@; \
else \
true; \
fi \
done
install: ready world
+@for subsystem in $(fullSystem); do \
if [ -f $$subsystem/$(PLATFORM)/Makefile ]; then \
$(MAKE) -C $$subsystem/$(PLATFORM) install; \
elif [ -f $$subsytem/Makefile ]; then \
$(MAKE) -C $$subsystem install; \
else \
true; \
fi \
done
# Check that the main installation directories, etc., are ready for a build,
# creating them if they don't already exist! Also touch make.config.local
# if needed.
ready:
+@for installdir in $(LIBRARY_DEST) $(PROGRAM_DEST) $(INCLUDE_DEST); do \
if [ -d $$installdir ]; then \
echo "Installation directory $$installdir exists..."; \
true; \
else \
echo "Creating installation directory $$installdir ...";\
mkdir -p $$installdir; \
fi \
done
+@if [ ! -f make.config.local ]; then \
touch make.config.local; \
fi
+@echo "Primary compiler for Paradyn build is:"
+@if [ `basename $(CXX)` = "xlC" ]; then \
echo "xlC"; \
elif [ `basename $(CXX)` = "insure" ]; then \
echo "insure"; \
else \
$(CXX) -v; \
true; \
fi
# The "make world" target is set up to build things in the "correct"
# order for a build from scratch. It builds and installs things in the
# "basicComps" list first, then builds and installs the remaining
# Paradyn "subSystems" (excluding the currently optional DyninstAPI).
# NB: "make world" has also been set up locally to build the DyninstAPI,
# however, this is optional and can be removed if desired.
#
# This make target doesn't go first in the Makefile, though, since we
# really only want to make "install" when it's specifically requested.
# Note that "world" doesn't do a "clean", since it's nice to be able
# to restart a compilation that fails without re-doing a lot of
# unnecessary work.
intro:
@echo "Build of $(BUILD_ID) starting for $(PLATFORM)!"
ifdef DONT_BUILD_PARADYN
@echo "Build of Paradyn components skipped!"
endif
ifdef DONT_BUILD_FE
@echo "Build of Paradyn front-end components skipped!"
endif
ifdef DONT_BUILD_DAEMON
@echo "Build of Paradyn daemon components skipped!"
endif
ifdef DONT_BUILD_VISIS
@echo "Build of Paradyn visi client components skipped!"
endif
ifdef DONT_BUILD_PD_MT
@echo "Build of ParadynMT components skipped!"
endif
world: intro
$(MAKE) $(fullSystem)
@echo "Build of $(BUILD_ID) complete for $(PLATFORM)!"
# "make Paradyn" and "make DyninstAPI" are also useful and valid build targets!
Paradyn ParadynD ParadynFE ParadynVC basicComps subSystems:
$(MAKE) $($@)
@echo "Build of $@ complete."
@date
# Low-level directory-targets (used in the sets defined above)
# Explicit specification of these rules permits better parallelization
# than building subsystems using a for loop
.PHONY: $(allSubdirs) $(allSubdirs_noinstall)
$(allSubdirs):
@if [ -f $@/$(PLATFORM)/Makefile ]; then \
$(MAKE) -C $@/$(PLATFORM) && \
$(MAKE) -C $@/$(PLATFORM) install; \
elif [ -f $@/Makefile ]; then \
$(MAKE) -C $@ && \
$(MAKE) -C $@ install; \
else \
echo $@ has no Makefile; \
false; \
fi
$(allSubdirs_noinstall):
@echo "***allSubdirs_noinstall***"
+@if [ -f $@/$(PLATFORM)/Makefile ]; then \
$(MAKE) -C $@/$(PLATFORM); \
elif [ -f $@/Makefile ]; then \
$(MAKE) -C $@; \
else \
@echo $@ has no Makefile; \
false; \
fi
# Generate targets of the form install_<target> for all directories in
# allSubdirs_noinstall
allSubdirs_explicitInstall = $(patsubst %,install_%,$(allSubdirs_noinstall))
$(allSubdirs_explicitInstall): install_%: %
+@if [ -f $(@:install_%=%)/$(PLATFORM)/Makefile ]; then \
$(MAKE) -C $(@:install_%=%)/$(PLATFORM) install \
elif [ -f $(@:install_%=%)/Makefile ]; then \
$(MAKE) -C $(@:install_%=%) install; \
else \
@echo $(@:install_%=%) has no Makefile; \
false; \
fi
# dependencies -- keep parallel make from building out of order
paradynd: pdutil
paradyn: pdutil pdthread
pdthread: igen
visi: pdutil
pdutil: igen
visiClients/tclVisi: visi
visiClients/barchart: visi
visiClients/tableVisi: visi
visiClients/phaseTable: visi
visiClients/histVisi: visi
visiClients/terrain: visi
visiClients/termWin: visi pdthread
rtinst: igen
# This rule passes down the documentation-related make stuff to
# lower-level Makefiles in the individual "docs" directories.
docs install-man:
+for subsystem in $(fullSystem); do \
if [ -f $$subsystem/docs/Makefile ]; then \
$(MAKE) -C $$subsystem/docs $@; \
else \
true; \
fi \
done
# The "make nightly" target is what should get run automatically every
# night. It uses "make world" to build things in the right order for
# a build from scratch.
#
# Note that "nightly" should only be run on the primary build site,
# and does things like building documentation that don't need to be
# built for each different architecture. Other "non-primary" build
# sites that run each night should just run "make clean world".
#nightly:
# $(MAKE) clean
# $(MAKE) world
## $(MAKE) DyninstAPI
# $(MAKE) docs
# $(MAKE) install-man
# chmod 644 /p/paradyn/man/man?/*