mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00

automatically added to the set of languages to be built and installed unless they are explicitly added to the set of disabled translations. This eliminates the need to manually add a lang to the Makefile when a new translation is submitted (svn add will still be necessary).
45 lines
1.4 KiB
Text
45 lines
1.4 KiB
Text
# $Id$
|
|
# ------------------------------------------------------------------
|
|
#
|
|
# Copyright (C) 2002-2005 Novell/SUSE
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
# License published by the Free Software Foundation.
|
|
#
|
|
# ------------------------------------------------------------------
|
|
#
|
|
# The including makefile needs to define LANG, which lists the lang
|
|
# files to include; e.g. LANG=en_US de_DE, where en_US.po and de_DE.po
|
|
# exist
|
|
LOCALEDIR=/usr/share/locale
|
|
|
|
XGETTEXT_ARGS=--copyright-holder="NOVELL, Inc." --msgid-bugs-address=apparmor-general@forge.novell.com -d ${NAME}
|
|
|
|
# When making the .pot file, it's expected that the parent Makefile will
|
|
# pass in the list of sources in the SOURCES variable
|
|
PARENT_SOURCES=$(foreach source, ${SOURCES}, ../${source})
|
|
|
|
LANGS=$(patsubst %.po, %, $(wildcard *.po))
|
|
TARGET_MOS=$(foreach lang, $(filter-out $(DISABLED_LANGS),$(LANGS)), ${lang}.mo)
|
|
|
|
.PHONY: all
|
|
all: ${TARGET_MOS}
|
|
|
|
${NAME}.pot: ${PARENT_SOURCES}
|
|
xgettext ${XGETTEXT_ARGS} ${PARENT_SOURCES} -o $@
|
|
|
|
%.mo: %.po
|
|
msgfmt -c -o $@ $<
|
|
|
|
.PHONY: install
|
|
install: ${TARGET_MOS}
|
|
mkdir -p $(DESTDIR)/${LOCALEDIR}
|
|
for lang in ${LANGS} ; do \
|
|
mkdir -p ${DESTDIR}/${LOCALEDIR}/$${lang}/LC_MESSAGES ; \
|
|
install -m 644 $${lang}.mo ${DESTDIR}/${LOCALEDIR}/$${lang}/LC_MESSAGES/${NAME}.mo ; \
|
|
done
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f *.mo Make.rules
|