2 # Locale file makefile for CUPS.
4 # Copyright © 2007-2019 by Apple Inc.
5 # Copyright © 1993-2007 by Easy Software Products.
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
14 OBJS
= checkpo.o po2strings.o strings2po.o
15 TARGETS
= checkpo po2strings strings2po
26 # Make library targets...
40 # Clean all config and object files...
44 $(RM
) $(TARGETS
) $(OBJS
)
48 # Update dependencies (without system header dependencies...)
52 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
56 # Install all targets...
59 install: all install-data install-headers install-libs install-exec
63 # Install data files...
66 install-data
: $(INSTALL_LANGUAGES
)
69 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)
70 for loc in en
$(LANGUAGES
) ; do \
71 if
test -f cups_
$$loc.po
; then \
72 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)/$$loc ; \
73 $(INSTALL_DATA
) cups_
$$loc.po
$(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
78 $(INSTALL_DIR
) -m
755 "$(BUILDROOT)$(RESOURCEDIR)"
79 $(INSTALL_DATA
) cups.strings
"$(BUILDROOT)$(RESOURCEDIR)"
97 # Install libraries...
107 uninstall: $(UNINSTALL_LANGUAGES
)
110 -for loc in en
$(LANGUAGES
) ; do \
111 $(RM
) $(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
114 uninstall-langbundle
:
115 $(RM
) "$(BUILDROOT)$(RESOURCEDIR)/cups.strings"
119 # pot - Creates/updates the cups.pot template file, merges changes into existing
120 # message catalogs, and updates the cups.strings file. We don't use
121 # xgettext to update the cups.strings file due to known xgettext bugs.
124 pot
: checkpo po2strings
125 echo Updating cups.pot...
126 mv cups.pot cups.pot.bck
128 cd ..
; xgettext
-o locale
/cups.pot
-cTRANSLATORS
-s \
129 --keyword
=_
--no-wrap
--from-code utf-8 \
130 --copyright-holder
="Apple Inc." \
131 --package-name
="CUPS" --package-version
="$(CUPS_VERSION)" \
132 --msgid-bugs-address
="https://github.com/apple/cups/issues" \
134 (cat cups.header
; tail
+6 cups.pot
) > cups.pot.N
135 mv cups.pot.N cups.pot
136 echo Checking cups.pot...
138 for loc in
*.po
; do \
139 if
test $$loc = '*.po'; then \
142 echo Merging changes into
$$loc...
; \
143 msgmerge
-o
$$loc -s
-N
--no-location
$$loc cups.pot
; \
145 echo Updating cups.strings...
146 .
/po2strings cups_en.po cups.strings
148 cups.strings
: cups_en.po po2strings
149 echo Updating cups.strings...
150 .
/po2strings cups_en.po cups.strings
154 # checkpo - A simple utility to check PO files for correct translation
155 # strings. Dependency on static library is deliberate.
157 # checkpo filename.po [... filenameN.po]
160 checkpo
: checkpo.o ..
/cups
/$(LIBCUPSSTATIC
)
162 $(LD_CC
) $(ARCHFLAGS
) $(ALL_LDFLAGS
) -o checkpo checkpo.o \
164 $(CODE_SIGN
) -s
"$(CODE_SIGN_IDENTITY)" $@
167 .
/checkpo
*.po
*.strings
171 # po2strings - A simple utility which uses iconv to convert GNU gettext
172 # message catalogs to macOS .strings files.
174 # po2strings filename.po filename.strings
177 po2strings
: po2strings.o ..
/cups
/$(LIBCUPSSTATIC
)
179 $(LD_CC
) $(ARCHFLAGS
) $(ALL_LDFLAGS
) -o po2strings po2strings.o \
181 $(CODE_SIGN
) -s
"$(CODE_SIGN_IDENTITY)" $@
185 # strings2po - A simple utility which uses iconv to convert macOS .strings files
186 # to GNU gettext message catalogs.
188 # strings2po filename.strings filename.po
191 strings2po
: strings2po.o
193 $(LD_CC
) $(ARCHFLAGS
) $(ALL_LDFLAGS
) -o strings2po strings2po.o
194 $(CODE_SIGN
) -s
"$(CODE_SIGN_IDENTITY)" $@