3 MAKE-SILENT = $(MAKE) --no-print-directory
7 # clean up and recompute
8 redo: clean-oldies redo-static redo-templates
11 rm -rf all-static all-templates django-static
22 build: static templates force
26 python setup.py install \
27 --install-purelib=$(DESTDIR)/$(datadir)/unfold \
28 --install-scripts=$(DESTDIR)/$(datadir)/unfold \
29 --install-data=$(DESTDIR)/$(datadir)/unfold
32 ./manage.py collectstatic --noinput
37 redo-static: clean-static static
41 DATE=$(shell date -u +"%a, %d %b %Y %T")
43 # This is called from the build with the following variables set
44 # (see build/Makefile and target_debian)
49 DEBVERSION=$(RPMVERSION).$(RPMRELEASE)
50 DEBTARBALL=../$(RPMNAME)_$(DEBVERSION).orig.tar.bz2
52 debian: static templates debian/changelog debian.source debian.package
54 debian/changelog: debian/changelog.in
55 sed -e "s|@VERSION@|$(DEBVERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog
58 rsync -a $(RPMTARBALL) $(DEBTARBALL)
64 $(MAKE) -f debian/rules clean
65 rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build
66 find . -name '*.pyc' -delete
69 ### #################### third-party layout is kind of special
70 ### # because we have differents versions, and also we
71 ### # try to preserve the file structure from upstream
72 ### # so let's handle this manually
73 ### THIRD-PARTY-RESOURCES =
74 ### # ignore variants, use the main symlink third-party/bootstrap
75 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/bootstrap/*/*)
76 ### # just the single js as identified with a symlink
77 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/datatables/js/dataTables.js)
78 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/datatables/js/dataTables.bootstrap.js)
79 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/datatables/css/dataTables.bootstrap.css)
81 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery/js/jquery.js)
82 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery/js/jquery.min.js)
83 ### # for storing the visible status of plugins
84 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery-html5storage/jquery.html5storage.js)
85 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery-html5storage/jquery.html5storage.min.js)
86 ### # creating queries uuids on the fly
87 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/uuid/Math.uuid.js)
88 ### # spin comes in plain or min, + the jquery plugin, and our own settings
89 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/spin/*.js)
90 ### # used in QueryCode
91 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/scripts/shCore.js)
92 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/scripts/shAutoloader.js)
93 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/scripts/shBrushPython.js)
94 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/scripts/shBrushRuby.js)
95 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/styles/shCore.css)
96 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/styles/shCoreDefault.css)
97 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/syntaxhighlighter/styles/shThemeDefault.css)
99 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/smartwizard-1636c86/js/jquery.smartWizard-2.0.js)
100 ### #THIRD-PARTY-RESOURCES += $(shell ls third-party/smartwizard-1636c86/js/jquery.smartWizard-2.0.min.js)
101 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/smartwizard-1636c86/styles/smart_wizard.css)
103 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery-notify/jquery.notify.js)
104 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery-notify/jquery.notify.min.js)
105 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/jquery-notify/ui.notify.css)
107 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/codemirror-3.15/lib/codemirror.js)
108 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/codemirror-3.15/lib/codemirror.css)
109 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/codemirror-3.15/mode/sql/sql.js)
111 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/mustache/mustache.js)
112 ### # markerclustererplus for the googlemap plugin
113 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/markerclusterer/markerclusterer.js)
114 ### THIRD-PARTY-RESOURCES += $(shell ls third-party/markerclusterer/markerclusterer_packed.js)
117 ### @find $(THIRD-PARTY-RESOURCES) -name '*.js'
119 ### @find $(THIRD-PARTY-RESOURCES) -name '*.css'
121 ### @find $(THIRD-PARTY-RESOURCES) -name '*.png' -o -name '*.ico'
123 ### # we might have any of these as templates - e.g. ./unfold/templates/plugin-init.js
124 ### # so if there's a /templates/ in the path ignore the file
126 ### @find . -type f -name '*.js' | egrep -v '/all-(static|templates)/|/third-party/|/templates/'
128 ### @find . -type f -name '*.css' | egrep -v 'all-(static|templates)/|/third-party/|/templates/'
130 ### @find . -type f -name '*.png' -o -name '*.ico' | egrep -v 'all-(static|templates)/|/third-party/|/templates/'
132 ### list-js: thirdparty-js local-js
133 ### list-css: thirdparty-css local-css
134 ### list-img: thirdparty-img local-img
136 # having templates in a templates/ subdir is fine most of the time except for plugins
137 plugins-templates: force
138 @find plugins -type f -name '*.html'
139 local-templates: force
140 @$(foreach tmpl,$(shell find . -name templates | grep -v '^\./templates$$'),ls -1 $(tmpl)/*;)
142 list-templates: plugins-templates local-templates
144 ### #################### manage static contents (extract from all the modules into the single all-static location)
145 ### static run-static static-run: force
146 ### mkdir -p ./all-static/js all-static/css all-static/img
147 ### ln -sf $(foreach x,$(shell $(MAKE-SILENT) list-js),../../$(x)) ./all-static/js
148 ### ln -sf $(foreach x,$(shell $(MAKE-SILENT) list-css),../../$(x)) ./all-static/css
149 ### ln -sf $(foreach x,$(shell $(MAKE-SILENT) list-img),../../$(x)) ./all-static/img
151 ### clean-static static-clean: force
152 ### rm -rf ./all-static
154 ### all-static: clean-static run-static
156 #################### manage templates for the plugin area
159 ln -sf $(foreach x,$(shell $(MAKE-SILENT) list-templates),../$(x)) ./templates
161 clean-templates templates-clean: force
164 redo-templates: clean-templates templates
167 ### list-all list-resources: list-templates list-js list-css list-img
169 #################### compute emacs tags
170 # list files under git but exclude third-party stuff like bootstrap and jquery
172 @git ls-files | egrep -v 'insert(_|-)above|third-party/|play/'
174 # in general it's right to rely on the contents as reported by git
176 $(MAKE-SILENT) myfiles | xargs etags
178 # however sometimes we have stuff not yet added, so in this case
180 find . -type f | fgrep -v '/.git/' | xargs etags
182 #################### sync : push current code on a (devel) box running myslice
183 SSHURL:=root@$(MYSLICEBOX):/
184 SSHCOMMAND:=ssh root@$(MYSLICEBOX)
187 # the config file should probably not be overridden ??
188 # --exclude settings.py
189 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude config.py --exclude static --exclude templates --exclude '*.sqlite3' --exclude play/
191 RSYNC_EXCLUDES := --exclude .git --exclude '*~' --exclude TAGS --exclude .DS_Store $(LOCAL_RSYNC_EXCLUDES)
192 # make -n will propagate as rsync -n
193 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
194 # putting it together
195 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
197 ##### convenience for development only, push code on a specific test box
198 # xxx until we come up with a packaging this is going to be a wild guess
199 # on debian04 I have stuff in /usr/share/myslice and a symlink in /root/myslice
200 #INSTALLED=/usr/share/myslice
201 INSTALLED=/root/myslice
204 ifeq (,$(MYSLICEBOX))
205 @echo "you need to set MYSLICEBOX, like in e.g."
206 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
209 +$(RSYNC) ./ $(SSHURL)/$(INSTALLED)/
212 # xxx likewise until we run this under apache it's probably hard to restart from here
214 ifeq (,$(MYSLICEBOX))
215 @echo "you need to set MYSLICEBOX, like in e.g."
216 @echo " $(MAKE) MYSLICEBOX=debian04.pl.sophia.inria.fr "$@""
219 @echo "$@" target not yet implemented - for an apache based depl it would read ...; exit; @$(SSHCOMMAND) /etc/init.d/apache2 restart