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