forked from dmtcp/dmtcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
402 lines (352 loc) · 13.1 KB
/
Makefile.in
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
@SET_MAKE@
LN_S=@LN_S@ -f
MKDIR_P=@MKDIR_P@
CC=@CC@
CFLAGS = @CFLAGS@
CXX=@CXX@
CXXFLAGS = @CXXFLAGS@
CPP=@CPP@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
M32=@M32@
MULTILIB=@MULTILIB@
HAS_JAVA=@HAS_JAVA@
HAS_JAVAC=@HAS_JAVAC@
PACKAGE=@PACKAGE_TARNAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@-@PACKAGE_VERSION@
VERSION=@PACKAGE_VERSION@
# Allow the user to specify the install program.
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
bindir=@bindir@
libdir=@libdir@
pkglibdir = @libdir@/@PACKAGE@
docdir=@docdir@
includedir=@includedir@
mandir=@mandir@
infodir=@mandir@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
targetdir = $(top_builddir)
ifeq ($(M32),1)
targetdir = $(top_builddir)/lib/$(PACKAGE)/32
INSTALL_FLAGS = libdir=$(libdir)/$(PACKAGE)/32/lib \
bindir=$(libdir)/$(PACKAGE)/32/bin install-libs
UNINSTALL_FLAGS = libdir=$(libdir)/$(PACKAGE)/32/lib \
bindir=$(libdir)/$(PACKAGE)/32/bin uninstall-libs
else
INSTALL_FLAGS = install
UNINSTALL_FLAGS = uninstall
endif
MANPAGES_AUTOGEN=dmtcp_nocheckpoint.1.gz mtcp_restart.1.gz \
dmtcp_ssh.1.gz dmtcp_sshd.1.gz \
dmtcp_discover_rm.1.gz dmtcp_rm_loclaunch.1.gz
MANPAGES=dmtcp.1.gz dmtcp_coordinator.1.gz dmtcp_command.1.gz dmtcp_launch.1.gz \
dmtcp_restart.1.gz
# Macros TEST and XTERM_E used on command line by check1, check2, ...:
# make TEST=readline XTERM_E="xterm -e" check-readline
ifeq ($(MULTILIB),1)
default: display-build-env add-git-hooks build-multilib
else
default: display-build-env add-git-hooks build
endif
build-multilib: build-multilib-m32 build-multilib-m64
build-multilib-m32: display-build-env config.status-multilib-m32
./config.status-multilib-m32
${MAKE} -f Makefile clean # Makefile changed; use '-f'
${MAKE} -f Makefile build # Makefile changed; use '-f'
# ${MAKE} -f Makefile install # Makefile changed; use '-f'
@ echo "******************************************************"
@ echo "*" && echo "*" && echo "*" && echo "*" && echo "*" && echo "*"
@ echo "* FINISHED COMPILING 32-bit MODE. DO 'make -j' FOR 64-bit MODE."
@ echo "*" && echo "*" && echo "*" && echo "*" && echo "*" && echo "*"
@ echo "******************************************************"
config.status-multilib-m32: config.status
cat config.status | \
sed -e s'%S\["M32"\]=.*%S["M32"]="1"%' \
-e s'%D\["CONFIG_MULTILIB"\]="\(.*\)"%D["CONFIG_MULTILIB"]="\1"\nD["CONFIG_M32"]="\1"%' \
-e s'%S\["CONFIG_M32_TRUE"\]=.*%S["CONFIG_M32_TRUE"]=""%' \
-e s'%S\["CONFIG_M32_FALSE"\]=.*%S["CONFIG_M32_FALSE"]="#"%' \
-e s'%S\["CFLAGS"\]="\(.*\)"%S["CFLAGS"]="\1 -m32 -march=i686 -Wa,--32"%' \
-e s'%S\["CXXFLAGS"\]="\(.*\)"%S["CXXFLAGS"]="\1 -m32 -march=i686 -Wa,--32"%' \
-e s'%S\["LDFLAGS"\]="\(.*\)"%S["LDFLAGS"]="\1 -m32 -march=i686 -Wl,-m32 -Wl,-melf_i386 -Wa,--32"%' \
-e s'%D\["ELF_INTERPRETER"\]=.*"%D["ELF_INTERPRETER"]=" \\"/lib/ld-linux.so.2\\""%' \
-e s'%S\["prefix"\]=".*"%S["prefix"]="'$$PWD'/build"%' \
- \
> config.status-multilib-m32
chmod a+x ./config.status-multilib-m32
# buld-multilib-m{32,64} were delcared .PHONY targets
# Adding build-multilib-m32 as prerequisite allows use of 'make -j'
build-multilib-m64: config.status-multilib-m64 build-multilib-m32
./config.status-multilib-m64 # Restore non-m32 configuration
${MAKE} -f Makefile clean # Makefile changed; use '-f'
${MAKE} -f Makefile build # Makefile changed; use '-f'
# ${MAKE} -f Makefile install # Makefile changed; use '-f'
config.status-multilib-m64: config.status
cat config.status | \
sed -e s'%S\["prefix"\]=".*"%S["prefix"]="'$$PWD'/build"%' \
- \
> config.status-multilib-m64
chmod a+x ./config.status-multilib-m64
mkdirs: display-build-env
$(MKDIR_P) $(targetdir)/bin
$(MKDIR_P) $(targetdir)/lib/dmtcp
ifeq ($(M32),1)
$(MKDIR_P) $(top_builddir)/bin
endif
build: mkdirs dmtcp plugin contrib
ifeq ($(M32),1)
cd lib/dmtcp && $(LN_S) 32/lib/dmtcp/* ./ || true
mkdir -p bin || true
cd bin && $(LN_S) ../lib/dmtcp/32/bin/* ./ || true
endif
all: default
display-build-env: display-config display-release
@- uname -a
@ echo -n "libc version: " && ldd --version | head -1 || true
@- echo 'Compiler: ${CC}'
@- ${CC} -v 2>&1
@- echo 'CFLAGS: ${CFLAGS}'
@- echo 'CXXFLAGS: ${CXXFLAGS}'
@- echo 'CPPFLAGS: ${CPPFLAGS}'
@- echo 'LDFLAGS: ${LDFLAGS}'
@- if test "$(HAS_JAVA)" = "yes" ; then \
java -version ; \
fi
@- if test "$(HAS_JAVAC)" = "yes" ; then \
javac -version ; \
fi
@ ls -ld /var/*/nscd/* 2> /dev/null || true
@ echo ""
display-release:
@ lsb_release -dc 2> /dev/null || \
grep -i SUSE /etc/SuSE-release 2> /dev/null || \
cat /etc/redhat-release 2> /dev/null || true
@ cat /etc/debian-version 2> /dev/null && echo ' (Debian)' || true
@ cat /etc/rocks-release 2> /dev/null || true
display-config:
@- echo DMTCP version: ${VERSION}
@- echo Date built: \ \ `date`
@- if test -r ./config.log ; then \
echo -n 'config.log: ' ; \
grep '\$$ .*configure ' config.log | sed -e 's^\$$^^'; \
fi
ifeq ($(M32),0)
@ echo "32-bit build: gcc -m32"
else
@ echo "64-bit build: gcc (standard)"
endif
_hooksdir=.git/hooks
add-git-hooks: ${_hooksdir}/pre-commit ${_hooksdir}/post-rewrite
${_hooksdir}/%: util/hooks/%
if test -d ${_hooksdir}; then \
cd ${_hooksdir} && ln -s ../../$< . ; \
fi
# Remove any stray src/config.h files that may still exist.
# If the developer accidentally leaves an old src/config.h in place (e.g.,
# after examining an old revision when this really existed), then some
# source code would pull in src/config.h in preference to include/config.h
dmtcp: mkdirs
rm -f src/config.h
cd src && $(MAKE)
plugin: dmtcp
cd plugin && $(MAKE)
contrib: dmtcp
cd contrib && $(MAKE)
tests: build
ifeq ($(M32),0)
if file ./test/dmtcp1 | grep -cq "ELF 32-bit"; then \
cd test && $(MAKE) clean; \
fi
endif
cd test && $(MAKE)
tests-32: build
if file ./test/dmtcp1 | grep -cq "ELF 64-bit"; then \
cd test && $(MAKE) clean; \
fi
cd test && $(MAKE) M32=1
# Prevent mtcp_restart from flying out of control
# (but Java/IcedTea6-1.9.x/RHEL-6.1 uses lots of memory,
# and modifies most of the zero-mapped pages -- using 16 MB)
# JDK Runtime Environment (Java/IcedTea6 1.12.4 (OpenJDK, Java 1.6.0_27)
# now needs at least 32 MB (June, 2013)
LIMIT=ulimit -v 33554432
check: tests
@ if python -c 'print("Python exits.")' > /dev/null; then \
bash -c "$(LIMIT) && $(top_srcdir)/test/autotest.py ${AUTOTEST} $*"; \
else echo '*** No python found in your path.'; echo '*** Please add' \
' python to path or build Python 2.x for x >= 3.'; \
fi
check-32: tests-32
@ if python -c 'print("Python exits.")' > /dev/null; then \
bash -c "$(LIMIT) && $(top_srcdir)/test/autotest.py ${AUTOTEST} $*"; \
else echo '*** No python found in your path.'; echo '*** Please add' \
' python to path or build Python 2.x for x >= 3.'; \
fi
check-%: tests
bash -c "$(LIMIT) && $(top_srcdir)/test/autotest.py ${AUTOTEST} '$*'"
check-32-%: tests-32
bash -c "$(LIMIT) && $(top_srcdir)/test/autotest.py ${AUTOTEST} '$*'"
check1: icheck-dmtcp1
check1-32: icheck-32-dmtcp1
check2: tests
${MAKE} XTERM_E="xterm -e" icheck-readline
check2-32: tests-32
${MAKE} XTERM_E="xterm -e" icheck-32-readline
check3: icheck-shared-memory
icheck-%: tests
@ echo ""
@ echo "*** Type:"
@ echo "*** h<return> for Help (optional)"
@ echo "*** c<return> to Checkpoint"
@ echo "*** k<return> to Kill and observe the Restart"
@ echo "*** c<return> to Checkpoint again"
@ echo "*** k<return> to Kill and restart again"
@ echo "*** q<return> to Quit"
@ echo ""
@ echo "Press <return> when ready to start."
@ read -p "> " dummy
@ rm -f ckpt_$*_* && sleep 3 && \
echo "" && echo "*** Starting Program" && echo "" && \
${XTERM_E} $(targetdir)/bin/dmtcp_launch --join test/$* && \
echo "" && echo "*** Restarting Program from Checkpoint" \
"(press q<return> to quit)" && echo "" && \
until ls ckpt_$*_*.dmtcp > /dev/null 2>&1; do true; done; \
${XTERM_E} $(targetdir)/bin/dmtcp_restart --join --quiet ckpt_$*_*.dmtcp; \
echo "" && echo "*** Again Restarting Program from Checkpoint" \
"(press q<return> to quit)" && echo "" && \
until ls ckpt_$*_*.dmtcp > /dev/null 2>&1; do true; done; \
${XTERM_E} $(targetdir)/bin/dmtcp_restart --join --quiet ckpt_$*_*.dmtcp; \
&
@ $(targetdir)/bin/dmtcp_coordinator
# TODO: Consolidate it with icheck-% target to remove duplication.
icheck-32-%: tests-32
@ echo ""
@ echo "*** Type:"
@ echo "*** h<return> for Help (optional)"
@ echo "*** c<return> to Checkpoint"
@ echo "*** k<return> to Kill and observe the Restart"
@ echo "*** c<return> to Checkpoint again"
@ echo "*** k<return> to Kill and restart again"
@ echo "*** q<return> to Quit"
@ echo ""
@ echo "Press <return> when ready to start."
@ read -p "> " dummy
@ rm -f ckpt_$*_* && sleep 3 && \
echo "" && echo "*** Starting Program" && echo "" && \
${XTERM_E} $(targetdir)/bin/dmtcp_launch --join test/$* && \
echo "" && echo "*** Restarting Program from Checkpoint" \
"(press q<return> to quit)" && echo "" && \
until ls ckpt_$*_*.dmtcp > /dev/null 2>&1; do true; done; \
${XTERM_E} $(targetdir)/bin/dmtcp_restart --join --quiet ckpt_$*_*.dmtcp; \
echo "" && echo "*** Again Restarting Program from Checkpoint" \
"(press q<return> to quit)" && echo "" && \
until ls ckpt_$*_*.dmtcp > /dev/null 2>&1; do true; done; \
${XTERM_E} $(targetdir)/bin/dmtcp_restart --join --quiet ckpt_$*_*.dmtcp; \
&
@ $(targetdir)/bin/dmtcp_coordinator
tidy:
rm -rf dmtcp-autotest-* ckpt_*_files
rm -f ckpt_*.dmtcp dmtcp_restart_script* \
dmtcp-shared-memory.* dmtcp-test-typescript.tmp core*
rm -rf ckpt_*
clean: tidy
- cd src && $(MAKE) clean
- cd plugin && $(MAKE) clean
- cd contrib && $(MAKE) clean
- cd test && $(MAKE) clean
- if test -z "$$DMTCP_TMPDIR"; then \
if test -z "$$TMPDIR"; then \
DMTCP_TMPDIR=/tmp/dmtcp-$$USER@`/bin/hostname`; \
else \
DMTCP_TMPDIR=$$TMPDIR/dmtcp-$$USER@`/bin/hostname`; \
fi; \
fi; \
rm -rf $$DMTCP_TMPDIR
distclean: clean
- cd src && $(MAKE) distclean
- cd plugin && $(MAKE) distclean
- cd contrib && $(MAKE) distclean
- cd test && $(MAKE) distclean
rm -f Makefile test/Makefile test/autotest_config.py \
include/config.h include/dmtcp/version.h include/stamp-h1 \
config.log config.status config.status-* config.cache
rm -rf autom4te.cache
rm -rf $(top_builddir)/lib $(top_builddir)/bin
distsvn:
if test "`svn info`"; then \
dir=$(PACKAGE_TARNAME)+svn`svnversion`; \
else \
echo "svn info failed"; exit 1; \
fi; \
svn export . $$dir; \
tar czf $$dir.tar.gz $$dir; \
rm -rf $$dir 2&>/dev/null; \
ls -l $$dir.tar.gz;
distgit:
if test "`git svn info|grep '^Revision:'|cut -d' ' -f2`"; then \
svnversion="`git svn info|grep '^Revision:'|cut -d' ' -f2`" \
dir=$(PACKAGE_TARNAME)+svn$$svnversion; \
else \
echo "git svn info failed"; exit 1; \
fi; \
git archive --format=tar.gz --prefix=$$dir/ HEAD > $$dir.tar.gz \
rm -rf $$dir 2&>/dev/null; \
ls -l $$dir.tar.gz;
dist_exclude.txt:
if ! test -r dist_exclude.txt; then touch dist_exclude.txt; fi
dist: distclean dist_exclude.txt
dir=`pwd`; cd ..; tar czvf dmtcp.tgz \
--exclude-from=$$dir/dist_exclude.txt \
--exclude $$dir/dist_exclude.txt --exclude-vcs --exclude='*/.deps' \
./`basename $$dir`
ls -l ../dmtcp.tgz
create-dirs:
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(pkglibdir)
ifeq ($(M32),0)
$(INSTALL) -d $(DESTDIR)$(includedir)
$(INSTALL) -d $(DESTDIR)$(docdir)
$(INSTALL) -d $(DESTDIR)$(mandir)/man1
else
$(INSTALL) -d $(DESTDIR)$(libdir)/$(PACKAGE)/32/bin
$(INSTALL) -d $(DESTDIR)$(libdir)/$(PACKAGE)/32/lib/$(PACKAGE)
endif
install: all create-dirs
cd src && make DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)
cd plugin && make DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)
cd contrib && make DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)
ifeq ($(M32),0)
${INSTALL_DATA} $(top_srcdir)/QUICK-START.md $(DESTDIR)$(docdir)
${INSTALL_DATA} $(top_srcdir)/COPYING $(DESTDIR)$(docdir)
${INSTALL_DATA} $(top_srcdir)/AUTHORS $(DESTDIR)$(docdir)
${INSTALL_DATA} $(top_srcdir)/NEWS $(DESTDIR)$(docdir)
${INSTALL_DATA} $(top_srcdir)/manpages/*.1.gz $(DESTDIR)$(mandir)/man1
(cd $(DESTDIR)$(mandir)/man1; \
for file in ${MANPAGES_AUTOGEN}; do $(LN_S) dmtcp.1.gz $$file; done)
endif
uninstall:
cd src && make DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
cd plugin && make DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
cd contrib && make DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
ifeq ($(M32),0)
rm -Rf "$(DESTDIR)$(docdir)"
cd $(DESTDIR)$(mandir)/man1 && rm -f ${MANPAGES} ${MANPAGES_AUTOGEN}
endif
# src/Makefile tries to make this, to ensure that configure, config.status,
# and so on are up to date. It's assuming that this directory is also
# under control of automake. So, we add this stub to satisfy automake.
am--refresh:
.PHONY: default all add-git-hooks \
display-build-env display-release display-config build \
build-multilib build-multilib-m32 build-multilib-m64 \
mkdirs dmtcp plugin contrib clean distclean am--refresh \
tests tests-32