2 # Locale file makefile for CUPS.
4 # Copyright 2007-2017 by Apple Inc.
5 # Copyright 1993-2007 by Easy Software Products.
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more information.
13 OBJS
= checkpo.o po2strings.o strings2po.o
14 TARGETS
= checkpo po2strings strings2po
25 # Make library targets...
39 # Clean all config and object files...
43 $(RM
) $(TARGETS
) $(OBJS
)
47 # Update dependencies (without system header dependencies...)
51 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
55 # Install all targets...
58 install: all install-data install-headers install-libs install-exec
62 # Install data files...
65 install-data
: $(INSTALL_LANGUAGES
)
68 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)
69 for loc in
$(LANGUAGES
) ; do \
70 if
test -f cups_
$$loc.po
; then \
71 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)/$$loc ; \
72 $(INSTALL_DATA
) cups_
$$loc.po
$(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
76 install-langbundle
: po2strings
77 $(INSTALL_DIR
) -m
755 "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
78 $(INSTALL_DATA
) cups.strings
"$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
96 # Install libraries...
106 uninstall: $(UNINSTALL_LANGUAGES
)
109 -for loc in
$(LANGUAGES
) ; do \
110 $(RM
) $(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
113 uninstall-langbundle
:
114 $(RM
) "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj/cups.strings"
118 # pot - Creates/updates the cups.pot template file, merges changes into existing
119 # message catalogs, and updates the cups.strings file. We don't use
120 # xgettext to update the cups.strings file due to known xgettext bugs.
123 pot
: checkpo po2strings
124 echo Updating cups.pot...
125 mv cups.pot cups.pot.bck
127 cd ..
; xgettext
-o locale
/cups.pot
-cTRANSLATORS
-s \
128 --keyword
=_
--no-wrap \
129 --copyright-holder
="Apple Inc." \
130 --package-name
="CUPS" --package-version
="$(CUPS_VERSION)" \
131 --msgid-bugs-address
="https://github.com/apple/cups/issues" \
133 (cat cups.header
; tail
+6 cups.pot
; cat cups.footer
) > cups.pot.N
134 mv cups.pot.N cups.pot
135 echo Checking cups.pot...
137 for loc in
*.po
; do \
138 if
test $$loc = '*.po'; then \
141 echo Merging changes into
$$loc...
; \
142 msgmerge
-o
$$loc -s
-N
--no-location
$$loc cups.pot
; \
144 echo Updating cups.strings...
145 .
/po2strings cups.pot cups.strings
149 # checkpo - A simple utility to check PO files for correct translation
150 # strings. Dependency on static library is deliberate.
152 # checkpo filename.po [... filenameN.po]
155 checkpo
: checkpo.o ..
/cups
/$(LIBCUPSSTATIC
)
157 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o checkpo checkpo.o \
158 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
159 $(COMMONLIBS
) $(LIBZ
)
162 .
/checkpo
*.po
*.strings
166 # po2strings - A simple utility which uses iconv to convert GNU gettext
167 # message catalogs to macOS .strings files.
169 # po2strings filename.po filename.strings
172 po2strings
: po2strings.o ..
/cups
/$(LIBCUPSSTATIC
)
174 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o po2strings po2strings.o \
175 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
176 $(COMMONLIBS
) $(LIBZ
)
180 # strings2po - A simple utility which uses iconv to convert macOS .strings files
181 # to GNU gettext message catalogs.
183 # strings2po filename.strings filename.po
186 strings2po
: strings2po.o
188 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o strings2po strings2po.o