2 WEBFETCH := curl -H Pragma: -O -R -S --fail --show-error
5 # initial from http://oml.mytestbed.net/attachments/download/496/oml2-2.5.1.tar.gz
6 REPO := http://mirror.onelab.eu/third-party/
9 oml-URL := $(REPO)/oml2-2.5.1.tar.gz
10 oml-SHA1SUM := 9d75d99d799a14f74024cc9de33bc7cb6696afdd
11 oml := $(notdir $(oml-URL))
17 ##############################
18 define download_target
22 @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi
23 @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi
24 @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \
25 echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \
26 echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \
27 echo "In Makefile: $($(1)-SHA1SUM)" ; \
35 $(eval $(call download_target,oml))
41 #################### convenience, for debugging only
42 # make +foo : prints the value of $(foo)
43 # make ++foo : idem but verbose, i.e. foo=$(foo)
44 ++%: varname=$(subst +,,$@)
46 @echo "$(varname)=$($(varname))"
47 +%: varname=$(subst +,,$@)