scaffolding omf resource controller
[omf.git] / Makefile
1 # $Id: Makefile 16421 2010-01-04 11:29:55Z thierry $
2 # $URL: svn+ssh://thierry@svn.planet-lab.org/svn/madwifi/trunk/Makefile $
3 #
4 WEBFETCH        := curl -H Pragma: -O -R -S --fail --show-error
5 SHA1SUM         = sha1sum
6
7 # default - overridden by the build
8 SPECFILE        = omf-resctl.spec
9
10 main.URL        := http://pkg.mytestbed.net/yum/base/8/i386/omf-resctl-5.3-1ubuntu2-2.noarch.rpm
11 main.SHA1SUM    := 6f48dd1cb7505ba9301c55f9889fd78842510b68
12 main.FILE       := $(notdir $(main.URL))
13
14 # Thierry - when called from within the build, PWD is /build
15 SOURCEFILES := $(main.FILE)
16
17 $(main.FILE): #FORCE
18         @if [ ! -e "$@" ] ; then echo "$(WEBFETCH) $(main.URL)" ; $(WEBFETCH) $(main.URL) ; fi
19         @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
20         @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(main.SHA1SUM)" ; then \
21             echo "sha1sum of the downloaded $@ does not match the one from 'Makefile'" ; \
22             echo "Local copy: $$(sha1sum $@)" ; \
23             echo "In Makefile: $(main.SHA1SUM)" ; \
24             exit 1 ; \
25         else \
26             ls -l $@ ; \
27         fi
28
29 sources: $(SOURCEFILES)
30 .PHONY: sources
31
32 #PWD=$(shell pwd)
33 #PREPARCH ?= noarch
34 #RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
35 #trees: sources
36 #       rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
37 #
38 #srpm: sources
39 #       rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
40 #
41 #TARGET ?= $(shell uname -m)
42 #rpm: sources
43 #       rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps --target $(TARGET) -bb $(SPECFILE)
44 #
45 #clean:
46 #       rm -f *.rpm *.tgz *.bz2 *.gz
47
48 ++%: varname=$(subst +,,$@)
49 ++%:
50         @echo "$(varname)=$($(varname))"
51 +%: varname=$(subst +,,$@)
52 +%:
53         @echo "$($(varname))"