removed another bunch of references to geni
[sfa.git] / Makefile
1 #
2 ## (Re)builds Python metafile (__init__.py) and documentation
3
4 # overwritten by the specfile
5 DESTDIR="/"
6
7 ##########
8 all: keyconvert python wsdl
9
10 install: keyconvert-install python-install wsdl-install
11
12 clean: keyconvert-clean python-clean wsdl-clean
13
14 .PHONY: all install clean 
15
16 ##########
17 keyconvert:
18         $(MAKE) -C keyconvert
19
20 keyconvert-install:
21         $(MAKE) -C keyconvert install
22
23 keyconvert-clean:
24         $(MAKE) -C keyconvert clean
25
26 .PHONY: keyconvert keyconvert-install keyconvert-clean 
27
28 ##########
29 python: 
30
31 python-install:
32         python setup.py install --root=$(DESTDIR)
33         chmod 444 $(DESTDIR)/etc/sfa/default_config.xml
34
35 python-clean:
36         python setup.py clean
37         rm $(init)
38
39 .PHONY: python python-install python-clean
40 ##########
41 wsdl: 
42         $(MAKE) -C wsdl 
43
44 # propagate DESTDIR from the specfile
45 wsdl-install:
46         $(MAKE) -C wsdl install 
47
48 wsdl-clean:
49         $(MAKE) -C wsdl clean
50
51 .PHONY: wsdl wsdl-install wsdl-clean
52 ##########
53
54 # are the .java files used ?
55 tags:   
56         find . -type f | egrep -v '/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$|\.pdf$$' | xargs etags
57 .PHONY: tags
58
59
60 ########## sync
61 # 2 forms are supported
62 # (*) if your plc root context has direct ssh access:
63 # make sync PLC=private.one-lab.org
64 # (*) otherwise, entering through the root context
65 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
66
67 ifdef GUEST
68 ifdef PLCHOST
69 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
70 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
71 endif
72 endif
73 ifdef PLC
74 SSHURL:=root@$(PLC):/
75 SSHCOMMAND:=ssh root@$(PLC)
76 endif
77
78 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
79 RSYNC_EXCLUDES          := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
80 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
81 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
82
83 BINS =  ./config/sfa-config-tty ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py \
84         ./sfa/server/sfa-server.py \
85         ./sfa/client/sfi.py ./sfa/client/getNodes.py ./sfa/client/getRecord.py \
86         ./sfa/client/setRecord.py ./sfa/client/sfadump.py
87
88 sync:
89 ifeq (,$(SSHURL))
90         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
91         @echo "  e.g. make sync PLC=private.one-lab.org"
92         @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
93         @exit 1
94 else
95         +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib/python2.5/site-packages/sfa/
96         +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin
97         $(SSHCOMMAND) exec service sfa restart
98 endif
99
100 .PHONY: sync
101 ##########