reguire gnupg1 on f>=31; sense the system to use gpg1 when installed
[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, for test deployments, use on your testmaster
8 # $ run export
9 # and cut'n paste the export lines before you run make sync
10
11 PLCHOSTLXC ?= lxc64-1.pl.sophia.inria.fr
12
13 ifdef PLC
14 SSHURL:=root@$(PLC):/
15 SSHCOMMAND:=ssh root@$(PLC)
16 else
17 ifdef PLCHOSTLXC
18 SSHURL:=root@$(PLCHOSTLXC):/vservers/$(GUESTNAME)
19 SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh -o StrictHostKeyChecking=no -o LogLevel=quiet $(GUESTHOSTNAME)
20 else
21 ifdef PLCHOSTVS
22 SSHURL:=root@$(PLCHOSTVS):/vservers/$(GUESTNAME)
23 SSHCOMMAND:=ssh root@$(PLCHOSTVS) vserver $(GUESTNAME) exec
24 endif
25 endif
26 endif
27
28 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
29 RSYNC_EXCLUDES          := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
30 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
31 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
32
33 DEPLOYMENT ?= regular
34
35 sync:
36 ifeq (,$(SSHURL))
37         @echo "sync: I need more info from the command line, e.g."
38         @echo "  make sync PLC=boot.planetlab.eu"
39         @echo "  make sync PLCHOSTVS=.. GUESTNAME=.."
40         @echo "  make sync PLCHOSTLXC=.. GUESTNAME=.. GUESTHOSTNAME=.."
41         @exit 1
42 else
43         $(SSHCOMMAND) mkdir -p /usr/share/bootmanager/$(DEPLOYMENT)
44         +$(RSYNC) build.sh source $(SSHURL)/usr/share/bootmanager/$(DEPLOYMENT)
45         $(SSHCOMMAND) /etc/plc.d/bootmanager start
46 endif
47
48 ##########
49 tags:
50         git ls-files | xargs etags
51
52 .PHONY: tags
53
54 ##########
55 # this one is for overwriting the code in /tmp/source on a node
56 # that is in debug mode
57 ifndef NODE
58 debugmode:
59         echo run make debugmode NODE=a-real-ple-node
60 else
61 debugmode:
62         rsync -av -e 'ssh -i /Users/parmentelat/.ssh/ple_debug.rsa' ./source/ root@$(NODE):/tmp/source/
63 endif