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