Skip to content

Commit e2dfe19

Browse files
committed
Makefile.in: Using current $CC in dmtcp/config.log?
1 parent 0f882dc commit e2dfe19

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

Makefile.in

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,25 @@ DMTCP_ROOT ?= $(top_builddir)/dmtcp
4242
# Macros TEST and XTERM_E used on command line by check1, check2, ...:
4343
# make TEST=readline XTERM_E="xterm -e" check-readline
4444

45+
# MANA configure does configure DMTCP. But no re-make in DMTCP. Check ${CC}.
4546
default: display-build-env add-git-hooks mana_prereqs
47+
$(MAKE) maybe_clean_dmtcp
4648
$(MAKE) mana
4749

50+
# MANA configure does configure DMTCP and 'make'; but doesn't do a 'clean'.
51+
# This saves having to re-compile DMTCP when clean'ing MANA.
52+
# But if a previous 'make' used a different ${CC} version, then do 'clean'.
53+
maybe_clean_dmtcp:
54+
@ cc_version="$$(${CC}} --version | head -1 | tr -d '\n')" ; \
55+
if test ! -e dmtcp/bin/dmtcp_coordinator || \
56+
test ! -e dmtcp/config.log || \
57+
! grep --quiet "$${cc_version}" dmtcp/config.log; then \
58+
echo "** DMTCP: not present, or else compiler version"; \
59+
echo " is not current: $${cc_version}"; \
60+
echo "** Doing 'clean' in dmtcp subdirectory."; \
61+
cd ${DMTCP_ROOT} && ${MAKE} clean; \
62+
fi
63+
4864
all: default
4965

5066
mana: mana_prereqs dmtcp
@@ -82,14 +98,15 @@ distclean: clean
8298
rm -rf $(top_builddir)/lib
8399
- cd $(top_builddir)/bin && find . \! -name '*mana*' -delete
84100

101+
clean: tidy
102+
$(MAKE) maybe_clean_dmtcp
103+
cd mpi-proxy-split && $(MAKE) clean
104+
85105
tidy:
86106
rm -rf ckpt_rank*
87107
rm -f ckpt_*.dmtcp dmtcp_restart_script*
88108
rm -f dmtcp_coordinator_db-*.json
89109

90-
clean: tidy
91-
cd mpi-proxy-split && $(MAKE) clean
92-
93110
mana_prereqs:
94111
@ if test -n "$$HUGETLB_DEFAULT_PAGE_SIZE"; then \
95112
echo '** Env. var. HUGETLB_DEFAULT_PAGE_SIZE detected.'; \

0 commit comments

Comments
 (0)