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
11 # python-pycurl and python-psycopg2 avail. from fedora 5
12 # we used to ship our own version of psycopg2 and pycurl, for fedora4
13 # starting with 5.0, support for these two modules is taken out
15 # Other stuff - doc not implicit, it's redone by myplc-docs
18 # autoconf compatible variables
29 python setup.py install \
30 --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
31 --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
32 --install-data=$(DESTDIR)/$(datadir)/plc_api
33 install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so
39 find . -name '*.pyc' | xargs rm -f
41 for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
42 python setup.py clean && rm -rf build
45 echo "This step is obsolete"
51 .PHONY: all install force clean index tags $(subdirs)
53 #################### devel tools
55 find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags
60 # 2 forms are supported
61 # (*) if your plc root context has direct ssh access:
62 # make sync PLC=private.one-lab.org
63 # (*) otherwise, entering through the root context
64 # make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr
66 PLCHOST ?= testplc.onelab.eu
69 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
70 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
74 SSHCOMMAND:=ssh root@$(PLC)
77 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
78 RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
79 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
80 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
84 @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
85 @echo " e.g. make sync PLC=boot.planetlab.eu"
86 @echo " or make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
89 +$(RSYNC) plcsh PLC planetlab5.sql migrations $(SSHURL)/usr/share/plc_api/
90 +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
91 +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
92 $(SSHCOMMAND) exec apachectl graceful
95 #################### convenience, for debugging only
96 # make +foo : prints the value of $(foo)
97 # make ++foo : idem but verbose, i.e. foo=$(foo)
98 ++%: varname=$(subst +,,$@)
100 @echo "$(varname)=$($(varname))"
101 +%: varname=$(subst +,,$@)
103 @echo "$($(varname))"