a little nicer wrt pep8
[sfa.git] / clientbin / Makefile
1 # recompute the SFA graphs from different locations
2
3 ## use -vv for the full story
4 SFASCAN = ./sfascan.py -v
5
6 # AMs, at least MyPLC AMs, are boring
7 #BUNDLES += http://planet-lab.eu:12346/@auto-ple-am
8 BUNDLES += http://planet-lab.eu:12345/@auto-ple-reg 
9 BUNDLES += http://planet-lab.eu:12347/@auto-ple-sa
10 BUNDLES += http://planet-lab.org:12345/@auto-plc-reg 
11 BUNDLES += http://planet-lab.org:12347/@auto-plc-sa
12 BUNDLES += http://planet-lab.kr:12345/@auto-ppk-reg 
13 BUNDLES += http://planet-lab.kr:12347/@auto-ppk-sa
14 BUNDLES += http://geni-myvini.umkc.gpeni.net:12345/@auto-gpeni-reg
15 BUNDLES += http://geni-myvini.umkc.gpeni.net:12347/@auto-gpeni-sa
16 BUNDLES += http://198.248.241.100:12345/@auto-glc-reg
17 BUNDLES += http://198.248.241.100:12347/@auto-glc-sa
18 BUNDLES += http://vini-veritas.net:12345/@auto-vini-reg
19 BUNDLES += http://vini-veritas.net:12347/@auto-vini-sa
20 BUNDLES += http://www.planet-lab.jp:12345/@auto-plj-reg 
21 BUNDLES += http://www.planet-lab.jp:12347/@auto-plj-sa
22 BUNDLES += http://www.emanicslab.org:12345/@auto-elc-reg 
23 BUNDLES += http://www.emanicslab.org:12347/@auto-elc-sa
24
25 # left to right
26 BUNDLES-LR += http://www.emulab.net:443/protogeni/xmlrpc/am/@auto-emulab-am
27 BUNDLES-LR += http://planet-lab.eu:12345/@auto-ple-reg 
28 BUNDLES-LR += http://planet-lab.eu:12347/@auto-ple-sa
29 BUNDLES-LR += http://planet-lab.org:12345/@auto-plc-reg 
30 BUNDLES-LR += http://planet-lab.org:12347/@auto-plc-sa
31 BUNDLES-LR += http://planet-lab.kr:12345/@auto-ppk-reg 
32 #BUNDLES-LR += http://planet-lab.kr:12347/@auto-ppk-sa
33 BUNDLES-LR += http://geni-myvini.umkc.gpeni.net:12345/@auto-gpeni-reg
34 BUNDLES-LR += http://geni-myvini.umkc.gpeni.net:12347/@auto-gpeni-sa
35 BUNDLES-LR += http://198.248.241.100:12345/@auto-glc-reg
36 BUNDLES-LR += http://198.248.241.100:12347/@auto-glc-sa
37 BUNDLES-LR += http://vini-veritas.net:12345/@auto-vini-reg
38 BUNDLES-LR += http://vini-veritas.net:12347/@auto-vini-sa
39 BUNDLES-LR += http://www.planet-lab.jp:12345/@auto-plj-reg 
40 BUNDLES-LR += http://www.planet-lab.jp:12347/@auto-plj-sa
41 BUNDLES-LR += http://www.emanicslab.org:12345/@auto-elc-reg 
42 BUNDLES-LR += http://www.emanicslab.org:12347/@auto-elc-sa
43
44 EXTENSIONS := png svg
45 #EXTENSIONS := png
46
47 ####################
48 ALL += $(foreach bundle,$(BUNDLES),$(word 2,$(subst @, ,$(bundle))))
49 ALL += $(foreach bundle,$(BUNDLES-LR),$(word 2,$(subst @, ,$(bundle)))-lr)
50
51 all: $(ALL)
52
53 ple: auto-ple-reg auto-ple-sa-lr
54
55 ####################
56 define bundle_scan_target
57 $(word 2,$(subst @, ,$(1))):
58         $(SFASCAN) $(foreach extension,$(EXTENSIONS),-o $(word 2,$(subst @, ,$(1))).$(extension)) $(word 1,$(subst @, ,$(1))) >& .$(word 2,$(subst @, ,$(1))).out
59 .PHONY: $(word 2,$(subst @, ,$(1)))
60 endef
61
62 # the actual targets
63 $(foreach bundle,$(BUNDLES),$(eval $(call bundle_scan_target,$(bundle))))
64
65 #################### same but left-to-right
66 define bundle_scan_target_lr
67 $(word 2,$(subst @, ,$(1)))-lr:
68         $(SFASCAN) -l $(foreach extension,$(EXTENSIONS),-o $(word 2,$(subst @, ,$(1)))-lr.$(extension)) $(word 1,$(subst @, ,$(1))) >& .$(word 2,$(subst @, ,$(1)))-lr.out
69 .PHONY: $(word 2,$(subst @, ,$(1)))-lr
70 endef
71
72 # the actual targets
73 $(foreach bundle,$(BUNDLES-LR),$(eval $(call bundle_scan_target_lr,$(bundle))))
74
75 ####################
76 versions: $(VERSIONS)
77 clean-versions: 
78         rm -f $(VERSIONS)
79
80 #################### make name.version
81 define bundle_version_target
82 $(word 2,$(subst @, ,$(1))).version:
83         -./sfi.py -s $(word 1,$(subst @, ,$(1))) version >& $$@
84 endef
85
86 VERSIONS := $(foreach bundle,$(BUNDLES),$(word 2,$(subst @, ,$(bundle))).version)
87
88 # the actual targets
89 $(foreach bundle,$(BUNDLES),$(eval $(call bundle_version_target,$(bundle))))
90
91 ####################
92 clean:
93         rm -f .auto*
94         $(foreach extension,$(EXTENSIONS),rm -rf auto-*.$(extension);)
95         $(SFASCAN) -c
96
97 DATE=$(shell date '+%Y-%m-%d')
98 PUBEXTENSIONS=png
99 publish:
100         echo $(DATE)
101         ssh tparment@srv-planete.inria.fr mkdir /proj/planete/www/Thierry.Parmentelat/sfascan/$(DATE)
102         $(foreach extension,$(PUBEXTENSIONS),rsync -av auto-*.$(extension) tparment@srv-planete.inria.fr:/proj/planete/www/Thierry.Parmentelat/sfascan/$(DATE) ;)
103
104 #################### convenience, for debugging only
105 # make +foo : prints the value of $(foo)
106 # make ++foo : idem but verbose, i.e. foo=$(foo)
107 ++%: varname=$(subst +,,$@)
108 ++%:
109         @echo "$(varname)=$($(varname))"
110 +%: varname=$(subst +,,$@)
111 +%:
112         @echo "$($(varname))"