#
-# "$Id: Makefile,v 1.9 2001/06/27 21:53:15 mike Exp $"
+# "$Id$"
#
# Locale file makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 1993-1999 by Easy Software Products.
+# Copyright 2007-2008 by Apple Inc.
+# Copyright 1993-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
-# property of Easy Software Products and are protected by Federal
-# copyright law. Distribution and use rights are outlined in the file
-# "LICENSE.txt" which should have been included with this file. If this
-# file is missing or damaged please contact Easy Software Products
-# at:
+# property of Apple Inc. and are protected by Federal copyright
+# law. Distribution and use rights are outlined in the file "LICENSE.txt"
+# which should have been included with this file. If this file is
+# file is missing or damaged, see the license at "http://www.cups.org/".
#
-# Attn: CUPS Licensing Information
-# Easy Software Products
-# 44141 Airport View Drive, Suite 204
-# Hollywood, Maryland 20636-3111 USA
+
+include ../Makedefs
+
+
+OBJS = checkpo.o po2strings.o strings2po.o translate.o
+TARGETS = checkpo po2strings strings2po translate
+
+
#
-# Voice: (301) 373-9603
-# EMail: cups-info@cups.org
-# WWW: http://www.cups.org
+# Make everything...
#
-include ../Makedefs
+all: $(TARGETS)
+
#
-# Locales...
+# Make library targets...
#
-LOCALES = C de en es fr it
+libs:
#
-# Make everything...
+# Make unit tests...
#
-all: translate
+unittests:
#
#
clean:
+ $(RM) $(TARGETS) $(OBJS)
+
+
+#
+# Update dependencies (without system header dependencies...)
+#
+
+depend:
+ makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1
+
+
+#
+# Install all targets...
+#
+
+install: all install-data install-headers install-libs install-exec
+
+
+#
+# Install data files...
+#
+
+install-data: $(INSTALL_LANGUAGES)
+
+install-languages:
+ $(INSTALL_DIR) -m 755 $(LOCALEDIR)
+ for loc in $(LANGUAGES) ; do \
+ if test -f cups_$$loc.po; then \
+ $(INSTALL_DIR) -m 755 $(LOCALEDIR)/$$loc ; \
+ $(INSTALL_DATA) cups_$$loc.po $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
+ fi ; \
+ done
+
+install-langbundle: po2strings
+ $(INSTALL_DIR) -m 755 "$(BUILDROOT)$(CUPS_BUNDLEDIR)/Resources/English.lproj"
+ $(INSTALL_DATA) cups.strings "$(BUILDROOT)$(CUPS_BUNDLEDIR)/Resources/English.lproj"
+
+
+#
+# Install programs...
+#
+
+install-exec:
+
+
+#
+# Install headers...
+#
+
+install-headers:
+
+
+#
+# Install libraries...
+#
+
+install-libs:
+
+
+#
+# Uninstall files...
+#
+
+uninstall: $(UNINSTALL_LANGUAGES)
+
+uninstall-languages:
+ -for loc in $(LANGUAGES) ; do \
+ $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
+ done
+
+uninstall-langbundle:
+ $(RM) "$(BUILDROOT)$(CUPS_BUNDLEDIR)/Resources/English.lproj/cups.strings"
+
+
+#
+# pot - Creates/updates the cups.pot template file, merges changes into existing
+# message catalogs, and updates the cups.strings file. We don't use
+# xgettext to update the cups.strings file due to known xgettext bugs.
+#
+
+pot: checkpo po2strings
+ echo Updating cups.pot...
+ mv cups.pot cups.pot.bck
+ touch cups.pot
+ cd ..; xgettext -o locale/cups.pot -s \
+ --keyword=_ --no-wrap \
+ --copyright-holder="Apple Inc." \
+ --package-name="CUPS" --package-version="1.5" \
+ --msgid-bugs-address="http://www.cups.org/str.php" \
+ */*.c */*.cxx
+ (cat cups.header; tail +6 cups.pot; cat cups.footer) > cups.pot.N
+ mv cups.pot.N cups.pot
+ echo Checking cups.pot...
+ ./checkpo cups.pot
+ for loc in $(LANGUAGES) ; do \
+ echo Merging changes into cups_$$loc.po... ; \
+ msgmerge -o cups_$$loc.po -s -N --no-location cups_$$loc.po cups.pot ; \
+ done
+ echo Updating cups.strings...
+ ./po2strings cups.pot cups.strings
#
-# Install files...
+# checkpo - A simple utility to check PO files for correct translation
+# strings. Dependency on static library is deliberate.
#
+# checkpo filename.po [... filenameN.po]
+#
+
+checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC)
+ echo Linking $<...
+ $(CC) $(LDFLAGS) -o checkpo checkpo.o ../cups/$(LIBCUPSSTATIC) \
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
-install:
- $(INSTALL_DIR) $(LOCALEDIR)
- for dir in $(LOCALES) ; do \
- $(INSTALL_DIR) $(LOCALEDIR)/$$dir ; \
- $(INSTALL_DATA) $$dir/cups_$$dir $(LOCALEDIR)/$$dir ; \
+checkall: checkpo
+ for file in *.po; do \
+ ./checkpo $$file; \
done
#
-# translate - a simple utility to use Bablefish to translate the POSIX message
+# po2strings - A simple utility which uses iconv to convert GNU gettext
+# message catalogs to Mac OS X .strings files.
+#
+# po2strings filename.po filename.strings
+#
+
+po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC)
+ echo Linking $<...
+ $(CC) $(LDFLAGS) -o po2strings po2strings.o ../cups/$(LIBCUPSSTATIC) \
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+
+
+#
+# strings2po - A simple utility which uses iconv to convert Mac OS X
+# .strings files to GNU gettext message catalogs.
+#
+# strings2po filename.strings filename.po
+#
+
+strings2po: strings2po.o
+ echo Linking $<...
+ $(CC) $(LDFLAGS) -o strings2po strings2po.o
+
+
+#
+# translate - A simple utility which uses Google to translate the cups.pot
# file to one of several languages.
#
# translate outfile language
#
-translate: translate.o ../cups/$(LIBCUPS)
+translate: translate.o ../cups/$(LIBCUPSSTATIC)
echo Linking $<...
- $(CC) $(LDFLAGS) -o translate translate.o $(LIBS)
+ $(CC) $(LDFLAGS) -o translate translate.o ../cups/$(LIBCUPSSTATIC) \
+ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+
-translate.o: ../cups/http.h
+#
+# Dependencies...
+#
+
+include Dependencies
#
-# End of "$Id: Makefile,v 1.9 2001/06/27 21:53:15 mike Exp $".
+# End of "$Id$".
#