no need to run make index anymore
[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
9
10 install: keyconvert-install python-install
11
12 clean: keyconvert-clean python-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
41 # are the .java files used ?
42 tags:   
43         find . -type f | egrep -v '/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$' | xargs etags
44 .PHONY: tags
45
46
47 ########## sync
48 # 2 forms are supported
49 # (*) if your plc root context has direct ssh access:
50 # make sync PLC=private.one-lab.org
51 # (*) otherwise, entering through the root context
52 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
53
54 ifdef GUEST
55 ifdef PLCHOST
56 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
57 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
58 endif
59 endif
60 ifdef PLC
61 SSHURL:=root@$(PLC):/
62 SSHCOMMAND:=ssh root@$(PLC)
63 endif
64
65 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
66 RSYNC_EXCLUDES          := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
67 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
68 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
69
70 sync:
71 ifeq (,$(SSHURL))
72         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
73         @echo "  e.g. make sync PLC=private.one-lab.org"
74         @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
75         @exit 1
76 else
77         +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib/python2.5/site-packages/sfa/
78         +$(RSYNC) ./config/sfa-config-tty $(SSHURL)/usr/bin
79         $(SSHCOMMAND) exec service sfa restart
80 endif
81
82 .PHONY: sync
83 ##########