forked from openSUSE/planet.opensuse.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (25 loc) · 986 Bytes
/
Makefile
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
JAVA=java -Xmx8m
L10N_DIR=locale
DOMAIN=planetsuse
POT=$(L10N_DIR)/$(DOMAIN).pot
COMPRESSOR=$(JAVA) -jar ./tools/yuicompressor.jar
CSS := $(patsubst %.css,%.min.css,$(filter-out %.min.css,$(wildcard website/css/*.css)))
JS := $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard website/js/*.js)))
L10N_SOURCES := $(wildcard planetsuse/*.html)
PO_FILES := $(wildcard locale/*.po)
MO_FILES := $(patsubst locale/%.po,locale/%/LC_MESSAGES/$(DOMAIN).mo,${PO_FILES})
website/css/%.min.css: website/css/%.css
$(COMPRESSOR) --type css --charset UTF-8 --verbose -o "$@" "$<"
website/js/%.min.js: website/js/%.js
$(COMPRESSOR) --type js --charset UTF-8 --verbose -o "$@" "$<"
$(L10N_DIR)/%/LC_MESSAGES/$(DOMAIN).mo: $(L10N_DIR)/%.po
mkdir -p $(dir $@) && msgfmt -c -o "$@" "$<"
.DEFAULT: all
all: minify l10n
minify: ${CSS} ${JS}
$(POT): ${L10N_SOURCES}
./l10n-extract-from-templates
${PO_FILES}: $(POT)
msgmerge --update "$@" "$<"
l10n: ${MO_FILES}
.PHONY: all minify l10n