]> code.delx.au - gnu-emacs/blob - lib/makefile.w32-in
Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca
[gnu-emacs] / lib / makefile.w32-in
1 # -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
2 # Copyright (C) 2011-2013 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 SIG2STR_H = $(GNU_LIB)/sig2str.h \
107 $(GNU_LIB)/intprops.h
108 STAT_TIME_H = $(GNU_LIB)/stat-time.h \
109 $(NT_INC)/sys/stat.h
110
111 $(BLD)/c-ctype.$(O) : \
112 $(GNU_LIB)/c-ctype.c \
113 $(CONFIG_H) \
114 $(C_CTYPE_H)
115
116 $(BLD)/c-strcasecmp.$(O) : \
117 $(GNU_LIB)/c-strcasecmp.c \
118 $(GNU_LIB)/c-strcase.h \
119 $(CONFIG_H) \
120 $(C_CTYPE_H)
121
122 $(BLD)/c-strncasecmp.$(O) : \
123 $(GNU_LIB)/c-strncasecmp.c \
124 $(GNU_LIB)/c-strcase.h \
125 $(CONFIG_H) \
126 $(C_CTYPE_H)
127
128 $(BLD)/close-stream.$(O) : \
129 $(GNU_LIB)/close-stream.c \
130 $(GNU_LIB)/close-stream.h \
131 $(GNU_LIB)/fpending.h \
132 $(NT_INC)/stdbool.h \
133 $(CONFIG_H)
134
135 $(BLD)/dtoastr.$(O) : \
136 $(GNU_LIB)/dtoastr.c \
137 $(FTOASTR_C)
138
139 $(BLD)/dtotimespec.$(O) : \
140 $(GNU_LIB)/dtotimespec.c \
141 $(GNU_LIB)/intprops.h \
142 $(GNU_LIB)/timespec.h \
143 $(CONFIG_H)
144
145 $(BLD)/execinfo.$(O) : \
146 $(GNU_LIB)/execinfo.c \
147 $(GNU_LIB)/execinfo.h \
148 $(CONFIG_H)
149
150 $(BLD)/fpending.$(O) : \
151 $(GNU_LIB)/fpending.c \
152 $(GNU_LIB)/fpending.h \
153 $(CONFIG_H)
154
155 $(BLD)/getopt.$(O) : \
156 $(GNU_LIB)/getopt.c \
157 $(GNU_LIB)/getopt.h \
158 $(GNU_LIB)/gettext.h \
159 $(NT_INC)/unistd.h \
160 $(CONFIG_H) \
161 $(GETOPT_INT_H)
162
163 $(BLD)/getopt1.$(O) : \
164 $(GNU_LIB)/getopt1.c \
165 $(GNU_LIB)/getopt.h \
166 $(CONFIG_H) \
167 $(GETOPT_INT_H)
168
169 $(BLD)/gettime.$(O) : \
170 $(GNU_LIB)/gettime.c \
171 $(GNU_LIB)/timespec.h \
172 $(NT_INC)/sys/time.h \
173 $(CONFIG_H)
174
175 $(BLD)/strftime.$(O) : \
176 $(GNU_LIB)/strftime.c \
177 $(GNU_LIB)/strftime.h \
178 $(NT_INC)/stdbool.h \
179 $(CONFIG_H)
180
181 $(BLD)/time_r.$(O) : \
182 $(GNU_LIB)/time_r.c \
183 $(CONFIG_H)
184
185 $(BLD)/timespec-add.$(O) : \
186 $(GNU_LIB)/timespec-add.c \
187 $(GNU_LIB)/intprops.h \
188 $(GNU_LIB)/timespec.h \
189 $(CONFIG_H)
190
191 $(BLD)/timespec-sub.$(O) : \
192 $(GNU_LIB)/timespec-sub.c \
193 $(GNU_LIB)/intprops.h \
194 $(GNU_LIB)/timespec.h \
195 $(CONFIG_H)
196
197 $(BLD)/md5.$(O) : \
198 $(GNU_LIB)/md5.c \
199 $(NT_INC)/stdalign.h \
200 $(NT_INC)/stdint.h \
201 $(CONFIG_H) \
202 $(MD5_H)
203
204 $(BLD)/sha1.$(O) : \
205 $(GNU_LIB)/sha1.c \
206 $(NT_INC)/stdalign.h \
207 $(NT_INC)/stdint.h \
208 $(CONFIG_H) \
209 $(SHA1_H)
210
211 $(BLD)/sha256.$(O) : \
212 $(GNU_LIB)/sha256.c \
213 $(NT_INC)/stdalign.h \
214 $(NT_INC)/stdint.h \
215 $(CONFIG_H) \
216 $(SHA256_H)
217
218 $(BLD)/sha512.$(O) : \
219 $(GNU_LIB)/sha512.c \
220 $(NT_INC)/stdalign.h \
221 $(NT_INC)/stdint.h \
222 $(CONFIG_H) \
223 $(SHA512_H)
224
225 $(BLD)/stat-time.$(O) : \
226 $(GNU_LIB)/stat-time.c \
227 $(CONFIG_H) \
228 $(STAT_TIME_H)
229
230 $(BLD)/timespec.$(O) : \
231 $(GNU_LIB)/timespec.c \
232 $(GNU_LIB)/timespec.h \
233 $(CONFIG_H)
234
235 $(BLD)/u64.$(O) : \
236 $(GNU_LIB)/u64.c \
237 $(CONFIG_H) \
238 $(U64_H)
239
240 $(BLD)/filemode.$(O) : \
241 $(GNU_LIB)/filemode.c \
242 $(CONFIG_H) \
243 $(FILEMODE_H)
244
245 $(BLD)/sig2str.$(O) : \
246 $(GNU_LIB)/sig2str.c \
247 $(CONFIG_H) \
248 $(SIG2STR_H)
249
250
251 # The following dependencies are for supporting parallel builds, where
252 # we must make sure $(BLD) exists before any compilation starts.
253 #
254 $(GNULIBOBJS): stamp_BLD
255
256 #
257 # Headers we would preprocess if we could.
258 #
259 getopt.h: getopt_.h
260 $(CP) $(ALL_DEPS) $@
261
262 #
263 # Maintenance
264 #
265 clean:
266 - $(DEL) $(COMPILER_TEMP_FILES)
267 - $(DEL) getopt.h
268 - $(DEL_TREE) $(OBJDIR)
269 - $(DEL) stamp_BLD
270
271 distclean: cleanall
272 - $(DEL) TAGS
273 - $(DEL) Makefile
274
275 maintainer-clean: distclean
276 - $(DEL) getopt_.h
277
278 cleanall: clean
279 - $(DEL_TREE) obj
280 - $(DEL_TREE) obj-spd
281 - $(DEL_TREE) oo
282 - $(DEL_TREE) oo-spd
283
284 # A dummy target to force other targets to be evaluated.
285 doit:
286
287 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
288 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
289
290 getopt_.h-CMD: doit
291 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
292 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
293 @echo You will need GNU Sed to be installed.
294 exit -1
295
296 getopt_.h-SH: doit
297 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
298 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
299 @echo You will need GNU Sed to be installed.
300 exit -1
301
302 # Generating getopt_.h from getopt.in.h.
303 #
304 # To avoid requiring all end users to install Sed, we have below
305 # a maintainer-only target that produces getopt_.h from getopt.in.h.
306 # For easier maintenance, all the strings that replace the @FOO@
307 # placeholder are defined as Make macros below.
308
309 HAVE_GETOPT_H = HAVE_GETOPT_H
310 INCLUDE_NEXT = include_next
311 PRAGMA_COLUMNS =
312 NEXT_GETOPT_H = <getopt.h>
313 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
314
315 getopt_h:
316 - $(DEL) getopt_.h-t getopt_.h
317 sed -e "s!@GUARD_PREFIX@!GL!g" \
318 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
319 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
320 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
321 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
322 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
323 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
324 -e "/^\# include_next/i # ifndef __GNUC__" \
325 -e "/^\# include_next/i # include <next_getopt.h>" \
326 -e "/^\# include_next/i # else" \
327 -e "/^\# include_next/a # endif" \
328 < getopt.in.h > getopt_.h-t
329 $(CP) getopt_.h-t getopt_.h
330 - $(DEL) getopt_.h-t
331
332 execinfo.h: execinfo.in.h
333 $(CP) execinfo.in.h $@