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]*' ')' | 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, entering through the root context
61 # make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr
63 PLCHOST ?= testplc.onelab.eu
66 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
67 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
71 SSHCOMMAND:=ssh root@$(PLC)
74 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py
75 RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
76 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
77 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
81 @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
82 @echo " e.g. make sync PLC=boot.planetlab.eu"
83 @echo " or make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
86 +$(RSYNC) plcsh PLC planetlab5.sql migrations $(SSHURL)/usr/share/plc_api/
87 +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
88 +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
89 $(SSHCOMMAND) exec apachectl graceful
92 #################### convenience, for debugging only
93 # make +foo : prints the value of $(foo)
94 # make ++foo : idem but verbose, i.e. foo=$(foo)
95 ++%: varname=$(subst +,,$@)
97 @echo "$(varname)=$($(varname))"
98 +%: varname=$(subst +,,$@)
100 @echo "$($(varname))"