X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=af4b4da34d3cc0d886df0f84708f064c9a992248;hb=40f8bf1514ef4194dab680f60814ed7642bb5ae1;hp=3c771a18c8d815249661b7264cc25939a89a2c84;hpb=ba1db01078f414acb4c2280df2ebfd0cabe97b41;p=plewww.git diff --git a/Makefile b/Makefile index 3c771a1..af4b4da 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,22 @@ tags: .PHONY: tags -########## make sync PLCHOST=hostname +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=private.one-lab.org +# (*) otherwise, entering through the root context +# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr + +ifdef GUEST ifdef PLCHOST -PLCSSH:=root@$(PLCHOST) +SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) +SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) +endif +endif +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) endif LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' @@ -15,10 +28,29 @@ RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) sync: -ifeq (,$(PLCSSH)) - echo "sync: You must define target host as PLCHOST on the command line" - echo " e.g. make sync PLCHOST=private.one-lab.org" ; exit 1 +ifeq (,$(SSHURL)) + @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line" + @echo " e.g. make sync PLC=private.one-lab.org" + @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr" + @exit 1 else - +$(RSYNC) planetlab modules $(PLCSSH):/plc/root/var/www/html/ + +$(RSYNC) planetlab plekit modules $(SSHURL)/var/www/html/ endif +compress: + $(foreach file,\ + $(shell find . -type f -iname "*.js"),\ + $(shell python jsmin.py < $(file) > $(file).new && mv $(file).new $(file))) + @echo "Compressed .js files with jsmin.py" + +.PHONY: compress + +#################### convenience, for debugging only +# make +foo : prints the value of $(foo) +# make ++foo : idem but verbose, i.e. foo=$(foo) +++%: varname=$(subst +,,$@) +++%: + @echo "$(varname)=$($(varname))" ++%: varname=$(subst +,,$@) ++%: + @echo "$($(varname))"