| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
ifndef PREFIX |
| 8 |
ifdef INSTALL_PREFIX |
| 9 |
PREFIX=$(INSTALL_PREFIX) |
| 10 |
else |
| 11 |
PREFIX=/usr/local |
| 12 |
endif |
| 13 |
endif |
| 14 |
|
| 15 |
NAME = devilspie2 |
| 16 |
VERSION = $(shell cat ../VERSION) |
| 17 |
DATADIR = ${DESTDIR}${PREFIX}/share |
| 18 |
LOCALEDIR = ${DATADIR}/locale |
| 19 |
|
| 20 |
SOURCES = config.c devilspie2.c script.c script_functions.c xutils.c error_strings.c |
| 21 |
|
| 22 |
XG_ARGS = --keyword=_ --keyword=N_ -w 80 --package-name=${NAME} --package-version=${VERSION} [email protected] |
| 23 |
LANGUAGES = sv fr pt_BR nl ru fi ja it |
| 24 |
|
| 25 |
LANGUAGES_MO = $(foreach currlang,$(LANGUAGES),$(currlang).mo) |
| 26 |
LANGUAGES_PO = $(foreach currlang,$(LANGUAGES),$(currlang).po) |
| 27 |
|
| 28 |
all: build |
| 29 |
|
| 30 |
${NAME}.pot: |
| 31 |
xgettext ${XG_ARGS} --directory=../src/ ${SOURCES} -d ${NAME} -o ./${NAME}.pot |
| 32 |
|
| 33 |
update-pot: ${NAME}.pot |
| 34 |
|
| 35 |
%.pox: %.po |
| 36 |
msgmerge -o $@ --previous $< ${NAME}.pot |
| 37 |
|
| 38 |
build: $(LANGUAGES_MO) |
| 39 |
|
| 40 |
$(LANGUAGES_MO): $(LANGUAGES_PO) |
| 41 |
for po in ${LANGUAGES}; \ |
| 42 |
do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \ |
| 43 |
done |
| 44 |
|
| 45 |
|
| 46 |
install: all install-dirs |
| 47 |
for po in ${LANGUAGES}; \ |
| 48 |
do install -m 0644 $${po}.mo ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \ |
| 49 |
done |
| 50 |
|
| 51 |
install-dirs: |
| 52 |
for po in ${LANGUAGES}; \ |
| 53 |
do install -d ${LOCALEDIR}/$${po}/LC_MESSAGES; \ |
| 54 |
done |
| 55 |
|
| 56 |
uninstall: |
| 57 |
for po in ${LANGUAGES}; \ |
| 58 |
do rm -f ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \ |
| 59 |
done |
| 60 |
|
| 61 |
clean-build: |
| 62 |
rm -f *.mo |
| 63 |
|
| 64 |
clean-pox: |
| 65 |
rm -f *.pox |
| 66 |
|
| 67 |
clean: clean-build |
| 68 |
rm -f *~ |
| 69 |
|
| 70 |
.PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot |
| 71 |
|