1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
DESTDIR =
DBDIR0 = $(shell ls -d /srv/manuels*)
DBDIR = $(shell if [ -d "$(DBDIR0)" ]; then echo $(DBDIR0); else echo .; fi)
SAVEDIR = $(DBDIR)/media/sauvegarde
LOCALES = --locale fr --locale en --locale es
POFILES = $(shell [ -d locale ] && find locale -name "*.po")
MOFILES = $(patsubst %.po, %.mo, $(POFILES))
all: aide/output/index.html $(MOFILES)
aide/output/index.html : $(shell [ -d aide/content/pages ] && ls aide/content/pages/*)
make -C aide html
@for l in es en; do \
python3 outils/non_traduits.py aide/content/pages $$l; \
done
$(MOFILES): $(POFILES)
@python3 manage.py compilemessages | grep -v "up to date" || true
clean:
find . -name "*~" | xargs rm -f
rm -f $(MOFILES)
savedb:
@cd $(DBDIR); python3 savedb.py $(DBDIR)
stats_dev:
@echo "Décompte des lignes codées par l'auteur"
@echo "======================================="
@echo
@total=0; \
n=$$(cat $$(find manuels -name "*.py"| grep -v migrat) | wc -l); \
echo "- $${n} lignes en langage Python (application manuels)."; total=$$((total + n)); \
n=$$(cat $$(find gestion -name "*.py"| grep -v migrat) | wc -l); \
echo "- $${n} lignes en langage Python (module gestion)."; total=$$((total + n)); \
n=$$(cat $$(find gestion -name "*.html") | wc -l); \
echo "- $${n} lignes en langage HTML."; total=$$((total + n)); \
n=$$(cat $$(find gestion/static -name "*.css"| grep -v jquery) | wc -l); \
echo "- $${n} lignes en langage CSS."; total=$$((total + n)); \
n=$$(cat $$(find gestion/static -name "*.js"| grep -v jquery) | wc -l); \
echo "- $${n} lignes en langage Javascript."; total=$$((total + n)); \
echo; echo $$total lignes en tout.
rsync_upload: aide/output/index.html
rsync -av --delete --exclude="db*" --exclude="*archive*" --exclude="media" * freeduc.science:/srv/manuels.freeduc.science/
ssh freeduc.science "cd /srv/manuels.freeduc.science; echo 'yes' | ./manage.py collectstatic; ./manage.py migrate"
@echo "prochaines commandes : ssh freeduc.science, puis sudo service apache2 reload, et synchronisation de media/"
MAKEMESSAGE_PARAMS = --extension "html,txt,py,rml" --ignore aide/output
messages:
./manage.py makemessages $(LOCALES) $(MAKEMESSAGE_PARAMS)
./manage.py compilemessages | grep -v "up to date"
|