Commit 191d706c authored by Fred Drake's avatar Fred Drake

start cleaning out the trash; there is more...

(the Zope 2 makefile does way too much...)
parent 1542a4b6
...@@ -38,8 +38,7 @@ usage() ...@@ -38,8 +38,7 @@ usage()
{ {
echo echo
echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] " echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] "
echo " [--build-base=path] [--ignore-largefile] [--ignore-zlib]" echo " [--ignore-largefile] [--ignore-zlib] [--optimize]"
echo " [--optimize]"
echo echo
echo " Creates a Makefile suitable for building and installing Zope" echo " Creates a Makefile suitable for building and installing Zope"
echo echo
...@@ -48,7 +47,6 @@ usage() ...@@ -48,7 +47,6 @@ usage()
echo " --quiet suppress nonessential output" echo " --quiet suppress nonessential output"
echo " --with-python specify a path to a Python interpreter to use" echo " --with-python specify a path to a Python interpreter to use"
echo " --prefix specify an installation path for binary data" echo " --prefix specify an installation path for binary data"
echo " --build-base specify a temporary path for build files"
echo " --ignore-largefile ignore large file support warnings" echo " --ignore-largefile ignore large file support warnings"
echo " --ignore-expat ignore warnings about expat/pyexpat" echo " --ignore-expat ignore warnings about expat/pyexpat"
echo " --ignore-zlib ignore warnings about zlib" echo " --ignore-zlib ignore warnings about zlib"
......
...@@ -10,17 +10,14 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>> ...@@ -10,17 +10,14 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>>
PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG} PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
PYTHON="<<PYTHON>>" PYTHON="<<PYTHON>>"
ZPKG=zpkg
TMPDIR=/tmp TMPDIR=/tmp
PREFIX=<<PREFIX>> PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>> BASE_DIR=<<BASE_DIR>>
BUILD_BASE=<<BUILD_BASE>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>> DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>> INSTALL_FLAGS=<<INSTALL_FLAGS>>
TESTOPTS=-v TESTOPTS=-v
BUILD_FLAGS=--build-base="${BUILD_BASE}" \ BUILD_FLAGS=-i
--build-lib="${BUILD_BASE}/build-lib" \
--build-scripts="${BUILD_BASE}/build-scripts"\
--build-temp="${BUILD_BASE}/build-temp"
RM=rm -f RM=rm -f
RMRF=rm -rf RMRF=rm -rf
...@@ -32,7 +29,7 @@ CP=cp ...@@ -32,7 +29,7 @@ CP=cp
TAR=tar TAR=tar
MKDIR=mkdir -p MKDIR=mkdir -p
.PHONY : clean install instance untestinst testinst build unbuild .PHONY : clean install instance untestinst testinst build
.PHONY : default .PHONY : default
# default: The default step (invoked when make is called without a target) # default: The default step (invoked when make is called without a target)
...@@ -42,36 +39,22 @@ default: build ...@@ -42,36 +39,22 @@ default: build
@echo to run a Zope instance directly from the build directory\). @echo to run a Zope instance directly from the build directory\).
@echo @echo
# build: Do whatever 'setup.py build' implies # build:
build: build:
${PYTHON} "${BASE_DIR}/setup.py" \ ${PYTHON} "${BASE_DIR}/setup.py" \
${DISTUTILS_OPTS} build ${BUILD_FLAGS} ${DISTUTILS_OPTS} build_ext ${BUILD_FLAGS}
# unbuild: Remove the build directory (undo the make build step)
unbuild:
${RMRF} ${BUILD_BASE}
# install: Install a software home. # install: Install a software home.
install: build version_txt install: version_txt
${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} install \ ${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} \
--home="${PREFIX}" ${BUILD_FLAGS} ${INSTALL_FLAGS} build_ext ${BUILD_FLAGS} \
install --skip-build --home="${PREFIX}" ${INSTALL_FLAGS}
[ -f ${PREFIX}/bin/python ] || ${LN} ${PYTHON} ${PREFIX}/bin/python [ -f ${PREFIX}/bin/python ] || ${LN} ${PYTHON} ${PREFIX}/bin/python
@echo @echo
@echo Zope binaries installed successfully. @echo Zope binaries installed successfully.
@echo Now run \'${PREFIX}/bin/mkzopeinstance.py\' @echo Now run \'${PREFIX}/bin/mkzopeinstance.py\'
# inplace: Install a software home into to the source directory. # inplace: Install a software home into to the source directory.
#
# Note: We used to run 'build_ext -i' for 'inplace', but that was
# suboptimal because it had a tendency to try to rebuild all of the
# (possibly already-built) extensions that might be built during a
# previous 'make' step. built_ext doesn't understand '--build-base'
# and friends so we can't stop it from doing this easily. So instead,
# we rely on the stock install step and name the prefix as the current
# directory. This is a little less efficient than just building the
# extensions because it also compiles bytecode, but it's more intuitive and
# less expensive in the common case than letting distutils
# potentially rebuild the binaries when we've done that already.
inplace: PREFIX=${BASE_DIR} inplace: PREFIX=${BASE_DIR}
inplace: install inplace: install
...@@ -101,7 +84,7 @@ test: inplace ...@@ -101,7 +84,7 @@ test: inplace
# clean: Delete the build files and any binaries/bytecode files in # clean: Delete the build files and any binaries/bytecode files in
# the source directory for good measure. # the source directory for good measure.
clean: unbuild clean:
${FIND} "${BASE_DIR}" \ ${FIND} "${BASE_DIR}" \
-name '*.py[co]' -o -name '*.so' -o -name '*.o' | ${XARGS} ${RM} -name '*.py[co]' -o -name '*.so' -o -name '*.o' | ${XARGS} ${RM}
...@@ -110,23 +93,9 @@ version_txt: ...@@ -110,23 +93,9 @@ version_txt:
printf "Zope ${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}" >\ printf "Zope ${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}" >\
"${BASE_DIR}/lib/python/version.txt" "${BASE_DIR}/lib/python/version.txt"
# sdist: Create a source distribution file (implies clobber). # Building a source distribution requires that zpkg be available:
# sdist:
sdist: clobber sdist_tgz ${ZPKG} -C ${BASE_DIR}/releases/Zope2.cfg
# sdist_tgz: Create a tgz archive file as a source distribution.
#
sdist_tgz: version_txt
${MKDIR} ${TMPDIR}
${CD} ${TMPDIR} && ${LN} ${BASE_DIR} ${PACKAGE_NAME} && \
${TAR} czfh ${BASE_DIR}/${PACKAGE_NAME}.tgz \
--exclude=${PACKAGE_NAME}.tgz\
--exclude=.svn\
--exclude=makefile \
--exclude=build-base \
--exclude=*~ \
--exclude=.#* ${PACKAGE_NAME}
${RMRF} ${TMPDIR}/${PACKAGE_NAME}
# clobber: Make the source tree 'pristine' again. # clobber: Make the source tree 'pristine' again.
clobber: clean uninstance clobber: clean uninstance
......
...@@ -33,7 +33,6 @@ def main(): ...@@ -33,7 +33,6 @@ def main():
# below assumes this script is in the BASE_DIR/inst directory # below assumes this script is in the BASE_DIR/inst directory
global PREFIX global PREFIX
BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
BUILD_BASE=os.path.join(os.getcwd(), 'build-base', 'python-%s.%s' % sys.version_info[:2])
PYTHON=sys.executable PYTHON=sys.executable
MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read()
REQUIRE_LF_ENABLED = 1 REQUIRE_LF_ENABLED = 1
...@@ -66,8 +65,6 @@ def main(): ...@@ -66,8 +65,6 @@ def main():
INSTALL_FLAGS = '--optimize=1 --no-compile' INSTALL_FLAGS = '--optimize=1 --no-compile'
if o == '--no-compile': if o == '--no-compile':
INSTALL_FLAGS = '--no-compile' INSTALL_FLAGS = '--no-compile'
if o == '--build-base':
BUILD_BASE = a
if o == '--quiet': if o == '--quiet':
DISTUTILS_OPTS = '-q' DISTUTILS_OPTS = '-q'
global QUIET global QUIET
...@@ -85,7 +82,6 @@ def main(): ...@@ -85,7 +82,6 @@ def main():
'<<PYTHON>>':PYTHON, '<<PYTHON>>':PYTHON,
'<<PREFIX>>':PREFIX, '<<PREFIX>>':PREFIX,
'<<BASE_DIR>>':BASE_DIR, '<<BASE_DIR>>':BASE_DIR,
'<<BUILD_BASE>>':BUILD_BASE,
'<<INSTALL_FLAGS>>':INSTALL_FLAGS, '<<INSTALL_FLAGS>>':INSTALL_FLAGS,
'<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION, '<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION,
'<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION, '<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment