2 ## (Re)builds Python metafile (__init__.py) and documentation
4 # overwritten by the specfile
10 install: keyconvert-install python-install
12 clean: keyconvert-clean python-clean
14 .PHONY: all install clean
21 $(MAKE) -C keyconvert install
24 $(MAKE) -C keyconvert clean
26 .PHONY: keyconvert keyconvert-install keyconvert-clean
32 python setup.py install --root=$(DESTDIR) --record=GENI_INSTALLED_FILES
38 .PHONY: python python-install python-clean
41 # are the .java files used ?
43 find . -name '*.py' -o -name '*.sh' -o -name '*.ecore' | grep -v '/\.svn/' | xargs etags
48 init := geni/__init__.py geni/util/__init__.py geni/methods/__init__.py
54 (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
56 geni/methods/__init__.py:
57 (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni/methods; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
59 geni/util/__init__.py:
60 (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni/util; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
62 geni_now := $(sort $(shell fgrep -v '"' geni/__init__.py 2>/dev/null))
63 # what should be declared
64 geni_paths := $(filter-out %/__init__.py, $(wildcard geni/*.py))
65 geni_files := $(sort $(notdir $(geni_paths:.py=)))
66 ifneq ($(geni_now), $(geni_files))
67 geni/__init__.py: force
70 methods_now := $(sort $(shell fgrep -v '"' geni/methods/__init__.py 2>/dev/null))
71 # what should be declared
72 method_paths := $(filter-out %/__init__.py, $(wildcard geni/methods/*.py))
73 method_files := $(sort $(notdir $(method_paths:.py=)))
74 ifneq ($(methods_now), $(methods_files))
75 geni/methods/__init__.py: force
78 util_now := $(sort $(shell fgrep -v '"' geni/util/__init__.py 2>/dev/null))
79 # what should be declared
80 util_paths := $(filter-out %/__init__.py, $(wildcard geni/util/*.py))
81 util_files := $(sort $(notdir $(util_paths:.py=)))
82 ifneq ($(util_now), $(util_files))
83 geni/util/__init__.py: force
87 # 2 forms are supported
88 # (*) if your plc root context has direct ssh access:
89 # make sync PLC=private.one-lab.org
90 # (*) otherwise, entering through the root context
91 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
95 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
96 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
100 SSHURL:=root@$(PLC):/
101 SSHCOMMAND:=ssh root@$(PLC)
104 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
105 RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
106 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
107 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
111 @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
112 @echo " e.g. make sync PLC=private.one-lab.org"
113 @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
116 +$(RSYNC) ./geni/ $(SSHURL)/usr/lib/python2.5/site-packages/geni/
117 +$(RSYNC) geni-config-tty $(SSHURL)/usr/bin