X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=locale%2FMakefile;h=4db478ce939186c9f9a70c1ab4d81c29a75528d1;hp=65831181612193b5e0cc6a5e17cd3b81666bc625;hb=e310189747c161ac6e737eedadf8f45d11bf2253;hpb=7a6a01ddca9307aa0f0abe27bb0f9074b86b1093 diff --git a/locale/Makefile b/locale/Makefile index 658311816..4db478ce9 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -1,35 +1,38 @@ # -# "$Id$" +# Locale file makefile for CUPS. # -# Locale file makefile for the Common UNIX Printing System (CUPS). +# Copyright 2007-2017 by Apple Inc. +# Copyright 1993-2007 by Easy Software Products. # -# Copyright 1993-2006 by Easy Software Products. +# Licensed under Apache License v2.0. See the file "LICENSE" for more information. # -# 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: + +include ../Makedefs + + +OBJS = checkpo.o po2strings.o strings2po.o +TARGETS = checkpo po2strings strings2po + + # -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636 USA +# Make everything... # -# Voice: (301) 373-9600 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org + +all: $(TARGETS) + + +# +# Make library targets... # -include ../Makedefs +libs: # -# Make everything... +# Make unit tests... # -all: translate +unittests: # @@ -37,21 +40,31 @@ all: translate # clean: - $(RM) translate translate.o + $(RM) $(TARGETS) $(OBJS) # -# Update dependencies... +# Update dependencies (without system header dependencies...) # depend: + $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies # -# Install files... +# Install all targets... # -install: all +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 \ @@ -60,55 +73,123 @@ install: all fi ; \ done +install-langbundle: po2strings + $(INSTALL_DIR) -m 755 "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj" + $(INSTALL_DATA) cups.strings "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj" + + +# +# Install programs... +# + +install-exec: + + +# +# Install headers... +# + +install-headers: + + +# +# Install libraries... +# + +install-libs: + # # Uninstall files... # -uninstall: +uninstall: $(UNINSTALL_LANGUAGES) + +uninstall-languages: -for loc in $(LANGUAGES) ; do \ $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \ - $(RMDIR) $(LOCALEDIR)/$$loc ; \ done - -$(RMDIR) $(LOCALEDIR) + +uninstall-langbundle: + $(RM) "$(BUILDROOT)$(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... - cd ..; xgettext -o locale/cups.pot -j --keyword=_ --no-wrap \ - --no-location --copyright-holder="Easy Software Products" \ - --msgid-bugs-address="http://www.cups.org/str.php" \ - */*.c - (cat cups.header; \ - tail +6 cups.pot | sed -e '1,$$s/PACKAGE VERSION/CUPS 1.2/' \ - -e '1,$$s/charset=CHARSET/charset=utf-8/'; \ - cat cups.footer) > cups.pot.N + mv cups.pot cups.pot.bck + touch cups.pot + cd ..; xgettext -o locale/cups.pot -cTRANSLATORS -s \ + --keyword=_ --no-wrap \ + --copyright-holder="Apple Inc." \ + --package-name="CUPS" --package-version="$(CUPS_VERSION)" \ + --msgid-bugs-address="https://github.com/apple/cups/issues" \ + */*.c */*.cxx + (cat cups.header; tail +6 cups.pot; cat cups.footer) > cups.pot.N mv cups.pot.N cups.pot - for loc in $(LANGUAGES) ; do \ - echo Merging changes into cups_$$loc.po... ; \ - msgmerge -o cups_$$loc.po --no-location cups_$$loc.po cups.pot ; \ + echo Checking cups.pot... + ./checkpo cups.pot + for loc in *.po ; do \ + if test $$loc = '*.po'; then \ + break; \ + fi; \ + echo Merging changes into $$loc... ; \ + msgmerge -o $$loc -s -N --no-location $$loc cups.pot ; \ done + echo Updating cups.strings... + ./po2strings cups.pot cups.strings # -# translate - A simple utility which uses Google to translate the cups.pot -# file to one of several languages. +# checkpo - A simple utility to check PO files for correct translation +# strings. Dependency on static library is deliberate. # -# translate outfile language +# checkpo filename.po [... filenameN.po] # -translate: translate.o ../cups/$(LIBCUPS) - echo Linking $<... - $(CC) $(LDFLAGS) -o translate translate.o $(LIBS) +checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC) + echo Linking $@... + $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \ + ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ + $(COMMONLIBS) $(LIBZ) -translate.o: ../cups/http.h ../cups/i18n.h ../cups/language.h ../cups/string.h +checkall: checkpo + ./checkpo *.po *.strings # -# End of "$Id$". +# po2strings - A simple utility which uses iconv to convert GNU gettext +# message catalogs to macOS .strings files. +# +# po2strings filename.po filename.strings # + +po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC) + echo Linking $@... + $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \ + ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ + $(COMMONLIBS) $(LIBZ) + + +# +# strings2po - A simple utility which uses iconv to convert macOS .strings files +# to GNU gettext message catalogs. +# +# strings2po filename.strings filename.po +# + +strings2po: strings2po.o + echo Linking $@... + $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o + + +# +# Dependencies... +# + +include Dependencies