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