X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=blobdiff_plain;f=Makefile;fp=Makefile;h=a94e47ace76e759319b699e910168289df6a8246;hp=0000000000000000000000000000000000000000;hb=882f60e952c36b4ee5ef452df5cb4bae074a1198;hpb=37d6fd1637c43953b2c0d24f1fbda8f39c70f40b diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a94e47a --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +# refresh tags +tags: + find . '(' -name '*.php' -o -name '*.js' -o -name '*.css' -o -name Makefile ')' | xargs etags + +.PHONY: tags + +########## 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 .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 (,$(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) ./ $(SSHURL)/var/www/html/registerwizard/ +endif + +#################### 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))"