~ubuntu-branches/ubuntu/raring/apparmor/raring

« back to all changes in this revision

Viewing changes to common/Make-po.rules

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#       $Id: Make-po.rules 238 2006-11-15 09:22:15Z steve-beattie $
 
2
# ------------------------------------------------------------------
 
3
#
 
4
#    Copyright (C) 2002-2005 Novell/SUSE
 
5
#
 
6
#    This program is free software; you can redistribute it and/or
 
7
#    modify it under the terms of version 2 of the GNU General Public 
 
8
#    License published by the Free Software Foundation.
 
9
#
 
10
# ------------------------------------------------------------------
 
11
#
 
12
# The including makefile needs to define LANG, which lists the lang
 
13
# files to include; e.g. LANG=en_US de_DE, where en_US.po and de_DE.po
 
14
# exist
 
15
LOCALEDIR=/usr/share/locale
 
16
 
 
17
XGETTEXT_ARGS=--copyright-holder="NOVELL, Inc." --msgid-bugs-address=apparmor-general@forge.novell.com -d ${NAME}
 
18
 
 
19
# When making the .pot file, it's expected that the parent Makefile will
 
20
# pass in the list of sources in the SOURCES variable
 
21
PARENT_SOURCES=$(foreach source, ${SOURCES}, ../${source})
 
22
 
 
23
LANGS=$(patsubst %.po, %, $(wildcard *.po))
 
24
TARGET_MOS=$(foreach lang, $(filter-out $(DISABLED_LANGS),$(LANGS)), ${lang}.mo)
 
25
 
 
26
.PHONY: all
 
27
all: ${TARGET_MOS}
 
28
 
 
29
${NAME}.pot: ${PARENT_SOURCES}
 
30
        xgettext ${XGETTEXT_ARGS} ${PARENT_SOURCES} -o $@
 
31
 
 
32
%.mo: %.po
 
33
        msgfmt -c -o $@ $<
 
34
 
 
35
.PHONY: install
 
36
install: ${TARGET_MOS}
 
37
        mkdir -p $(DESTDIR)/${LOCALEDIR}
 
38
        for lang in ${LANGS} ; do \
 
39
                mkdir -p ${DESTDIR}/${LOCALEDIR}/$${lang}/LC_MESSAGES ; \
 
40
                install -m 644 $${lang}.mo ${DESTDIR}/${LOCALEDIR}/$${lang}/LC_MESSAGES/${NAME}.mo ; \
 
41
        done
 
42
 
 
43
.PHONY: clean
 
44
clean:
 
45
        rm -f *.mo Make.rules