Makefile 967B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. src = src
  2. tmp = tmp
  3. dst = dist
  4. define make_pot
  5. mkdir -p ${tmp}
  6. xgettext --from-code=UTF-8 -k_ -o ${tmp}/messages.pot \
  7. ${src}/gsummer.py ${src}/ui/main_window.ui ${src}/ui/about_dialog.ui
  8. endef
  9. i18n-reset:
  10. $(call make_pot)
  11. msginit --input=${tmp}/messages.pot --locale=cs --output=${src}/po/cs.po --no-translator
  12. msginit --input=${tmp}/messages.pot --locale=pl --output=${src}/po/pl.po --no-translator
  13. i18n:
  14. $(call make_pot)
  15. msgmerge -U ${src}/po/cs.po ${tmp}/messages.pot
  16. msgmerge -U ${src}/po/pl.po ${tmp}/messages.pot
  17. l10n: i18n
  18. mkdir -p ${dst}/locale/cs/LC_MESSAGES ${dst}/locale/pl/LC_MESSAGES
  19. msgfmt ${src}/po/cs.po --output=${dst}/locale/cs/LC_MESSAGES/gsummer.mo
  20. msgfmt ${src}/po/pl.po --output=${dst}/locale/pl/LC_MESSAGES/gsummer.mo
  21. build: l10n
  22. mkdir -p ${dst}/ui
  23. cp ${src}/ui/*.ui ${dst}/ui
  24. cp ${src}/gsummer.py ${dst}/gsummer
  25. chmod +x ${dst}/gsummer
  26. rebuild: clean build
  27. clean:
  28. rm -rf ${tmp} ${dst}
  29. run:
  30. ${dst}/gsummer