]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
7e86f2f6 | 2 | # Locale file makefile for CUPS. |
ef416fc2 | 3 | # |
e4b72d7e MS |
4 | # Copyright © 2007-2018 by Apple Inc. |
5 | # Copyright © 1993-2007 by Easy Software Products. | |
ef416fc2 | 6 | # |
e4b72d7e MS |
7 | # Licensed under Apache License v2.0. See the file "LICENSE" for more |
8 | # information. | |
ef416fc2 | 9 | # |
10 | ||
11 | include ../Makedefs | |
12 | ||
ef416fc2 | 13 | |
7e86f2f6 MS |
14 | OBJS = checkpo.o po2strings.o strings2po.o |
15 | TARGETS = checkpo po2strings strings2po | |
bc44d920 | 16 | |
17 | ||
ef416fc2 | 18 | # |
19 | # Make everything... | |
20 | # | |
21 | ||
bc44d920 | 22 | all: $(TARGETS) |
ef416fc2 | 23 | |
24 | ||
c9fc04c6 MS |
25 | # |
26 | # Make library targets... | |
27 | # | |
28 | ||
29 | libs: | |
30 | ||
31 | ||
5f64df29 MS |
32 | # |
33 | # Make unit tests... | |
34 | # | |
35 | ||
36 | unittests: | |
37 | ||
38 | ||
ef416fc2 | 39 | # |
40 | # Clean all config and object files... | |
41 | # | |
42 | ||
43 | clean: | |
bc44d920 | 44 | $(RM) $(TARGETS) $(OBJS) |
ef416fc2 | 45 | |
46 | ||
bd7854cb | 47 | # |
bc44d920 | 48 | # Update dependencies (without system header dependencies...) |
bd7854cb | 49 | # |
50 | ||
51 | depend: | |
12f89d24 | 52 | $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies |
bd7854cb | 53 | |
54 | ||
ef416fc2 | 55 | # |
50fe7201 | 56 | # Install all targets... |
ef416fc2 | 57 | # |
58 | ||
50fe7201 MS |
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) | |
ed486911 | 67 | |
68 | install-languages: | |
bd7854cb | 69 | $(INSTALL_DIR) -m 755 $(LOCALEDIR) |
fe0d6115 | 70 | for loc in en $(LANGUAGES) ; do \ |
89d46774 | 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 ; \ | |
ef416fc2 | 75 | done |
76 | ||
fe0d6115 | 77 | install-langbundle: cups.strings |
e4b72d7e MS |
78 | $(INSTALL_DIR) -m 755 "$(BUILDROOT)$(RESOURCEDIR)" |
79 | $(INSTALL_DATA) cups.strings "$(BUILDROOT)$(RESOURCEDIR)" | |
0837b7e8 | 80 | |
ef416fc2 | 81 | |
50fe7201 MS |
82 | # |
83 | # Install programs... | |
84 | # | |
85 | ||
86 | install-exec: | |
87 | ||
88 | ||
89 | # | |
90 | # Install headers... | |
91 | # | |
92 | ||
93 | install-headers: | |
94 | ||
95 | ||
96 | # | |
97 | # Install libraries... | |
98 | # | |
99 | ||
100 | install-libs: | |
101 | ||
102 | ||
757d2cad | 103 | # |
104 | # Uninstall files... | |
105 | # | |
106 | ||
ed486911 | 107 | uninstall: $(UNINSTALL_LANGUAGES) |
108 | ||
109 | uninstall-languages: | |
fe0d6115 | 110 | -for loc in en $(LANGUAGES) ; do \ |
757d2cad | 111 | $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \ |
757d2cad | 112 | done |
757d2cad | 113 | |
0837b7e8 | 114 | uninstall-langbundle: |
e4b72d7e | 115 | $(RM) "$(BUILDROOT)$(RESOURCEDIR)/cups.strings" |
0837b7e8 | 116 | |
757d2cad | 117 | |
ef416fc2 | 118 | # |
0837b7e8 MS |
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. | |
ef416fc2 | 122 | # |
123 | ||
0837b7e8 | 124 | pot: checkpo po2strings |
ef416fc2 | 125 | echo Updating cups.pot... |
bc44d920 | 126 | mv cups.pot cups.pot.bck |
127 | touch cups.pot | |
84315f46 | 128 | cd ..; xgettext -o locale/cups.pot -cTRANSLATORS -s \ |
fe0d6115 | 129 | --keyword=_ --no-wrap --from-code utf-8 \ |
61cf44e2 | 130 | --copyright-holder="Apple Inc." \ |
44b3f161 MS |
131 | --package-name="CUPS" --package-version="$(CUPS_VERSION)" \ |
132 | --msgid-bugs-address="https://github.com/apple/cups/issues" \ | |
61cf44e2 | 133 | */*.c */*.cxx |
fe0d6115 | 134 | (cat cups.header; tail +6 cups.pot) > cups.pot.N |
ef416fc2 | 135 | mv cups.pot.N cups.pot |
0837b7e8 MS |
136 | echo Checking cups.pot... |
137 | ./checkpo cups.pot | |
dcb445bc | 138 | for loc in *.po ; do \ |
bb0d23b2 MS |
139 | if test $$loc = '*.po'; then \ |
140 | break; \ | |
141 | fi; \ | |
dcb445bc MS |
142 | echo Merging changes into $$loc... ; \ |
143 | msgmerge -o $$loc -s -N --no-location $$loc cups.pot ; \ | |
ef416fc2 | 144 | done |
0837b7e8 | 145 | echo Updating cups.strings... |
fe0d6115 MS |
146 | ./po2strings cups_en.po cups.strings |
147 | ||
148 | cups.strings: cups_en.po po2strings | |
149 | echo Updating cups.strings... | |
150 | ./po2strings cups_en.po cups.strings | |
ef416fc2 | 151 | |
152 | ||
db1f069b MS |
153 | # |
154 | # checkpo - A simple utility to check PO files for correct translation | |
8b116e60 | 155 | # strings. Dependency on static library is deliberate. |
db1f069b MS |
156 | # |
157 | # checkpo filename.po [... filenameN.po] | |
158 | # | |
159 | ||
6d2f911b | 160 | checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC) |
ed26f50f | 161 | echo Linking $@... |
a621d151 | 162 | $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \ |
229681c1 | 163 | ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ |
b94f7488 | 164 | $(COMMONLIBS) $(LIBZ) |
00dbe99f | 165 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
db1f069b | 166 | |
f0ab5bff | 167 | checkall: checkpo |
6d086e08 | 168 | ./checkpo *.po *.strings |
f0ab5bff | 169 | |
db1f069b | 170 | |
bc44d920 | 171 | # |
172 | # po2strings - A simple utility which uses iconv to convert GNU gettext | |
8072030b | 173 | # message catalogs to macOS .strings files. |
bc44d920 | 174 | # |
175 | # po2strings filename.po filename.strings | |
176 | # | |
177 | ||
6d2f911b | 178 | po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC) |
ed26f50f | 179 | echo Linking $@... |
a621d151 | 180 | $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \ |
229681c1 | 181 | ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ |
b94f7488 | 182 | $(COMMONLIBS) $(LIBZ) |
00dbe99f | 183 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
bc44d920 | 184 | |
185 | ||
186 | # | |
8072030b | 187 | # strings2po - A simple utility which uses iconv to convert macOS .strings files |
f3c17241 | 188 | # to GNU gettext message catalogs. |
bc44d920 | 189 | # |
190 | # strings2po filename.strings filename.po | |
191 | # | |
192 | ||
193 | strings2po: strings2po.o | |
ed26f50f | 194 | echo Linking $@... |
a621d151 | 195 | $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o |
00dbe99f | 196 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
bc44d920 | 197 | |
198 | ||
bc44d920 | 199 | # |
200 | # Dependencies... | |
201 | # | |
321d8d57 | 202 | |
bc44d920 | 203 | include Dependencies |