3 @echo no default target
7 #################### compute emacs tags
8 # list files under git but exclude third-party stuff like bootstrap and jquery
10 @git ls-files | egrep -v 'insert(_|-)above|/third-party/|/play/'
12 # in general it's right to rely on the contents as reported by git
14 $(MAKE) myfiles | xargs etags
16 # however sometimes we have stuff not yet added, so in this case
18 find . -type f | fgrep -v '/.git/' | xargs etags
20 #################### third-party layout is kind of special
21 # because we have differents versions and all
22 THIRD-PARTY-RESOURCES =
23 # ignore variants, use the main symlink third-party/bootstrap
24 THIRD-PARTY-RESOURCES += $(shell ls third-party/bootstrap/*/*)
25 # just the single js as identified with a symlink
26 THIRD-PARTY-RESOURCES += $(shell ls third-party/datatables/js/dataTables.js)
28 THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery/js/jquery.js)
29 # spin comes in plain or min, + the jquery plugin, and our own settings
30 THIRD-PARTY-RESOURCES += $(shell ls third-party/spin/*.js)
33 @find $(THIRD-PARTY-RESOURCES) -name '*.js'
35 @find $(THIRD-PARTY-RESOURCES) -name '*.css'
37 @find $(THIRD-PARTY-RESOURCES) -name '*.png'
39 # we might have any of these as templates - e.g. ./engine/templates/plugin-setenv.js
40 # so if there's a /templates/ in the path ignore the file
42 @find . -type f -name '*.js' | egrep -v '/all-(static|templates)/|/third-party/|/templates/'
44 @find . -type f -name '*.css' | egrep -v 'all-(static|templates)/|/third-party/|/templates/'
46 @find . -type f -name '*.png' | egrep -v 'all-(static|templates)/|/third-party/|/templates/'
48 list-js: thirdparty-js other-js
49 list-css: thirdparty-css other-css
50 list-img: thirdparty-img other-img
52 # having templates in a templates/ subdir is fine most of the time except for plugins
54 @find plugins -type f -name '*.html'
56 #################### manage static contents (extract from all the modules into the single all-static location)
57 static run-static static-run: force
58 mkdir -p ./all-static/js all-static/css all-static/img
59 ln -sf $(foreach x,$(shell $(MAKE) list-js),../../$(x)) ./all-static/js
60 ln -sf $(foreach x,$(shell $(MAKE) list-css),../../$(x)) ./all-static/css
61 ln -sf $(foreach x,$(shell $(MAKE) list-img),../../$(x)) ./all-static/img
62 # rsync -av $(shell $(MAKE) list-js) ./all-static/js
63 # rsync -av $(shell $(MAKE) list-css) ./all-static/css
64 # rsync -av $(shell $(MAKE) list-img) ./all-static/img
66 clean-static static-clean: force
69 all-static: clean-static run-static
71 #################### manage templates for the plugin area
72 templates run-templates templates-run: force
73 mkdir -p all-templates
74 ln -sf $(foreach x,$(shell $(MAKE) list-templates),../$(x)) ./all-templates
75 # rsync -av $(shell $(MAKE) list-templates) ./all-templates
77 clean-templates templates-clean: force
78 rm -rf ./all-templates
80 all-templates: clean-templates run-templates
83 list-all list-resources: list-templates list-js list-css list-img
85 #################### sync : push current code on a (devel) box running myslice
86 SSHURL:=root@$(MYSLICEBOX):/
87 SSHCOMMAND:=ssh root@$(MYSLICEBOX)
90 # the config file should probably not be overridden ??
91 # --exclude settings.py
92 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude config.py --exclude all-static --exclude all-templates --exclude '*.sqlite3'
94 RSYNC_EXCLUDES := --exclude .git --exclude '*~' --exclude TAGS --exclude .DS_Store $(LOCAL_RSYNC_EXCLUDES)
95 # make -n will propagate as rsync -n
96 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
98 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
100 # xxx until we come up with a packaging this is going to be a wild guess
101 # on debian04 I have stuff in /usr/share/myslice and a symlink in /root/myslice
102 #INSTALLED=/usr/share/myslice
103 INSTALLED=/root/myslice
106 ifeq (,$(MYSLICEBOX))
107 @echo "you need to set MYSLICEBOX, like in e.g."
108 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
111 +$(RSYNC) ./ $(SSHURL)/$(INSTALLED)/
114 # xxx likewise until we run this under apache it's probably hard to restart from here
116 ifeq (,$(MYSLICEBOX))
117 @echo "you need to set MYSLICEBOX, like in e.g."
118 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
121 @echo "$@" target not yet implemented - for an apache based depl it would read ...; exit; @$(SSHCOMMAND) /etc/init.d/apache2 restart