Commit | Line | Data |
---|---|---|
63999a7d | 1 | # -*- Makefile -*- for GNU Emacs on the Microsoft Windows API. |
ab422c4d | 2 | # Copyright (C) 2011-2013 Free Software Foundation, Inc. |
f915f0f7 EZ |
3 | |
4 | # This file is part of GNU Emacs. | |
5 | ||
6 | # GNU Emacs is free software: you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation, either version 3 of the License, or | |
9 | # (at your option) any later version. | |
10 | ||
11 | # GNU Emacs is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | ||
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | ALL = gnulib | |
20 | ||
21 | .PHONY: $(ALL) | |
22 | ||
cf38a720 | 23 | LOCAL_FLAGS = -I. -I../nt/inc -I../src |
f915f0f7 EZ |
24 | LIBS = |
25 | ||
ffdc270a PE |
26 | GNULIBOBJS = $(BLD)/acl-errno-valid.$(O) \ |
27 | $(BLD)/c-ctype.$(O) \ | |
07adc2c6 JB |
28 | $(BLD)/c-strcasecmp.$(O) \ |
29 | $(BLD)/c-strncasecmp.$(O) \ | |
3a7089c1 | 30 | $(BLD)/close-stream.$(O) \ |
07adc2c6 | 31 | $(BLD)/dtoastr.$(O) \ |
388cdec0 | 32 | $(BLD)/dtotimespec.$(O) \ |
391ceac5 | 33 | $(BLD)/execinfo.$(O) \ |
3a7089c1 | 34 | $(BLD)/fpending.$(O) \ |
70b0d280 EZ |
35 | $(BLD)/getopt.$(O) \ |
36 | $(BLD)/getopt1.$(O) \ | |
388cdec0 | 37 | $(BLD)/gettime.$(O) \ |
8c0905ac | 38 | $(BLD)/memrchr.$(O) \ |
70b0d280 | 39 | $(BLD)/strftime.$(O) \ |
32159fc3 | 40 | $(BLD)/time_r.$(O) \ |
388cdec0 EZ |
41 | $(BLD)/timespec-add.$(O) \ |
42 | $(BLD)/timespec-sub.$(O) \ | |
25c51af3 | 43 | $(BLD)/md5.$(O) \ |
13c3daa4 | 44 | $(BLD)/sha1.$(O) \ |
3ce9d0d4 LL |
45 | $(BLD)/sha256.$(O) \ |
46 | $(BLD)/sha512.$(O) \ | |
d983a10b | 47 | $(BLD)/sig2str.$(O) \ |
fddc1855 EZ |
48 | $(BLD)/stat-time.$(O) \ |
49 | $(BLD)/timespec.$(O) \ | |
50 | $(BLD)/u64.$(O) \ | |
973f782d | 51 | $(BLD)/filemode.$(O) |
f915f0f7 EZ |
52 | |
53 | # | |
54 | # Build the library | |
55 | # | |
56 | $(BLD)/libgnu.$(A): $(GNULIBOBJS) | |
57 | - $(DEL) $@ | |
58 | $(AR) $(AR_OUT)$@ $(ALL_DEPS) | |
59 | ||
d67a9a85 | 60 | gnulib: $(BLD)/libgnu.$(A) |
f915f0f7 EZ |
61 | |
62 | # | |
63 | # Build everything | |
64 | # | |
d67a9a85 | 65 | all: $(ALL) |
f915f0f7 EZ |
66 | |
67 | ### TAGS ### | |
68 | ||
a6fc3b5c EZ |
69 | FRC: |
70 | ||
71 | TAGS: FRC | |
f915f0f7 EZ |
72 | ../lib-src/$(BLD)/etags.exe *.c *.h |
73 | ||
74 | ### DEPENDENCIES ### | |
75 | ||
76 | EMACS_ROOT = .. | |
52331d2c JB |
77 | GNU_LIB = . |
78 | SRC = $(EMACS_ROOT)/src | |
79 | NT_INC = $(EMACS_ROOT)/nt/inc | |
80 | ||
86cec478 JB |
81 | ACL_H = $(GNU_LIB)/acl.h \ |
82 | $(NT_INC)/sys/stat.h \ | |
83 | $(NT_INC)/stdbool.h | |
52331d2c JB |
84 | C_CTYPE_H = $(GNU_LIB)/c-ctype.h \ |
85 | $(NT_INC)/stdbool.h | |
837b365b | 86 | MS_W32_H = $(NT_INC)/ms-w32.h \ |
52331d2c | 87 | $(NT_INC)/sys/stat.h |
552a99b4 | 88 | CONF_POST_H = $(SRC)/conf_post.h \ |
52331d2c | 89 | $(MS_W32_H) |
552a99b4 JB |
90 | CONFIG_H = $(SRC)/config.h \ |
91 | $(CONF_POST_H) | |
52331d2c JB |
92 | FILEMODE_H = $(GNU_LIB)/filemode.h \ |
93 | $(NT_INC)/sys/stat.h | |
94 | FTOASTR_H = $(GNU_LIB)/ftoastr.h \ | |
95 | $(GNU_LIB)/intprops.h | |
96 | FTOASTR_C = $(GNU_LIB)/ftoastr.c \ | |
97 | $(CONFIG_H) \ | |
57239922 | 98 | $(FTOASTR_H) |
52331d2c JB |
99 | GETOPT_INT_H = $(GNU_LIB)/getopt_int.h \ |
100 | $(GNU_LIB)/getopt.h | |
101 | MD5_H = $(GNU_LIB)/md5.h \ | |
102 | $(NT_INC)/stdint.h | |
103 | SHA1_H = $(GNU_LIB)/sha1.h \ | |
104 | $(NT_INC)/stdint.h | |
105 | SHA256_H = $(GNU_LIB)/sha256.h \ | |
106 | $(NT_INC)/stdint.h | |
107 | U64_H = $(GNU_LIB)/u64.h \ | |
108 | $(NT_INC)/stdint.h | |
109 | SHA512_H = $(GNU_LIB)/sha512.h \ | |
fddc1855 | 110 | $(U64_H) |
0eeb69fe JB |
111 | SIG2STR_H = $(GNU_LIB)/sig2str.h \ |
112 | $(GNU_LIB)/intprops.h | |
57239922 JB |
113 | STAT_TIME_H = $(GNU_LIB)/stat-time.h \ |
114 | $(NT_INC)/sys/stat.h | |
f915f0f7 | 115 | |
ffdc270a PE |
116 | $(BLD)/acl-errno-valid.$(O) : \ |
117 | $(GNU_LIB)/acl-errno-valid.c \ | |
86cec478 JB |
118 | $(ACL_H) \ |
119 | $(CONFIG_H) | |
ffdc270a | 120 | |
07adc2c6 | 121 | $(BLD)/c-ctype.$(O) : \ |
52331d2c JB |
122 | $(GNU_LIB)/c-ctype.c \ |
123 | $(CONFIG_H) \ | |
124 | $(C_CTYPE_H) | |
07adc2c6 JB |
125 | |
126 | $(BLD)/c-strcasecmp.$(O) : \ | |
52331d2c JB |
127 | $(GNU_LIB)/c-strcasecmp.c \ |
128 | $(GNU_LIB)/c-strcase.h \ | |
129 | $(CONFIG_H) \ | |
130 | $(C_CTYPE_H) | |
07adc2c6 | 131 | |
39661382 JB |
132 | $(BLD)/c-strncasecmp.$(O) : \ |
133 | $(GNU_LIB)/c-strncasecmp.c \ | |
134 | $(GNU_LIB)/c-strcase.h \ | |
135 | $(CONFIG_H) \ | |
136 | $(C_CTYPE_H) | |
137 | ||
3a7089c1 EZ |
138 | $(BLD)/close-stream.$(O) : \ |
139 | $(GNU_LIB)/close-stream.c \ | |
140 | $(GNU_LIB)/close-stream.h \ | |
141 | $(GNU_LIB)/fpending.h \ | |
142 | $(NT_INC)/stdbool.h \ | |
143 | $(CONFIG_H) | |
144 | ||
f915f0f7 | 145 | $(BLD)/dtoastr.$(O) : \ |
52331d2c JB |
146 | $(GNU_LIB)/dtoastr.c \ |
147 | $(FTOASTR_C) | |
f915f0f7 | 148 | |
388cdec0 | 149 | $(BLD)/dtotimespec.$(O) : \ |
52331d2c JB |
150 | $(GNU_LIB)/dtotimespec.c \ |
151 | $(GNU_LIB)/intprops.h \ | |
152 | $(GNU_LIB)/timespec.h \ | |
153 | $(CONFIG_H) | |
388cdec0 | 154 | |
391ceac5 | 155 | $(BLD)/execinfo.$(O) : \ |
f0602979 JB |
156 | $(GNU_LIB)/execinfo.c \ |
157 | $(GNU_LIB)/execinfo.h \ | |
158 | $(CONFIG_H) | |
391ceac5 | 159 | |
3a7089c1 EZ |
160 | $(BLD)/fpending.$(O) : \ |
161 | $(GNU_LIB)/fpending.c \ | |
162 | $(GNU_LIB)/fpending.h \ | |
163 | $(CONFIG_H) | |
164 | ||
f915f0f7 | 165 | $(BLD)/getopt.$(O) : \ |
52331d2c JB |
166 | $(GNU_LIB)/getopt.c \ |
167 | $(GNU_LIB)/getopt.h \ | |
168 | $(GNU_LIB)/gettext.h \ | |
169 | $(NT_INC)/unistd.h \ | |
170 | $(CONFIG_H) \ | |
171 | $(GETOPT_INT_H) | |
f915f0f7 EZ |
172 | |
173 | $(BLD)/getopt1.$(O) : \ | |
52331d2c JB |
174 | $(GNU_LIB)/getopt1.c \ |
175 | $(GNU_LIB)/getopt.h \ | |
176 | $(CONFIG_H) \ | |
177 | $(GETOPT_INT_H) | |
f915f0f7 | 178 | |
388cdec0 | 179 | $(BLD)/gettime.$(O) : \ |
52331d2c JB |
180 | $(GNU_LIB)/gettime.c \ |
181 | $(GNU_LIB)/timespec.h \ | |
182 | $(NT_INC)/sys/time.h \ | |
183 | $(CONFIG_H) | |
388cdec0 | 184 | |
70b0d280 | 185 | $(BLD)/strftime.$(O) : \ |
52331d2c JB |
186 | $(GNU_LIB)/strftime.c \ |
187 | $(GNU_LIB)/strftime.h \ | |
188 | $(NT_INC)/stdbool.h \ | |
189 | $(CONFIG_H) | |
70b0d280 EZ |
190 | |
191 | $(BLD)/time_r.$(O) : \ | |
52331d2c JB |
192 | $(GNU_LIB)/time_r.c \ |
193 | $(CONFIG_H) | |
70b0d280 | 194 | |
388cdec0 | 195 | $(BLD)/timespec-add.$(O) : \ |
52331d2c JB |
196 | $(GNU_LIB)/timespec-add.c \ |
197 | $(GNU_LIB)/intprops.h \ | |
198 | $(GNU_LIB)/timespec.h \ | |
199 | $(CONFIG_H) | |
388cdec0 EZ |
200 | |
201 | $(BLD)/timespec-sub.$(O) : \ | |
52331d2c JB |
202 | $(GNU_LIB)/timespec-sub.c \ |
203 | $(GNU_LIB)/intprops.h \ | |
204 | $(GNU_LIB)/timespec.h \ | |
205 | $(CONFIG_H) | |
388cdec0 | 206 | |
32159fc3 | 207 | $(BLD)/md5.$(O) : \ |
52331d2c JB |
208 | $(GNU_LIB)/md5.c \ |
209 | $(NT_INC)/stdalign.h \ | |
210 | $(NT_INC)/stdint.h \ | |
211 | $(CONFIG_H) \ | |
212 | $(MD5_H) | |
25c51af3 | 213 | |
8c0905ac EZ |
214 | $(BLD)/memrchr.$(O) : \ |
215 | $(GNU_LIB)/memrchr.c \ | |
216 | $(CONFIG_H) | |
217 | ||
13c3daa4 | 218 | $(BLD)/sha1.$(O) : \ |
52331d2c JB |
219 | $(GNU_LIB)/sha1.c \ |
220 | $(NT_INC)/stdalign.h \ | |
221 | $(NT_INC)/stdint.h \ | |
222 | $(CONFIG_H) \ | |
223 | $(SHA1_H) | |
13c3daa4 | 224 | |
3ce9d0d4 | 225 | $(BLD)/sha256.$(O) : \ |
52331d2c JB |
226 | $(GNU_LIB)/sha256.c \ |
227 | $(NT_INC)/stdalign.h \ | |
228 | $(NT_INC)/stdint.h \ | |
229 | $(CONFIG_H) \ | |
230 | $(SHA256_H) | |
3ce9d0d4 LL |
231 | |
232 | $(BLD)/sha512.$(O) : \ | |
52331d2c JB |
233 | $(GNU_LIB)/sha512.c \ |
234 | $(NT_INC)/stdalign.h \ | |
235 | $(NT_INC)/stdint.h \ | |
236 | $(CONFIG_H) \ | |
237 | $(SHA512_H) | |
3ce9d0d4 | 238 | |
fddc1855 | 239 | $(BLD)/stat-time.$(O) : \ |
57239922 JB |
240 | $(GNU_LIB)/stat-time.c \ |
241 | $(CONFIG_H) \ | |
242 | $(STAT_TIME_H) | |
fddc1855 EZ |
243 | |
244 | $(BLD)/timespec.$(O) : \ | |
57239922 | 245 | $(GNU_LIB)/timespec.c \ |
fddc1855 EZ |
246 | $(GNU_LIB)/timespec.h \ |
247 | $(CONFIG_H) | |
248 | ||
249 | $(BLD)/u64.$(O) : \ | |
57239922 JB |
250 | $(GNU_LIB)/u64.c \ |
251 | $(CONFIG_H) \ | |
252 | $(U64_H) | |
fddc1855 | 253 | |
25c51af3 | 254 | $(BLD)/filemode.$(O) : \ |
52331d2c JB |
255 | $(GNU_LIB)/filemode.c \ |
256 | $(CONFIG_H) \ | |
257 | $(FILEMODE_H) | |
32159fc3 | 258 | |
63999a7d EZ |
259 | $(BLD)/sig2str.$(O) : \ |
260 | $(GNU_LIB)/sig2str.c \ | |
261 | $(CONFIG_H) \ | |
0eeb69fe | 262 | $(SIG2STR_H) |
63999a7d EZ |
263 | |
264 | ||
f915f0f7 EZ |
265 | # The following dependencies are for supporting parallel builds, where |
266 | # we must make sure $(BLD) exists before any compilation starts. | |
267 | # | |
cc06e7e7 | 268 | $(GNULIBOBJS): stamp_BLD |
f915f0f7 EZ |
269 | |
270 | # | |
271 | # Headers we would preprocess if we could. | |
272 | # | |
273 | getopt.h: getopt_.h | |
274 | $(CP) $(ALL_DEPS) $@ | |
275 | ||
276 | # | |
277 | # Maintenance | |
278 | # | |
279 | clean: | |
280 | - $(DEL) $(COMPILER_TEMP_FILES) | |
281 | - $(DEL) getopt.h | |
282 | - $(DEL_TREE) $(OBJDIR) | |
283 | - $(DEL) stamp_BLD | |
284 | ||
285 | distclean: cleanall | |
286 | - $(DEL) TAGS | |
287 | - $(DEL) Makefile | |
288 | ||
289 | maintainer-clean: distclean | |
290 | - $(DEL) getopt_.h | |
291 | ||
292 | cleanall: clean | |
293 | - $(DEL_TREE) obj | |
294 | - $(DEL_TREE) obj-spd | |
295 | - $(DEL_TREE) oo | |
296 | - $(DEL_TREE) oo-spd | |
297 | ||
298 | # A dummy target to force other targets to be evaluated. | |
299 | doit: | |
300 | ||
301 | getopt_.h: getopt.in.h $(ARG_NONNULL_H) | |
302 | $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE) | |
303 | ||
304 | getopt_.h-CMD: doit | |
305 | @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h. | |
306 | @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory. | |
307 | @echo You will need GNU Sed to be installed. | |
308 | exit -1 | |
309 | ||
310 | getopt_.h-SH: doit | |
311 | @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h. | |
312 | @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory. | |
313 | @echo You will need GNU Sed to be installed. | |
314 | exit -1 | |
315 | ||
316 | # Generating getopt_.h from getopt.in.h. | |
317 | # | |
318 | # To avoid requiring all end users to install Sed, we have below | |
319 | # a maintainer-only target that produces getopt_.h from getopt.in.h. | |
320 | # For easier maintenance, all the strings that replace the @FOO@ | |
321 | # placeholder are defined as Make macros below. | |
322 | ||
323 | HAVE_GETOPT_H = HAVE_GETOPT_H | |
324 | INCLUDE_NEXT = include_next | |
f915f0f7 EZ |
325 | PRAGMA_COLUMNS = |
326 | NEXT_GETOPT_H = <getopt.h> | |
24e0f6b1 | 327 | ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h |
f915f0f7 EZ |
328 | |
329 | getopt_h: | |
330 | - $(DEL) getopt_.h-t getopt_.h | |
6a3e57bb PE |
331 | sed -e "s!@GUARD_PREFIX@!GL!g" \ |
332 | -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \ | |
f915f0f7 EZ |
333 | -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \ |
334 | -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \ | |
335 | -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \ | |
336 | -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \ | |
337 | -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \ | |
338 | -e "/^\# include_next/i # ifndef __GNUC__" \ | |
339 | -e "/^\# include_next/i # include <next_getopt.h>" \ | |
340 | -e "/^\# include_next/i # else" \ | |
341 | -e "/^\# include_next/a # endif" \ | |
342 | < getopt.in.h > getopt_.h-t | |
343 | $(CP) getopt_.h-t getopt_.h | |
344 | - $(DEL) getopt_.h-t | |
391ceac5 EZ |
345 | |
346 | execinfo.h: execinfo.in.h | |
347 | $(CP) execinfo.in.h $@ |