2 # (Re)builds Python metafiles (__init__.py) and documentation
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2005 The Trustees of Princeton University
8 # python-pycurl and python-psycopg2 avail. from fedora 5
9 # we used to ship our own version of psycopg2 and pycurl, for fedora4
10 # starting with 5.0, support for these two modules is taken out
12 # Other stuff - doc not implicit, it's redone by myplc-docs
14 # autoconf compatible variables
25 python setup.py install \
26 --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
27 --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
28 --install-data=$(DESTDIR)/$(datadir)/plc_api
31 find . -name '*.pyc' | xargs rm -f
32 python setup.py clean && rm -rf build
35 echo "This step is obsolete"
41 .PHONY: all install force clean index tags
43 #################### devel tools
45 find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile -o -name '[0-9][0-9][0-9]*' ')' | fgrep -v '.git/' | xargs etags
50 # 2 forms are supported
51 # (*) if your plc root context has direct ssh access:
52 # make sync PLC=private.one-lab.org
53 # (*) otherwise, for test deployments, use on your testmaster
55 # and cut'n paste the export lines before you run make sync
59 SSHCOMMAND:=ssh root@$(PLC)
62 SSHURL:=root@$(PLCHOSTLXC):/vservers/$(GUESTNAME)
63 SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh -o StrictHostKeyChecking=no -o LogLevel=quiet $(GUESTHOSTNAME)
67 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py
68 RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
69 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
70 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
74 @echo "sync: I need more info from the command line, e.g."
75 @echo " make sync PLC=boot.planetlab.eu"
76 @echo " make sync PLCHOSTLXC=.. GUESTNAME=.."
79 +$(RSYNC) plcsh PLC planetlab5.sql migrations aspects php $(SSHURL)/usr/share/plc_api/
80 +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
81 +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
82 $(SSHCOMMAND) /etc/plc.d/httpd stop
83 $(SSHCOMMAND) /etc/plc.d/httpd start
86 #################### convenience, for debugging only
87 # make +foo : prints the value of $(foo)
88 # make ++foo : idem but verbose, i.e. foo=$(foo)
89 ++%: varname=$(subst +,,$@)
91 @echo "$(varname)=$($(varname))"
92 +%: varname=$(subst +,,$@)