2 # Locale file makefile for CUPS.
4 # Copyright © 2007-2018 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
$(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
; \
76 $(INSTALL_DIR
) -m
755 $(LOCALEDIR
)/en
77 $(INSTALL_DATA
) cups.pot
$(LOCALEDIR
)/en
/cups_en.po
79 install-langbundle
: po2strings
80 $(INSTALL_DIR
) -m
755 "$(BUILDROOT)$(RESOURCEDIR)"
81 $(INSTALL_DATA
) cups.strings
"$(BUILDROOT)$(RESOURCEDIR)"
99 # Install libraries...
109 uninstall: $(UNINSTALL_LANGUAGES
)
112 -for loc in
$(LANGUAGES
) ; do \
113 $(RM
) $(LOCALEDIR
)/$$loc/cups_
$$loc.po
; \
116 uninstall-langbundle
:
117 $(RM
) "$(BUILDROOT)$(RESOURCEDIR)/cups.strings"
121 # pot - Creates/updates the cups.pot template file, merges changes into existing
122 # message catalogs, and updates the cups.strings file. We don't use
123 # xgettext to update the cups.strings file due to known xgettext bugs.
126 pot
: checkpo po2strings
127 echo Updating cups.pot...
128 mv cups.pot cups.pot.bck
130 cd ..
; xgettext
-o locale
/cups.pot
-cTRANSLATORS
-s \
131 --keyword
=_
--no-wrap \
132 --copyright-holder
="Apple Inc." \
133 --package-name
="CUPS" --package-version
="$(CUPS_VERSION)" \
134 --msgid-bugs-address
="https://github.com/apple/cups/issues" \
136 (cat cups.header
; tail
+6 cups.pot
; cat cups.footer
) > cups.pot.N
137 mv cups.pot.N cups.pot
138 echo Checking cups.pot...
140 for loc in
*.po
; do \
141 if
test $$loc = '*.po'; then \
144 echo Merging changes into
$$loc...
; \
145 msgmerge
-o
$$loc -s
-N
--no-location
$$loc cups.pot
; \
147 echo Updating cups.strings...
148 .
/po2strings cups.pot cups.strings
152 # checkpo - A simple utility to check PO files for correct translation
153 # strings. Dependency on static library is deliberate.
155 # checkpo filename.po [... filenameN.po]
158 checkpo
: checkpo.o ..
/cups
/$(LIBCUPSSTATIC
)
160 $(LD_CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o checkpo checkpo.o \
161 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
162 $(COMMONLIBS
) $(LIBZ
)
163 $(CODE_SIGN
) -s
"$(CODE_SIGN_IDENTITY)" $@
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
)
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
) $(LDFLAGS
) -o strings2po strings2po.o
194 $(CODE_SIGN
) -s
"$(CODE_SIGN_IDENTITY)" $@