X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=148a8aa43bbe71e42347706512d1f6dc1f7ad795;hb=b7593d9531a46312c686b0e4e20a5d8d6e7e7647;hp=3c771a18c8d815249661b7264cc25939a89a2c84;hpb=ba1db01078f414acb4c2280df2ebfd0cabe97b41;p=plewww.git diff --git a/Makefile b/Makefile index 3c771a1..148a8aa 100644 --- a/Makefile +++ b/Makefile @@ -4,21 +4,53 @@ tags: .PHONY: tags -########## make sync PLCHOST=hostname -ifdef PLCHOST -PLCSSH:=root@$(PLCHOST) +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=boot.planet-lab.eu +# (*) otherwise, entering through the root context +# make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr + +PLCHOST ?= testplc.onelab.eu + +ifdef GUEST +SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) +SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) +endif +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) endif LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' -RSYNC_EXCLUDES := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) +RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) 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=boot.planet-lab.eu" + @echo " or make sync PLCHOST=testplc.onelab.eu 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" | grep -v datepicker.js | grep -v raphael),\ + $(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))"