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