Implicit rules for downloading packages

Alexander E. Patrakov patrakov at
Mon Jul 18 06:12:11 PDT 2005


currently the new makefiles contain boilerplate rules for downloading
files. I don't like that, and propose to remove them with the help of
implicit rules. A patch that adds the missing bit to scripts/functions
and converts binutils to the new downloading method is attached for your
review (separate-build-dir bug is not fixed yet).

Now, the names of URL* and SHA* variables must follow strict rules.
E.g., the SHA1 sum of binutils-2.16.1.tar.bz2 should be kept in
SHA-binutils-2.16.1.tar.bz2=... statement. Of course that can (and
should) be simplified to SHA-$(FILE). Same for URLs.

The next idea would be to automate package unpacking, but that's left 
for tomorrow.

BTW changing the build method for the utf8 branch was not a very good
idea. I am going to revert my working directory to the tag, update
toolchain packages and start after "make scrub" from there. Not sure
what I should do on the server.

Alexander E. Patrakov
-------------- next part --------------
Index: scripts/functions
--- scripts/functions	(revision 370)
+++ scripts/functions	(working copy)
@@ -37,3 +37,6 @@
 	 else echo $(BRW)sha1sum check on $(SRC)/$(1): $(RED)[ FAILED ]$(WHITE); fi
 	@ln -s $(SRC)/$(1) .
+%.gz %.tgz %.bz2 %.patch:
+	$(call download,$@,$(URL-$@),$(SHA-$@))
Index: packages/binutils/Makefile
--- packages/binutils/Makefile	(revision 370)
+++ packages/binutils/Makefile	(working copy)
@@ -5,17 +5,14 @@
 VRS= 2.16.1
 DIR= $(NM)-$(VRS)
 FILE= $(DIR).tar.bz2
-URL= $(HTTP)/$(NM)/$(FILE)
-SHA= 5c80fd5657da47efc16a63fdd93ef7395319fbbf
+URL-$(FILE)= $(HTTP)/$(NM)/$(FILE)
+SHA-$(FILE)= 5c80fd5657da47efc16a63fdd93ef7395319fbbf
 # Targets
 # =============================================================================
 include $(ROOT)/scripts/functions
-	@$(call download,$(FILE),$(URL),$(SHA))
 pass1: Makefile $(FILE)
 	@unpack $(FILE)
 	@make -C $(DIR) -f ../Makefile compile-$@

More information about the livecd mailing list