changeset 394:bb2b329f85d3

new command "make download"
author Volker Grabsch <vog@notjusthosting.com>
date Tue, 16 Jun 2009 21:57:25 +0200
parents e5d8bae9ec6a
children efb6136728a8
files Makefile doc/index.html
diffstat 2 files changed, 43 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Jun 13 00:27:06 2009 +0200
+++ b/Makefile	Tue Jun 16 21:57:25 2009 +0200
@@ -69,18 +69,25 @@
 .PHONY: all
 all: $(PKG_RULES)
 
+.PHONY: download
+download: $(addprefix download-,$(PKG_RULES))
+
 define PKG_RULE
-.PHONY: $(1)
-$(1): $(PREFIX)/installed-$(1)
-$(PREFIX)/installed-$(1): $(TOP_DIR)/src/$(1).mk \
-                          $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \
-                          $(addprefix $(PREFIX)/installed-,$($(1)_DEPS))
-	[ -d '$(PREFIX)' ] || mkdir -p '$(PREFIX)'
+.PHONY: download-$(1)
+download-$(1): $(TOP_DIR)/src/$(1).mk $(addprefix download-,$($(1)_DEPS))
 	[ -d '$(PKG_DIR)' ] || mkdir -p '$(PKG_DIR)'
 	if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \
 	    $(call DOWNLOAD_PKG_ARCHIVE,$(1)); \
 	    $(call CHECK_PKG_ARCHIVE,$(1)) || { echo 'Wrong checksum!'; exit 1; }; \
 	    fi
+
+.PHONY: $(1)
+$(1): $(PREFIX)/installed-$(1)
+$(PREFIX)/installed-$(1): $(TOP_DIR)/src/$(1).mk \
+                          download-$(1) \
+                          $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \
+                          $(addprefix $(PREFIX)/installed-,$($(1)_DEPS))
+	[ -d '$(PREFIX)' ] || mkdir -p '$(PREFIX)'
 	$(if $(value $(1)_BUILD),
 	    rm -rf   '$(2)'
 	    mkdir -p '$(2)'
--- a/doc/index.html	Sat Jun 13 00:27:06 2009 +0200
+++ b/doc/index.html	Tue Jun 16 21:57:25 2009 +0200
@@ -377,6 +377,10 @@
         <p>
         Almost all packages are updated to their latest version.
         </p>
+
+        <p>
+        The command "make download" is implemented.
+        </p>
     </dd>
 
     <dt>Old Releases</dt>
@@ -530,6 +534,10 @@
 <div class="section">
 <h2 id="usage">Usage</h2>
 
+    <p>
+    All build commands also download the packages if necessary.
+    </p>
+
     <dl class="usage">
 
     <dt>make</dt>
@@ -563,6 +571,28 @@
         each with up to 2 compiler processes running in parallel
         </dd>
 
+    <dt>make download</dt>
+
+        <dd>
+        download all packages,
+        non-parallel,
+        such that subsequent builds work without internet access
+        </dd>
+
+    <dt>make download-foo download-bar</dt>
+
+        <dd>
+        download packages "foo", "bar" and their dependencies,
+        non-parallel
+        </dd>
+
+    <dt>make download-foo download-bar -j 4</dt>
+
+        <dd>
+        download packages "foo", "bar" and their dependencies,
+        where up to 4 packages are downloaded in parallel
+        </dd>
+
     <dt>make strip</dt>
 
         <dd>