sed -i -e '1s/^#!.*\/python/#!$(subst /,\/,$(PYTHON))/' $(PYTHON_DIR)/bin/*
$(PYTHON) -c 'from zc.buildout.buildout import main; main(["bootstrap"])'
+update::
+ bin/buildout $(BUILDOUT_OPTS)
+
.gitignore::
+ @$(gitignore) "*.egg-info/"
@$(gitignore) "/buildout-net.cfg"
@$(gitignore) "/buildout-nonet.cfg"
clean::
rm -f buildout-net.cfg buildout-nonet.cfg
+
+versions:
+ @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages"
+ @bin/buildout -vvvvv | sed -ne 's/^Picked: //p' | sort | uniq
+.PHONY: versions
+
+fullhelp::
+ @echo " versions"
+ @echo " Generate lines to be added to 'buildout.cfg' to pin all package"
+ @echo " versions."
+ @echo
# <other> Set variable to <value>
#
# clean::
-# Called to clean up all generated files
+# Called to clean up all unimportant generated files. This includes all files
+# which may be recreated by calling 'init'
+#
+# shorthelp::
+# Called to provide an overview of important target (this is the default target)
+#
+# fullhelp::
+# Called to create the list of supplementary targets.
+#
+# varhelp::
+# Called to create the list of Makefile variables.
#
###########################################################################
name="$${1##*/}"; \
target="$$2"; \
[ -n "$$target" ] || target="$$name"; \
- cache="$(DLCACHE)/$$name"; \
+ cache="$(BASEDIR)/$(DLCACHE)/$$name"; \
if [ -r "$$cache" ]; then \
echo "Fetching '$$name' from cache."; \
else \
@echo
@echo "MAIN TARGETS"
@echo
- @echo " shorthelp"
+ @echo " shorthelp (default target)"
@echo " help"
- @echo " Summary of important / all user targets"
+ @echo " Summary of important targets / complete help."
@echo
@echo " debdepends"
@echo " Install debian packages via 'aptitude' needed to satisy build"
@echo " for the local buildout."
@echo
@echo " clean"
- @echo " Remove all unimportant (!) generated files. This target will leave"
- @echo " only those files which are to be checked into version control."
- @echo " calling 'make init' or 'make init-nonet' will rebuild the buildout."
+ @echo " Remove all unimportant (!) generated files (the remaining files are"
+ @echo " those which may be changed and should be managed as part of the"
+ @echo " project source-code). calling 'make init' or 'make init-nonet' will"
+ @echo " rebuild the development environment."
@echo
.PHONY: shorthelp
-help:: shorthelp
+fullhelp::
@echo
- @echo "SECONDARY TARGETS"
- @echo
- @echo " versions"
- @echo " Generate lines to be added to 'buildout.cfg' to pin all package"
- @echo " versions."
+ @echo "SUPPLEMENTARY TARGETS"
@echo
@echo " cleancache"
@echo " purge the download cache"
@echo " target purges the download cache to ensure, no obsolete files are"
@echo " left."
@echo
+.PHONY: fullhelp
+
+varhelp::
+ @echo
+ @echo "MAKEFILE VARIABLES"
+ @echo
+ @echo " DLCACHE ($(DLCACHE))"
+ @echo " Name of the download-cache subdirectory. This directory may be"
+ @echo " persisted e.g. by checking into version control (together with"
+ @echo " the source code or into as a separate repository or by saving into"
+ @echo " an archive. A persistent cache allows the setup to be completely"
+ @echo " reproducible and network independent."
+ @echo
+.PHONY: varhelp
debdepends::
.PHONY: debdepends
.PHONY: bootstrap
update:: update-hook
- bin/buildout $(BUILDOUT_OPTS)
.PHONY: update
define gitignore
endef
.gitignore::
@echo "Updating .gitignore."
- @$(gitignore) "*.pyc"
- @$(gitignore) "*.egg-info/"
@$(gitignore) "/.env"
define env
init-nonet: init
.PHONY: init-nonet
-versions:
- @echo "# Add the following lines to [versions] in buildout.cfg to pin all packages"
- @bin/buildout -vvvvv | sed -ne 's/^Picked: //p' | sort | uniq
-.PHONY: versions
-
shell:
@eval "`cat .env`"; $$SHELL
.PHONY: shell
upgrade: clean cleancache init
.PHONY: upgrade
+
+help:
+ @[ -n `which less` ] && $(MAKE) -s shorthelp fullhelp varhelp | less \
+ || $(MAKE) -s shorthelp fullhelp varhelp
+.PHONY: help
\ No newline at end of file
setup:: pil
-help::
+fullhelp::
@echo " pil-rebuild"
@echo " recompile PIL plugin from source. This may be needed after"
@echo " upgrading the host distribution."
+ @echo
+
+varhelp::
+ @echo " PIL_VERSION ($(PIL_VERSION))"
+ @echo " Version of the Python Imaging Library to install."
+ @echo
+ @echo " PIL_URL ($(PIL_URL))"
+ @echo " URL to download the Python Imaging Library from. The default value"
+ @echo " is automatically generated from PIL_VERSION."
@echo
\ No newline at end of file
PYTHON_VERSION ?= 2.4.6
PYTHON_URL ?= http://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz
SETUPTOOLS_URL ?= http://peak.telecommunity.com/dist/ez_setup.py
+PYTHON_DIR ?= python
###########################################################################
-PYTHON_DIR ?= python
-
PYTHON = $(BASEDIR)/$(PYTHON_DIR)/bin/python
EASY_INSTALL = $(BASEDIR)/$(PYTHON_DIR)/bin/easy_install
PIP = $(BASEDIR)/$(PYTHON_DIR)/bin/pip
@$(install) zc.buildout
.gitignore::
- @$(gitignore) /python/
+ @$(gitignore) "*.pyc"
+ @$(gitignore) "/python/"
.env::
@$(env) PATH $(BASEDIR)/$(PYTHON_DIR)/bin
init-nonet: PIP_OPTS = --no-index $(patsubst %,--find-link=file://$(BASEDIR)/$(DLCACHE)/pip/%,$(PIP_CACHE_FILES))
-help::
+fullhelp::
@echo " python-rebuild"
@echo " recompile python from source. This may be needed after"
@echo " upgrading the host distribution."
- @echo
\ No newline at end of file
+ @echo
+
+varhelp::
+ @echo " PYTHON_VERSION ($(PYTHON_VERSION))"
+ @echo " Python version to download and compile."
+ @echo
+ @echo " PYTHON_URL ($(PYTHON_URL))"
+ @echo " URL to download python from. The default value is automatically"
+ @echo " generated from PYTHON_VERSION."
+ @echo
+ @echo " SETUPTOOLS_URL ($(SETUPTOOLS_URL))"
+ @echo " URL to download 'ez_setup.py' from."
+ @echo
+ @echo " PYTHON_DIR ($(PYTHON_DIR))"
+ @echo " Name of subdirectory for the local python installation."
+ @echo
clean::
rm -rf bin develop-eggs $(EGGDIR) parts .installed.cfg
+
+varhelp::
+ @echo " PROJECTNAME ($(PROJECTNAME))"
+ @echo " Name of the project egg. Must be set before creating the initial"
+ @echo " buildout."
+ @echo
+ @echo " ADMINUSER ($(ADMINUSER))"
+ @echo " Name of the default zope3 administrator. Only honored when creating"
+ @echo " a new buildout. Later, configure in 'site.zcml'."
+ @echo
+ @echo " ADMINPWD ($(ADMINPWD))"
+ @echo " Password of the default zope3 administrator. Only honored when"
+ @echo " creating a new buildout. Later, configure in 'site.zcml'."
+ @echo
+ @echo " EGGDIR ($(EGGDIR))"
+ @echo " Directory for eggs downloaded by 'buildout'. Only honored when"
+ @echo " creating a new buildout. Later, configure in 'buildout.cfg'."
+ @echo