2 # Locale file makefile for CUPS.
4 # Copyright 2007-2017 by Apple Inc.
5 # Copyright 1993-2007 by Easy Software Products.
7 # These coded instructions, statements, and computer programs are the
8 # property of Apple Inc. and are protected by Federal copyright
9 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 # which should have been included with this file. If this file is
11 # missing or damaged, see the license at "http://www.cups.org/".
17 OBJS
= checkpo.o po2strings.o strings2po.o
18 TARGETS
= checkpo po2strings strings2po
29 # Make library targets...
43 # Clean all config and object files...
47 $(RM
) $(TARGETS
) $(OBJS
)
51 # Update dependencies (without system header dependencies...)
55 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
59 # Install all targets...
62 install: all install-data install-headers install-libs install-exec
66 # Install data files...
69 install-data
: $(INSTALL_LANGUAGES
)
72 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)
73 for loc in
$(LANGUAGES
) ; do \
74 if
test -f cups_
$$loc.po
; then \
75 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)/$$loc ; \
76 $(INSTALL_DATA
) cups_
$$loc.po
$(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
80 install-langbundle
: po2strings
81 $(INSTALL_DIR
) -m
755 "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
82 $(INSTALL_DATA
) cups.strings
"$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
100 # Install libraries...
110 uninstall: $(UNINSTALL_LANGUAGES
)
113 -for loc in
$(LANGUAGES
) ; do \
114 $(RM
) $(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
117 uninstall-langbundle
:
118 $(RM
) "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj/cups.strings"
122 # pot - Creates/updates the cups.pot template file, merges changes into existing
123 # message catalogs, and updates the cups.strings file. We don't use
124 # xgettext to update the cups.strings file due to known xgettext bugs.
127 pot
: checkpo po2strings
128 echo Updating cups.pot...
129 mv cups.pot cups.pot.bck
131 cd ..
; xgettext
-o locale
/cups.pot
-cTRANSLATORS
-s \
132 --keyword
=_
--no-wrap \
133 --copyright-holder
="Apple Inc." \
134 --package-name
="CUPS" --package-version
="$(CUPS_VERSION)" \
135 --msgid-bugs-address
="https://github.com/apple/cups/issues" \
137 (cat cups.header
; tail
+6 cups.pot
; cat cups.footer
) > cups.pot.N
138 mv cups.pot.N cups.pot
139 echo Checking cups.pot...
141 for loc in
*.po
; do \
142 if
test $$loc = '*.po'; then \
145 echo Merging changes into
$$loc...
; \
146 msgmerge
-o
$$loc -s
-N
--no-location
$$loc cups.pot
; \
148 echo Updating cups.strings...
149 .
/po2strings cups.pot cups.strings
153 # checkpo - A simple utility to check PO files for correct translation
154 # strings. Dependency on static library is deliberate.
156 # checkpo filename.po [... filenameN.po]
159 checkpo
: checkpo.o ..
/cups
/$(LIBCUPSSTATIC
)
161 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o checkpo checkpo.o \
162 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
163 $(COMMONLIBS
) $(LIBZ
)
166 .
/checkpo
*.po
*.strings
170 # po2strings - A simple utility which uses iconv to convert GNU gettext
171 # message catalogs to macOS .strings files.
173 # po2strings filename.po filename.strings
176 po2strings
: po2strings.o ..
/cups
/$(LIBCUPSSTATIC
)
178 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o po2strings po2strings.o \
179 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
180 $(COMMONLIBS
) $(LIBZ
)
184 # strings2po - A simple utility which uses iconv to convert macOS .strings files
185 # to GNU gettext message catalogs.
187 # strings2po filename.strings filename.po
190 strings2po
: strings2po.o
192 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o strings2po strings2po.o