~majster-pl/socketworld/trunk

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Szymon Waliczek
  • Date: 2015-05-18 22:19:24 UTC
  • Revision ID: majsterrr@gmail.com-20150518221924-9ayk0zkwuml1gyor
New ver. 2.0, new UI

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# More information: https://wiki.ubuntu.com/Touch/Testing
 
2
#
 
3
# Notes for autopilot tests:
 
4
# ---------------------------------------------------------------
 
5
# In order to run autopilot tests:
 
6
# sudo apt-add-repository ppa:autopilot/ppa
 
7
# sudo apt-get update
 
8
# sudo apt-get install python-autopilot autopilot-qt
 
9
#
 
10
# Notes for translations:
 
11
# ---------------------------------------------------------------
 
12
# In order to create translation files manually:
 
13
# 1) run make once to create and update the po/template.pot
 
14
# 2) copy the template file and set the name to the language you want to
 
15
#    translate to:   cp po/template.pot po/de.po
 
16
# 3) edit the po file
 
17
# 4) run make build-translations to build the translation files
 
18
#
 
19
# Steps 1) and 4) are automatically executed by QtCreator
 
20
#################################################################
 
21
 
 
22
#APP_ID needs to match the "name" field of the click manifest
 
23
APP_ID=com.ubuntu.developer.majster-pl.socket-world
 
24
 
 
25
#provides a way for the IDE to set a specific target folder for the translations
 
26
TRANSLATION_ROOT=.
 
27
 
 
28
MO_FILES=$(shell for infile in `find po -name "*.po"`; do basename -s .po $$infile | awk '{print "$(TRANSLATION_ROOT)/share/locale/" $$0 "/LC_MESSAGES/$(APP_ID).mo";}' ; done)
 
29
QMLJS_FILES=$(shell find . -name "*.qml" -o -name "*.js" | grep -v ./tests)
 
30
 
 
31
all: po/template.pot
 
32
 
 
33
autopilot:
 
34
        chmod +x tests/autopilot/run
 
35
        tests/autopilot/run
 
36
 
 
37
check:
 
38
        qmltestrunner -input tests/unit
 
39
 
 
40
#translation targets
 
41
 
 
42
build-translations: $(MO_FILES)
 
43
 
 
44
po/template.pot: $(QMLJS_FILES)
 
45
        mkdir -p $(CURDIR)/po && xgettext -o po/template.pot --qt --c++ --add-comments=TRANSLATORS --keyword=tr --keyword=tr:1,2 $(QMLJS_FILES) --from-code=UTF-8
 
46
 
 
47
$(TRANSLATION_ROOT)/share/locale/%/LC_MESSAGES/$(APP_ID).mo: po/%.po
 
48
        mkdir -p $(TRANSLATION_ROOT)/share/locale/$*/LC_MESSAGES && msgfmt -o $(@) $(<)
 
49