very rough layout with header/content-main/content-related
[myslice.git] / Makefile
1 ### 
2 all: 
3         @echo no default target
4
5 force:
6
7 #################### compute emacs tags
8 # in general it's right to rely on the contents as reported by git
9 tags: force
10         git ls-files | xargs etags
11
12 # however sometimes we have stuff not yet added, so in this case
13 ftags: force
14         find . -type f | fgrep -v '/.git/' | xargs etags
15
16 #################### manage static contents (extract from all the modules into the single all-static location)
17 static: force
18         ./manage.py collectstatic --noinput 
19
20 clean-static: force
21         rm -rf ./all-static/
22
23 #################### sync : push current code on a (devel) box running myslice
24 SSHURL:=root@$(MYSLICEBOX):/
25 SSHCOMMAND:=ssh root@$(MYSLICEBOX)
26
27 ### rsync options
28 # the config file should probably not be overridden
29 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' --exclude settings.py --exclude devel
30 # usual excludes
31 RSYNC_EXCLUDES          := --exclude .git --exclude '*~' --exclude TAGS --exclude .DS_Store $(LOCAL_RSYNC_EXCLUDES) 
32 # make -n will propagate as rsync -n 
33 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
34 # putting it together
35 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
36
37 # xxx until we come up with a packaging this is going to be a wild guess
38 INSTALLED=/usr/share/myslice
39
40 sync:
41 ifeq (,$(MYSLICEBOX))
42         @echo "you need to set MYSLICEBOX, like in e.g."
43         @echo "  $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
44         @exit 1
45 else
46         +$(RSYNC) ./ $(SSHURL)/$(INSTALLED)/
47 endif
48
49 # xxx likewise until we run this under apache it's probably hard to restart from here
50 restart:
51 ifeq (,$(MYSLICEBOX))
52         @echo "you need to set MYSLICEBOX, like in e.g."
53         @echo "  $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
54         @exit 1
55 else
56         @echo "$@" target not yet implemented; exit; @$(SSHCOMMAND) /etc/init.d/apache2 restart
57 endif
58