Commit 6507ed85 authored by Chris McDonough's avatar Chris McDonough

Bring Windows makefile in line with UNIX makefile.

parent 1cb66a10
...@@ -15,11 +15,11 @@ BASE_DIR=<<BASE_DIR>> ...@@ -15,11 +15,11 @@ BASE_DIR=<<BASE_DIR>>
BUILD_BASE=<<BUILD_BASE>> BUILD_BASE=<<BUILD_BASE>>
DISTUTILS_OPTS=<<DISTUTILS_OPTS>> DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
INSTALL_FLAGS=<<INSTALL_FLAGS>> INSTALL_FLAGS=<<INSTALL_FLAGS>>
BUILD_SUBDIR=build TESTOPTS=-v1 -e -d lib/python
BUILD_FLAGS=--build-base="$(BUILD_BASE)" \ BUILD_FLAGS=--build-base="$(BUILD_BASE)" \
--build-lib="$(BUILD_BASE)\$(BUILD_SUBDIR)" \ --build-lib="$(BUILD_BASE)\build-lib" \
--build-scripts="$(BUILD_BASE)\$(BUILD_SUBDIR)\build_scripts.tmp" \ --build-scripts="$(BUILD_BASE)\build-scripts" \
--build-temp="$(BUILD_BASE)\$(BUILD_SUBDIR)\build_temp.tmp" --build-temp="$(BUILD_BASE)\build-temp"
RM=del /f /q RM=del /f /q
!IF ("$(OS)" == "Windows_NT") !IF ("$(OS)" == "Windows_NT")
...@@ -31,18 +31,26 @@ CD=cd ...@@ -31,18 +31,26 @@ CD=cd
XCOPY=xcopy /i /s /e /y XCOPY=xcopy /i /s /e /y
COPY=copy COPY=copy
.PHONY : clean install uninstall instance untestinst testinst .PHONY: clean install uninstall instance untestinst testinst build unbuild
.PHONY: default
default: build default: build
# default: The default step (invoked when make is called without a target)
@ echo.
@ echo Zope built. Next, do 'nmake install' (or 'nmake instance'
@ echo to run a Zope instance directly from the build directory\).
@ echo
# build: Do whatever 'setup.py build' implies
build: build:
$(PYTHON) "$(BASE_DIR)\setup.py" \ $(PYTHON) "$(BASE_DIR)\setup.py" \
$(DISTUTILS_OPTS) build $(BUILD_FLAGS) $(DISTUTILS_OPTS) build $(BUILD_FLAGS)
@ echo.
@ echo Zope built. Next, do 'nmake install' (or 'nmake instance'
@ echo to run a Zope instance directly from the build directory).
@ echo.
# unbuild: Remove the build directory (undo the make build step)
unbuild:
$(RMRF) $(BUILD_BASE)
# install: Install a software home.
install: build install: build
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \ $(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \
--prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS) --prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
...@@ -50,37 +58,47 @@ install: build ...@@ -50,37 +58,47 @@ install: build
@ echo Zope binaries installed successfully. @ echo Zope binaries installed successfully.
@ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance' @ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance'
instance: build # uninstall: Uninstall a software home.
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) build_ext -i
$(PYTHON) "$(BASE_DIR)\bin\mkzopeinstance" .
# testinst makes an instance home in the build directory without asking
# any questions. this is useful when testing. instances made with
# this can be removed via "make untestinst"
testinst: build
$(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) build_ext -i
$(PYTHON) "$(BASE_DIR)\bin\mkzopeinstance" --user=admin:admin .
# remove the instance files made with testinst (w/ prejudice)
untestinst:
$(RM) "$(BASE_DIR)/bin/zopectl.py"
$(RM) "$(BASE_DIR)/bin/ntservice.py"
$(RMRF) "$(BASE_DIR)/etc"
$(RMRF) "$(BASE_DIR)/log"
uninstall: uninstall:
$(RMRF) "$(PREFIX)" $(RMRF) "$(PREFIX)"
TESTOPTS=-v1 -d lib/python # inplace: Install a software home into to the source directory.
#
test: build # 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: install
# instance: Do an inplace build and create an instance home in the resulting
# software home.
instance: inplace
$(PYTHON) "$(BASE_DIR)\bin\mkzopeinstance" $(MKZ_FLAGS) "$(BASE_DIR)"
# 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
testinst: instance
# test: Do an inplace build and run the Zope test suite.
test: inplace
$(PYTHON) "$(BASE_DIR)\utilities\testrunner.py" $(TESTOPTS) $(PYTHON) "$(BASE_DIR)\utilities\testrunner.py" $(TESTOPTS)
clean: # clean: Delete the build files and any binaries/bytecode files in
$(RMRF) "$(BUILD_BASE)\$(BUILD_SUBDIR)" # the source directory for good measure.
clean: unbuild
$(CD) "$(BASE_DIR) $(CD) "$(BASE_DIR)
$(RM) /s *.pyc *pyo $(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
# clobber: Make the source tree 'pristine' again.
clobber: clean uninstance
clobber: clean untestinst
$(RM) /s *.obj *.pyd
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