Target cleanup and extended help system
[zope-bootstrap.git] / Makefile.master
index 136a906..4d69e96 100644 (file)
 #        <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.
 #
 
 ###########################################################################
@@ -66,7 +76,7 @@ define httpget
        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                                                                    \
@@ -95,9 +105,9 @@ shorthelp::
        @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"
@@ -121,19 +131,16 @@ shorthelp::
        @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"
@@ -146,6 +153,20 @@ help:: shorthelp
        @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
@@ -170,7 +191,6 @@ bootstrap::
 .PHONY: bootstrap
 
 update:: update-hook
-       bin/buildout $(BUILDOUT_OPTS)
 .PHONY: update
 
 define gitignore
@@ -182,8 +202,6 @@ define gitignore
 endef
 .gitignore::
        @echo "Updating .gitignore."
-       @$(gitignore) "*.pyc"
-       @$(gitignore) "*.egg-info/"
        @$(gitignore) "/.env"
 
 define env
@@ -214,11 +232,6 @@ init-nonet: HTTPGET_NONET=1
 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
@@ -232,3 +245,8 @@ cleancache:
 
 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