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