Skip to content

Commit

Permalink
Trac #29310: "make distclean" should not run "./configure"
Browse files Browse the repository at this point in the history
As the summary says. It may be good enough to move the targets `clean`,
`sagelib-clean`, `build-clean`, `doc-clean`, `doc-src-clean`, and `doc-
output-clean` from `build/make/deps` to the top-level `Makefile`.

This would make things faster and more quiet.

Related:

- #30258: Have configure run quiet if started by make in silent mode
- #29097: Rename make targets SPKG-clean to SPKG-uninstall

URL: https://trac.sagemath.org/29310
Reported by: jhpalmieri
Ticket author(s): John Palmieri
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Dec 25, 2021
2 parents c9093db + e28f093 commit da90b23
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 43 deletions.
44 changes: 43 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,47 @@ dist: build/make/Makefile
ssl: all
./sage -i pyopenssl

###############################################################################
# Cleaning up
###############################################################################

SAGE_ROOT = $(CURDIR)
SAGE_SRC = $(SAGE_ROOT)/src

clean:
@echo "Deleting package build directories..."
if [ -f "$(SAGE_SRC)"/bin/sage-env-config ]; then \
. "$(SAGE_SRC)"/bin/sage-env-config; \
if [ -n "$$SAGE_LOCAL" ]; then \
rm -rf "$$SAGE_LOCAL/var/tmp/sage/build"; \
fi; \
fi

# "c_lib", ".cython_version", "build" in $(SAGE_SRC) are from old sage versions
# Cleaning .so files (and .c and .cpp files associated with .pyx files) is for editable installs.
# Also cython_debug is for editable installs.
sagelib-clean:
@echo "Deleting Sage library build artifacts..."
if [ -d "$(SAGE_SRC)" ]; then \
(cd "$(SAGE_SRC)" && \
rm -rf c_lib .cython_version cython_debug; \
rm -rf build; find . -name '*.pyc' -o -name "*.so" | xargs rm -f; \
rm -f $$(find . -name "*.pyx" | sed 's/\(.*\)[.]pyx$$/\1.c \1.cpp/'); \
rm -rf sage/ext/interpreters) \
&& (cd "$(SAGE_ROOT)/build/pkgs/sagelib/src/" && rm -rf build); \
fi

sage_docbuild-clean:
(cd "$(SAGE_ROOT)/build/pkgs/sage_docbuild/src" && rm -rf build)

sage_setup-clean:
(cd "$(SAGE_ROOT)/build/pkgs/sage_setup/src" && rm -rf build)

build-clean: clean doc-clean sagelib-clean sage_docbuild-clean

doc-clean:
cd "$(SAGE_SRC)/doc" && $(MAKE) clean

# Deleting src/lib is to get rid of src/lib/pkgconfig
# that was forgotten to clean in #29082.
misc-clean:
Expand Down Expand Up @@ -276,4 +317,5 @@ list:
misc-clean bdist-clean distclean bootstrap-clean maintainer-clean \
test check testoptional testall testlong testoptionallong testallong \
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong \
buildbot-python3 list
buildbot-python3 list \
doc-clean clean sagelib-clean build-clean
41 changes: 3 additions & 38 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ SAGE_I_TARGETS = sagelib doc
all-start build-start base toolchain toolchain-deps base-toolchain \
sagelib \
doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
doc-clean doc-src-clean doc-output-clean \
clean sagelib-clean build-clean python3_venv _clean-broken-gcc
doc-uninstall \
python3_venv _clean-broken-gcc

PYTHON_FOR_VENV = @PYTHON_FOR_VENV@

Expand Down Expand Up @@ -347,43 +347,9 @@ doc-html-jsmath: doc-html-mathjax

doc-pdf: sagemath_doc_pdf

doc-clean: doc-src-clean doc-output-clean

doc-src-clean:
cd "$(SAGE_SRC)/doc" && $(MAKE) clean

doc-output-clean:
doc-uninstall:
rm -rf "$(SAGE_SHARE)/doc/sage"


###############################################################################
# Cleaning up
###############################################################################

clean:
@echo "Deleting package build directories..."
rm -rf "$(SAGE_LOCAL)/var/tmp/sage/build"

# "c_lib", ".cython_version", "build" in $(SAGE_SRC) are from old sage versions
# Cleaning .so files (and .c and .cpp files associated with .pyx files) is for editable installs.
# Also cython_debug is for editable installs.
sagelib-clean:
@echo "Deleting Sage library build artifacts..."
(cd "$(SAGE_SRC)" && \
rm -rf c_lib .cython_version cython_debug; \
rm -rf build; find . -name '*.pyc' -o -name "*.so" | xargs rm -f; \
rm -f $$(find . -name "*.pyx" | sed 's/\(.*\)[.]pyx$$/\1.c \1.cpp/'); \
rm -rf sage/ext/interpreters) \
&& (cd "$(SAGE_ROOT)/build/pkgs/sagelib/src/" && rm -rf build)

sage_docbuild-clean:
(cd "$(SAGE_ROOT)/build/pkgs/sage_docbuild/src" && rm -rf build)

sage_setup-clean:
(cd "$(SAGE_ROOT)/build/pkgs/sage_setup/src" && rm -rf build)

build-clean: clean doc-clean sagelib-clean sage_docbuild-clean

# Special target for cleaning up a broken GCC install detected by configure
# This should check for the .clean-broken-gcc stamp, and if found clean
# everything up along with the stamp file itself. This target is then run
Expand All @@ -397,7 +363,6 @@ _clean-broken-gcc:
rm -f "$(SAGE_ROOT)/build/make/.clean-broken-gcc"; \
echo "Cleaned up old broken GCC install"; \
fi

#==============================================================================
# Setting SAGE_CHECK... variables
#==============================================================================
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=40df2ac9634227a77a83b6524ba9696b961c3fb6
md5=696e5df05ca484f2de649d104e6a5149
cksum=589835683
sha1=5860964905c359ad0db75952db18d07c26fd1a81
md5=80aadbd805aed4f156ceeee80baf35e0
cksum=1321993970
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b879fe3b0554c844c224d7b139f698caef4c3905
614084eee1118216826031c834ec8977a898d6ce

0 comments on commit da90b23

Please sign in to comment.