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