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