]> git.ipfire.org Git - thirdparty/cups.git/blob - locale/Makefile
Add code signing for macOS Mojave.
[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 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 $(INSTALL_DIR) -m 755 $(LOCALEDIR)/en
76 $(INSTALL_DATA) cups.pot $(LOCALEDIR)/en/cups_en.po
77
78 install-langbundle: po2strings
79 $(INSTALL_DIR) -m 755 "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
80 $(INSTALL_DATA) cups.strings "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj"
81
82
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
104 #
105 # Uninstall files...
106 #
107
108 uninstall: $(UNINSTALL_LANGUAGES)
109
110 uninstall-languages:
111 -for loc in $(LANGUAGES) ; do \
112 $(RM) $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
113 done
114
115 uninstall-langbundle:
116 $(RM) "$(BUILDROOT)$(BUNDLEDIR)/Resources/English.lproj/cups.strings"
117
118
119 #
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.
123 #
124
125 pot: checkpo po2strings
126 echo Updating cups.pot...
127 mv cups.pot cups.pot.bck
128 touch cups.pot
129 cd ..; xgettext -o locale/cups.pot -cTRANSLATORS -s \
130 --keyword=_ --no-wrap \
131 --copyright-holder="Apple Inc." \
132 --package-name="CUPS" --package-version="$(CUPS_VERSION)" \
133 --msgid-bugs-address="https://github.com/apple/cups/issues" \
134 */*.c */*.cxx
135 (cat cups.header; tail +6 cups.pot; cat cups.footer) > cups.pot.N
136 mv cups.pot.N cups.pot
137 echo Checking cups.pot...
138 ./checkpo cups.pot
139 for loc in *.po ; do \
140 if test $$loc = '*.po'; then \
141 break; \
142 fi; \
143 echo Merging changes into $$loc... ; \
144 msgmerge -o $$loc -s -N --no-location $$loc cups.pot ; \
145 done
146 echo Updating cups.strings...
147 ./po2strings cups.pot cups.strings
148
149
150 #
151 # checkpo - A simple utility to check PO files for correct translation
152 # strings. Dependency on static library is deliberate.
153 #
154 # checkpo filename.po [... filenameN.po]
155 #
156
157 checkpo: checkpo.o ../cups/$(LIBCUPSSTATIC)
158 echo Linking $@...
159 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o checkpo checkpo.o \
160 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
161 $(COMMONLIBS) $(LIBZ)
162 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
163
164 checkall: checkpo
165 ./checkpo *.po *.strings
166
167
168 #
169 # po2strings - A simple utility which uses iconv to convert GNU gettext
170 # message catalogs to macOS .strings files.
171 #
172 # po2strings filename.po filename.strings
173 #
174
175 po2strings: po2strings.o ../cups/$(LIBCUPSSTATIC)
176 echo Linking $@...
177 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o po2strings po2strings.o \
178 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
179 $(COMMONLIBS) $(LIBZ)
180 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
181
182
183 #
184 # strings2po - A simple utility which uses iconv to convert macOS .strings files
185 # to GNU gettext message catalogs.
186 #
187 # strings2po filename.strings filename.po
188 #
189
190 strings2po: strings2po.o
191 echo Linking $@...
192 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o strings2po strings2po.o
193 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
194
195
196 #
197 # Dependencies...
198 #
199
200 include Dependencies