Setting tag plewww-4.3-67
[plewww.git] / Makefile
1 # refresh tags
2 tags:
3         find . '(' -name '*.php' -o -name '*.js' -o -name '*.module' -o -name '*.css' -o -name Makefile ')' | xargs etags
4
5 .PHONY: tags
6
7 ########## sync
8 # 2 forms are supported
9 # (*) if your plc root context has direct ssh access:
10 # make sync PLC=boot.planet-lab.eu
11 # (*) otherwise, entering through the root context
12 # make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr
13
14 PLCHOST ?= testplc.onelab.eu
15
16 ifdef GUEST
17 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
18 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
19 endif
20 ifdef PLC
21 SSHURL:=root@$(PLC):/
22 SSHCOMMAND:=ssh root@$(PLC)
23 endif
24
25 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
26 RSYNC_EXCLUDES          := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
27 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
28 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
29
30 sync:
31 ifeq (,$(SSHURL))
32         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
33         @echo "  e.g. make sync PLC=boot.planet-lab.eu"
34         @echo "  or   make sync PLCHOST=testplc.onelab.eu GUEST=vplc03.inria.fr"
35         @exit 1
36 else
37         +$(RSYNC) planetlab plekit modules $(SSHURL)/var/www/html/
38 endif
39
40 compress:
41         $(foreach file,\
42                 $(shell find . -type f -iname "*.js" | grep -v datepicker.js | grep -v raphael),\
43                 $(shell python jsmin.py < $(file) > $(file).new && mv $(file).new $(file)))
44         @echo "Compressed .js files with jsmin.py"
45
46 .PHONY: compress
47
48 #################### convenience, for debugging only
49 # make +foo : prints the value of $(foo)
50 # make ++foo : idem but verbose, i.e. foo=$(foo)
51 ++%: varname=$(subst +,,$@)
52 ++%:
53         @echo "$(varname)=$($(varname))"
54 +%: varname=$(subst +,,$@)
55 +%:
56         @echo "$($(varname))"