turn wsdl generation back on
[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
34 python-clean:
35         python setup.py clean
36         rm $(init)
37
38 .PHONY: python python-install python-clean
39 ##########
40 wsdl: 
41         $(MAKE) -C wsdl 
42
43 # propagate DESTDIR from the specfile
44 wsdl-install:
45         $(MAKE) -C wsdl install 
46
47 wsdl-clean:
48         $(MAKE) -C wsdl clean
49
50 .PHONY: wsdl wsdl-install wsdl-clean
51 ##########
52
53 # are the .java files used ?
54 tags:   
55         find . -type f | egrep -v '/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$|\.pdf$$' | xargs etags
56 .PHONY: tags
57
58
59 ########## sync
60 # 2 forms are supported
61 # (*) if your plc root context has direct ssh access:
62 # make sync PLC=private.one-lab.org
63 # (*) otherwise, entering through the root context
64 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
65
66 ifdef GUEST
67 ifdef PLCHOST
68 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
69 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
70 endif
71 endif
72 ifdef PLC
73 SSHURL:=root@$(PLC):/
74 SSHCOMMAND:=ssh root@$(PLC)
75 endif
76
77 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
78 RSYNC_EXCLUDES          := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
79 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
80 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
81
82 BINS =  ./config/sfa-config-tty ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py \
83         ./sfa/server/sfa-server.py \
84         ./sfa/client/sfi.py ./sfa/client/getNodes.py ./sfa/client/getRecord.py \
85         ./sfa/client/setRecord.py ./sfa/client/genidump.py
86
87 sync:
88 ifeq (,$(SSHURL))
89         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
90         @echo "  e.g. make sync PLC=private.one-lab.org"
91         @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
92         @exit 1
93 else
94         +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib/python2.5/site-packages/sfa/
95         +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin
96         $(SSHCOMMAND) exec service sfa restart
97 endif
98
99 .PHONY: sync
100 ##########