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