Commit d9481348 authored by Sidnei da Silva's avatar Sidnei da Silva

parent 625b8da3
......@@ -11,7 +11,7 @@ PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
PYTHON="<<PYTHON>>"
ZPKG=zpkg
TMPDIR=/tmp
TMPDIR=<<TMP_DIR>>
PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
......
......@@ -10,16 +10,14 @@ RELEASE_TAG=<<VERSION_RELEASE_TAG>>
PACKAGE_NAME=$(NAME)-$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
PYTHON="<<PYTHON>>"
PREFIX=<<PREFIX>>
BASE_DIR=<<BASE_DIR>>
BUILD_BASE=<<BUILD_BASE>>
ZPKG=zpkg
TMPDIR="<<TMP_DIR>>"
PREFIX="<<PREFIX>>"
BASE_DIR="<<BASE_DIR>>"
DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>>
TESTOPTS=-v
BUILD_FLAGS=--build-base="$(BUILD_BASE)" \
--build-lib="$(BUILD_BASE)\build-lib" \
--build-scripts="$(BUILD_BASE)\build-scripts" \
--build-temp="$(BUILD_BASE)\build-temp"
BUILD_FLAGS=-i
RM=del /f /q
!IF ("$(OS)" == "Windows_NT")
......@@ -37,37 +35,74 @@ default: build
@ echo Zope built. Next, do 'nmake install'.
@ echo.
.PHONY: clean install build unbuild
.PHONY: default
.PHONY : clean install instance untestinst testinst build
.PHONY : default
# build: Do whatever 'setup.py build' implies
build:
$(PYTHON) "$(BASE_DIR)\setup.py" \
$(DISTUTILS_OPTS) build $(BUILD_FLAGS)
# unbuild: Remove the build directory (undo the make build step)
unbuild:
-$(RMRF) $(BUILD_BASE)
$(DISTUTILS_OPTS) build_ext $(BUILD_FLAGS)
# install: Install a software home.
install: build version_txt
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \
--prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) \
build_ext $(BUILD_FLAGS) \
install --home="$(PREFIX)" $(INSTALL_FLAGS)
@ echo.
@ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
# inplace: Do an in-place build
inplace: build
# test: Do an inplace build and run the Zope test suite.
test: inplace
$(PYTHON) "$(BASE_DIR)\test.py" $(TESTOPTS)
# instance: Do an inplace build and create an instance home in the resulting
# software home.
instance: build
$(PYTHON) "$(BASE_DIR)\utilities\mkzopeinstance.py" $(MKZ_FLAGS)
# testinst: Perform an inplace build and create an instance home in the
# resulting software home without asking questions. Useful when
# performing automated testing.
# testinst: MKZ_FLAGS=--user=admin:admin --dir="$(BASE_DIR)"
# testinst: instance
# uninstance: Remove the instance files made by testinstance (w/ prejudice)
uninstance:
$(RMRF) "$(BASE_DIR)/bin"
$(RMRF) "$(BASE_DIR)/etc"
$(RMRF) "$(BASE_DIR)/import"
$(RMRF) "$(BASE_DIR)/log"
$(RMRF) "$(BASE_DIR)/var"
$(RMRF) "$(BASE_DIR)/Products"
# clean: Delete the build files and any binaries/bytecode files in
# the source directory for good measure.
clean:
$(CD) "$(BASE_DIR)"
-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-$(RM) "$(BASE_DIR)\lib\python\version.txt"
-$(RMRF) build
# version_txt: create a version file in lib/python/version.txt
version_txt:
echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) >\
"$(BASE_DIR)/lib/python/version.txt"
# clean: Delete the build files and any binaries/bytecode files in
# the source directory for good measure.
clean: unbuild
$(CD) "$(BASE_DIR)
-$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
-$(RM) (BASE_DIR)\lib\python\version.txt
# Building a source distribution requires that zpkg be available:
sdist: version_txt
$(ZPKG) -C $(BASE_DIR)\releases\Zope2.cfg -r $(MAJOR_VERSION).$(MINOR_VERSION)$(RELEASE_TAG)
# clobber: Make the source tree 'pristine' again.
clobber: clean uninstance
# distclean: Make the source tree *really* 'pristine' again.
distclean: clobber
$(RM) makefile Makefile
$(RMRF) build-base
......@@ -17,6 +17,7 @@ import getopt
import os
import sys
import versions
import tempfile
QUIET=0
......@@ -34,6 +35,7 @@ def main():
global PREFIX
BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
PYTHON=sys.executable
TMP_DIR = tempfile.gettempdir()
MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read()
REQUIRE_LF_ENABLED = 1
REQUIRE_ZLIB = 1
......@@ -82,6 +84,7 @@ def main():
'<<PYTHON>>':PYTHON,
'<<PREFIX>>':PREFIX,
'<<BASE_DIR>>':BASE_DIR,
'<<TMP_DIR>>':TMP_DIR,
'<<INSTALL_FLAGS>>':INSTALL_FLAGS,
'<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_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