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
15 # autoconf compatible variables
26 python setup.py install \
27 --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
28 --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
29 --install-data=$(DESTDIR)/$(datadir)/plc_api
30 install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so
36 find . -name '*.pyc' | xargs rm -f
38 for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
39 python setup.py clean && rm -rf build
42 echo "This step is obsolete"
48 .PHONY: all install force clean index tags $(subdirs)
50 #################### devel tools
52 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
57 # 2 forms are supported
58 # (*) if your plc root context has direct ssh access:
59 # make sync PLC=private.one-lab.org
60 # (*) otherwise, under a vs-capable box, using /vservers/<> and vserver exec
61 # make sync PLCHOST=vs64-1.pl.sophia.inria.fr GUEST=2012.04.02--f14-32-1-vplc26
62 # (*) with an lxc-capable box, using /var/lib/lxc/<>/rootfs and ssh
63 # make sync PLCHOSTLXC=lxc64-1.pls.sophia.inria.fr GUEST=2012.04.02--lxc16-1-vplc25
65 PLCHOST ?= testplc.onelab.eu
68 VPLCNAME=$(lastword $(subst -, ,$(GUEST)))
69 SSHURL:=root@$(PLCHOST):/var/lib/lxc/$(GUEST)/rootfs
70 SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh $(VPLCNAME)
73 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
74 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) exec
79 SSHCOMMAND:=ssh root@$(PLC)
82 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py
83 RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
84 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
85 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
89 @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
90 @echo " e.g. make sync PLC=boot.planetlab.eu"
91 @echo " or make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
94 +$(RSYNC) plcsh PLC planetlab5.sql migrations aspects $(SSHURL)/usr/share/plc_api/
95 +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
96 +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
97 $(SSHCOMMAND) apachectl graceful
100 #################### convenience, for debugging only
101 # make +foo : prints the value of $(foo)
102 # make ++foo : idem but verbose, i.e. foo=$(foo)
103 ++%: varname=$(subst +,,$@)
105 @echo "$(varname)=$($(varname))"
106 +%: varname=$(subst +,,$@)
108 @echo "$($(varname))"