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