reviewed convenience targets
[bootmanager.git] / Makefile
1 #
2
3 ########## sync
4 # 2 forms are supported
5 # (*) if your plc root context has direct ssh access:
6 # make sync PLC=private.one-lab.org
7 # (*) otherwise, entering through the root context
8 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
9
10 PLCHOST ?= testplc.onelab.eu
11
12 ifdef GUEST
13 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
14 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) exec
15 endif
16 ifdef PLC
17 SSHURL:=root@$(PLC):/
18 SSHCOMMAND:=ssh root@$(PLC)
19 endif
20
21 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
22 RSYNC_EXCLUDES          := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
23 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
24 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
25
26 DEPLOYMENT ?= regular
27
28 sync:
29 ifeq (,$(SSHURL))
30         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
31         @echo "  e.g. make sync PLC=boot.planetlab.eu"
32         @echo "  or   make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
33         @exit 1
34 else
35         $(SSHCOMMAND) mkdir -p /usr/share/bootmanager/$(DEPLOYMENT)
36         +$(RSYNC) build.sh source $(SSHURL)/usr/share/bootmanager/$(DEPLOYMENT)
37         $(SSHCOMMAND) service plc start bootmanager
38 endif
39
40 ##########
41 tags:
42         find . -type f | egrep -v 'TAGS|/\.svn/|\.git/|~$$' | xargs etags
43
44 .PHONY: tags