]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - locale/Makefile
Merge changes from CUPS 1.5svn-r9400
[thirdparty/cups.git] / locale / Makefile
index 8e3abb3ffea7843de52f2948ad7c401520eff6fb..1039addc7d77550ecf12b4e945266fdcd42342bf 100644 (file)
@@ -1,9 +1,9 @@
 #
-# "$Id: Makefile 6707 2007-07-23 17:49:41Z mike $"
+# "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
 #
 #   Locale file makefile for the Common UNIX Printing System (CUPS).
 #
-#   Copyright 2007 by Apple Inc.
+#   Copyright 2007-2008 by Apple Inc.
 #   Copyright 1993-2007 by Easy Software Products.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -16,8 +16,8 @@
 include ../Makedefs
 
 
-OBJS   =       po2strings.o strings2po.o translate.o
-TARGETS        =       po2strings strings2po translate
+OBJS   =       checkpo.o po2strings.o strings2po.o translate.o
+TARGETS        =       checkpo po2strings strings2po translate
 
 
 #
@@ -27,6 +27,20 @@ TARGETS      =       po2strings strings2po translate
 all:   $(TARGETS)
 
 
+#
+# Make library targets...
+#
+
+libs:
+
+
+#
+# Make unit tests...
+#
+
+unittests:
+
+
 #
 # Clean all config and object files...
 #
@@ -44,10 +58,17 @@ depend:
 
 
 #
-# Install files...
+# Install all targets...
 #
 
-install:       all $(INSTALL_LANGUAGES)
+install:       all install-data install-headers install-libs install-exec
+
+
+#
+# Install data files...
+#
+
+install-data: $(INSTALL_LANGUAGES)
 
 install-languages:
        $(INSTALL_DIR) -m 755 $(LOCALEDIR)
@@ -58,6 +79,31 @@ install-languages:
                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...
@@ -70,29 +116,55 @@ uninstall-languages:
                $(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, and merges changes
-#       into existing message catalogs.
+# 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:
+pot:   checkpo po2strings
        echo Updating cups.pot...
        mv cups.pot cups.pot.bck
        touch cups.pot
-       cd ..; xgettext -o locale/cups.pot -j -s --keyword=_ --no-wrap \
-               --copyright-holder="Easy Software Products" \
+       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
-       (cat cups.header; \
-        cat cups.pot | sed -e '1,6d' -e '1,$$s/PACKAGE VERSION/CUPS 1.3/' \
-            -e '1,$$s/charset=CHARSET/charset=utf-8/'; \
-        cat cups.footer) > cups.pot.N
+               */*.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
+
+
+#
+# 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) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \
+               ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+               $(COMMONLIBS) $(LIBZ)
+
+checkall:      checkpo
+       for file in *.po; do \
+               ./checkpo $$file; \
+       done
 
 
 #
@@ -102,9 +174,11 @@ pot:
 # po2strings filename.po filename.strings
 #
 
-po2strings:    po2strings.o ../cups/$(LIBCUPS)
+po2strings:    po2strings.o ../cups/$(LIBCUPSSTATIC)
        echo Linking $<...
-       $(CC) $(LDFLAGS) -o po2strings po2strings.o $(LIBS)
+       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \
+               ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+               $(COMMONLIBS) $(LIBZ)
 
 
 #
@@ -116,7 +190,7 @@ po2strings: po2strings.o ../cups/$(LIBCUPS)
 
 strings2po:    strings2po.o
        echo Linking $<...
-       $(CC) $(LDFLAGS) -o strings2po strings2po.o
+       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o
 
 
 #
@@ -126,9 +200,11 @@ strings2po:        strings2po.o
 # translate outfile language
 #
 
-translate:     translate.o ../cups/$(LIBCUPS)
+translate:     translate.o ../cups/$(LIBCUPSSTATIC)
        echo Linking $<...
-       $(CC) $(LDFLAGS) -o translate translate.o $(LIBS)
+       $(CC) $(ARCHFLAGS) $(LDFLAGS) -o translate translate.o \
+               ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+               $(COMMONLIBS) $(LIBZ)
 
 
 #
@@ -139,5 +215,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile 6707 2007-07-23 17:49:41Z mike $".
+# End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
 #