comparison client/Makefile @ 1850:6840401ec6a6

client: translations: (minor) improve Makefile * Make behaviour consistent for two occasions to have code that can more easily understood. * Add ignorance of error message when searching for JS files. * Use `$(OUTPUT_DIR)` without `./` prefix everywhere.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 17 Jan 2019 09:59:00 +0100
parents aabde3279947
children a1164d2e23e1
comparison
equal deleted inserted replaced
1849:aabde3279947 1850:6840401ec6a6
24 24
25 # Name of the generated .po files for each available locale. 25 # Name of the generated .po files for each available locale.
26 LOCALE_FILES ?= $(patsubst %,$(OUTPUT_DIR)/locale/%/LC_MESSAGES/app.po,$(LOCALES)) 26 LOCALE_FILES ?= $(patsubst %,$(OUTPUT_DIR)/locale/%/LC_MESSAGES/app.po,$(LOCALES))
27 27
28 GETTEXT_HTML_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.html' 2> /dev/null) 28 GETTEXT_HTML_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.html' 2> /dev/null)
29 GETTEXT_JS_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.js') 29 GETTEXT_JS_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.js' 2> /dev/null)
30 30
31 # Makefile Targets 31 # Makefile Targets
32 .PHONY: clean makemessages translations all 32 .PHONY: clean makemessages translations all
33 33
34 all: 34 all:
37 clean: 37 clean:
38 rm -f $(TEMPLATE_POT) $(OUTPUT_DIR)/locale/translations.json 38 rm -f $(TEMPLATE_POT) $(OUTPUT_DIR)/locale/translations.json
39 39
40 makemessages: $(TEMPLATE_POT) 40 makemessages: $(TEMPLATE_POT)
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) $(GETTEXT_JS_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 `$@`.