Mercurial > gemma
comparison client/Makefile @ 1849:aabde3279947
client: translations: improve Makefile
* Change target `translations` to only be remade if one of
the `*.po` files changes. Technically is only directly depends
on these files. This looks like a defect in the original upstream
Makefile logic.
* Add found `*.js` files to the dependencies of the `pot` target,
because they are used when creating it. This looks like it was missed
when adding the Makefile initially with 0fd572582ab8.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Thu, 17 Jan 2019 09:48:21 +0100 |
parents | 2c71012fee5e |
children | 6840401ec6a6 |
comparison
equal
deleted
inserted
replaced
1848:452f37a09fd7 | 1849:aabde3279947 |
---|---|
41 | 41 |
42 translations: ./$(OUTPUT_DIR)/locale/translations.json | 42 translations: ./$(OUTPUT_DIR)/locale/translations.json |
43 | 43 |
44 # Create a main .pot template, then generate .po files for each available language. | 44 # Create a main .pot template, then generate .po files for each available language. |
45 # Thanx to Systematic: https://github.com/Polyconseil/systematic/blob/866d5a/mk/main.mk#L167-L183 | 45 # Thanx to Systematic: https://github.com/Polyconseil/systematic/blob/866d5a/mk/main.mk#L167-L183 |
46 $(TEMPLATE_POT): $(GETTEXT_HTML_SOURCES) | 46 $(TEMPLATE_POT): $(GETTEXT_HTML_SOURCES) $(GETTEXT_JS_SOURCES) |
47 # `dir` is a Makefile built-in expansion function which extracts the directory-part of `$@`. | 47 # `dir` is a Makefile built-in expansion function which extracts the directory-part of `$@`. |
48 # `$@` is a Makefile automatic variable: the file name of the target of the rule. | 48 # `$@` is a Makefile automatic variable: the file name of the target of the rule. |
49 # => `mkdir -p /tmp/` | 49 # => `mkdir -p /tmp/` |
50 mkdir -p $(dir $@) | 50 mkdir -p $(dir $@) |
51 which gettext-extract | 51 which gettext-extract |
64 mkdir -p $$(dirname $$PO_FILE); \ | 64 mkdir -p $$(dirname $$PO_FILE); \ |
65 [ -f $$PO_FILE ] && msgmerge --lang=$$lang --update $$PO_FILE $@ || msginit --no-translator --locale=$$lang --input=$@ --output-file=$$PO_FILE; \ | 65 [ -f $$PO_FILE ] && msgmerge --lang=$$lang --update $$PO_FILE $@ || msginit --no-translator --locale=$$lang --input=$@ --output-file=$$PO_FILE; \ |
66 msgattrib --no-wrap --no-obsolete -o $$PO_FILE $$PO_FILE; \ | 66 msgattrib --no-wrap --no-obsolete -o $$PO_FILE $$PO_FILE; \ |
67 done; | 67 done; |
68 | 68 |
69 $(OUTPUT_DIR)/locale/translations.json: clean $(TEMPLATE_POT) | 69 $(OUTPUT_DIR)/locale/translations.json: $(LOCALE_FILES) |
70 mkdir -p $(OUTPUT_DIR) | 70 mkdir -p $(OUTPUT_DIR) |
71 gettext-compile --output $@ $(LOCALE_FILES) | 71 gettext-compile --output $@ $(LOCALE_FILES) |