]> git.ipfire.org Git - thirdparty/cups.git/blob - locale/Makefile
Update the location of strings files on newer versions of macOS.
[thirdparty/cups.git] / locale / Makefile
1 #
2 # Locale file makefile for CUPS.
3 #
4 # Copyright © 2007-2018 by Apple Inc.
5 # Copyright © 1993-2007 by Easy Software Products.
6 #
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more
8 # information.
9 #
10
11 include ../Makedefs
12
13
14 OBJS = checkpo.o po2strings.o strings2po.o
15 TARGETS = checkpo po2strings strings2po
16
17
18 #
19 # Make everything...
20 #
21
22 all: $(TARGETS)
23
24
25 #
26 # Make library targets...
27 #
28
29 libs:
30
31
32 #
33 # Make unit tests...
34 #
35
36 unittests:
37
38
39 #
40 # Clean all config and object files...
41 #
42
43 clean:
44 $(RM) $(TARGETS) $(OBJS)
45
46
47 #
48 # Update dependencies (without system header dependencies...)
49 #
50
51 depend:
52 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
53
54
55 #
56 # Install all targets...
57 #
58
59 install: all install-data install-headers install-libs install-exec
60
61
62 #
63 # Install data files...
64 #
65
66 install-data: $(INSTALL_LANGUAGES)
67
68 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 ; \
74 fi ; \
75 done
76 $(INSTALL_DIR) -m 755 $(LOCALEDIR)/en
77 $(INSTALL_DATA) cups.pot $(LOCALEDIR)/en/cups_en.po
78
79 install-langbundle: po2strings
80 $(INSTALL_DIR) -m 755 "$(BUILDROOT)$(RESOURCEDIR)"
81 $(INSTALL_DATA) cups.strings "$(BUILDROOT)$(RESOURCEDIR)"
82
83
84 #
85 # Install programs...
86 #
87
88 install-exec:
89
90
91 #
92 # Install headers...
93 #
94
95 install-headers:
96
97
98 #
99 # Install libraries...
100 #
101
102 install-libs:
103
104
105 #
106 # Uninstall files...
107 #
108
109 uninstall: $(UNINSTALL_LANGUAGES)
110
111 uninstall-languages:
112 -for loc in $(LANGUAGES) ; do \
113 $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
114 done
115
116 uninstall-langbundle:
117 $(RM) "$(BUILDROOT)$(RESOURCEDIR)/cups.strings"
118
119
120 #
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.
124 #
125
126 pot: checkpo po2strings
127 echo Updating cups.pot...
128 mv cups.pot cups.pot.bck
129 touch cups.pot
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" \
135 */*.c */*.cxx
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...
139 ./checkpo cups.pot
140 for loc in *.po ; do \
141 if test $$loc = '*.po'; then \
142 break; \
143 fi; \
144 echo Merging changes into $$loc... ; \
145 msgmerge -o $$loc -s -N --no-location $$loc cups.pot ; \
146 done
147 echo Updating cups.strings...
148 ./po2strings cups.pot cups.strings
149
150
151 #
152 # checkpo - A simple utility to check PO files for correct translation
153 # strings. Dependency on static library is deliberate.
154 #
155 # checkpo filename.po [... filenameN.po]
156 #
157
158 checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC)
159 echo Linking $@...
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)" $@
164
165 checkall: checkpo
166 ./checkpo *.po *.strings
167
168
169 #
170 # po2strings - A simple utility which uses iconv to convert GNU gettext
171 # message catalogs to macOS .strings files.
172 #
173 # po2strings filename.po filename.strings
174 #
175
176 po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC)
177 echo Linking $@...
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)" $@
182
183
184 #
185 # strings2po - A simple utility which uses iconv to convert macOS .strings files
186 # to GNU gettext message catalogs.
187 #
188 # strings2po filename.strings filename.po
189 #
190
191 strings2po: strings2po.o
192 echo Linking $@...
193 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o
194 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
195
196
197 #
198 # Dependencies...
199 #
200
201 include Dependencies