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, for test deployments, use on your testmaster
62 # and cut'n paste the export lines before you run make sync
66 SSHCOMMAND:=ssh root@$(PLC)
69 SSHURL:=root@$(PLCHOSTLXC):/vservers/$(GUESTNAME)
70 SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh -o StrictHostKeyChecking=no -o LogLevel=quiet $(GUESTHOSTNAME)
74 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py
75 RSYNC_EXCLUDES := --exclude .svn --exclude .git --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: I need more info from the command line, e.g."
82 @echo " make sync PLC=boot.planetlab.eu"
83 @echo " make sync PLCHOSTLXC=.. GUESTNAME=.."
86 +$(RSYNC) plcsh PLC planetlab5.sql migrations aspects $(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) /etc/plc.d/httpd stop
90 $(SSHCOMMAND) /etc/plc.d/httpd start
93 #################### convenience, for debugging only
94 # make +foo : prints the value of $(foo)
95 # make ++foo : idem but verbose, i.e. foo=$(foo)
96 ++%: varname=$(subst +,,$@)
98 @echo "$(varname)=$($(varname))"
99 +%: varname=$(subst +,,$@)
101 @echo "$($(varname))"