remove svn keywords and use %{SCMURL} in spec file
[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 ifdef GUEST
11 ifdef PLCHOST
12 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
13 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
14 endif
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 CVS --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 " you can optionnally define DEPLOYMENT too, it defaults to 'regular'"
32         @echo "  e.g. make sync PLC=boot.onelab.eu DEPLOYMENT=alpha"
33         @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
34         @exit 1
35 else
36         $(SSHCOMMAND) mkdir -p /usr/share/bootmanager/$(DEPLOYMENT)
37         +$(RSYNC) build.sh source $(SSHURL)/usr/share/bootmanager/$(DEPLOYMENT)
38         $(SSHCOMMAND) service plc start bootmanager
39 endif
40
41 ##########
42 tags:
43         find . -type f | egrep -v '/\.svn/|\.git/|~$$' | xargs etags
44
45 .PHONY: tags