src/makefile.w32-in (ACL_H): New macro.
[bpt/emacs.git] / lib / makefile.w32-in
CommitLineData
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
19ALL = gnulib
20
21.PHONY: $(ALL)
22
cf38a720 23LOCAL_FLAGS = -I. -I../nt/inc -I../src
f915f0f7
EZ
24LIBS =
25
ffdc270a
PE
26GNULIBOBJS = $(BLD)/acl-errno-valid.$(O) \
27 $(BLD)/c-ctype.$(O) \
07adc2c6
JB
28 $(BLD)/c-strcasecmp.$(O) \
29 $(BLD)/c-strncasecmp.$(O) \
3a7089c1 30 $(BLD)/close-stream.$(O) \
07adc2c6 31 $(BLD)/dtoastr.$(O) \
388cdec0 32 $(BLD)/dtotimespec.$(O) \
391ceac5 33 $(BLD)/execinfo.$(O) \
3a7089c1 34 $(BLD)/fpending.$(O) \
70b0d280
EZ
35 $(BLD)/getopt.$(O) \
36 $(BLD)/getopt1.$(O) \
388cdec0 37 $(BLD)/gettime.$(O) \
8c0905ac 38 $(BLD)/memrchr.$(O) \
70b0d280 39 $(BLD)/strftime.$(O) \
32159fc3 40 $(BLD)/time_r.$(O) \
388cdec0
EZ
41 $(BLD)/timespec-add.$(O) \
42 $(BLD)/timespec-sub.$(O) \
25c51af3 43 $(BLD)/md5.$(O) \
13c3daa4 44 $(BLD)/sha1.$(O) \
3ce9d0d4
LL
45 $(BLD)/sha256.$(O) \
46 $(BLD)/sha512.$(O) \
d983a10b 47 $(BLD)/sig2str.$(O) \
fddc1855
EZ
48 $(BLD)/stat-time.$(O) \
49 $(BLD)/timespec.$(O) \
50 $(BLD)/u64.$(O) \
973f782d 51 $(BLD)/filemode.$(O)
f915f0f7
EZ
52
53#
54# Build the library
55#
56$(BLD)/libgnu.$(A): $(GNULIBOBJS)
57 - $(DEL) $@
58 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
59
d67a9a85 60gnulib: $(BLD)/libgnu.$(A)
f915f0f7
EZ
61
62#
63# Build everything
64#
d67a9a85 65all: $(ALL)
f915f0f7
EZ
66
67### TAGS ###
68
a6fc3b5c
EZ
69FRC:
70
71TAGS: FRC
f915f0f7
EZ
72 ../lib-src/$(BLD)/etags.exe *.c *.h
73
74### DEPENDENCIES ###
75
76EMACS_ROOT = ..
52331d2c
JB
77GNU_LIB = .
78SRC = $(EMACS_ROOT)/src
79NT_INC = $(EMACS_ROOT)/nt/inc
80
81C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
82 $(NT_INC)/stdbool.h
837b365b 83MS_W32_H = $(NT_INC)/ms-w32.h \
52331d2c 84 $(NT_INC)/sys/stat.h
552a99b4 85CONF_POST_H = $(SRC)/conf_post.h \
52331d2c 86 $(MS_W32_H)
552a99b4
JB
87CONFIG_H = $(SRC)/config.h \
88 $(CONF_POST_H)
52331d2c
JB
89FILEMODE_H = $(GNU_LIB)/filemode.h \
90 $(NT_INC)/sys/stat.h
91FTOASTR_H = $(GNU_LIB)/ftoastr.h \
92 $(GNU_LIB)/intprops.h
93FTOASTR_C = $(GNU_LIB)/ftoastr.c \
94 $(CONFIG_H) \
57239922 95 $(FTOASTR_H)
52331d2c
JB
96GETOPT_INT_H = $(GNU_LIB)/getopt_int.h \
97 $(GNU_LIB)/getopt.h
98MD5_H = $(GNU_LIB)/md5.h \
99 $(NT_INC)/stdint.h
100SHA1_H = $(GNU_LIB)/sha1.h \
101 $(NT_INC)/stdint.h
102SHA256_H = $(GNU_LIB)/sha256.h \
103 $(NT_INC)/stdint.h
104U64_H = $(GNU_LIB)/u64.h \
105 $(NT_INC)/stdint.h
106SHA512_H = $(GNU_LIB)/sha512.h \
fddc1855 107 $(U64_H)
0eeb69fe
JB
108SIG2STR_H = $(GNU_LIB)/sig2str.h \
109 $(GNU_LIB)/intprops.h
57239922
JB
110STAT_TIME_H = $(GNU_LIB)/stat-time.h \
111 $(NT_INC)/sys/stat.h
f915f0f7 112
ffdc270a
PE
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
07adc2c6 119$(BLD)/c-ctype.$(O) : \
52331d2c
JB
120 $(GNU_LIB)/c-ctype.c \
121 $(CONFIG_H) \
122 $(C_CTYPE_H)
07adc2c6
JB
123
124$(BLD)/c-strcasecmp.$(O) : \
52331d2c
JB
125 $(GNU_LIB)/c-strcasecmp.c \
126 $(GNU_LIB)/c-strcase.h \
127 $(CONFIG_H) \
128 $(C_CTYPE_H)
07adc2c6 129
39661382
JB
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
3a7089c1
EZ
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
f915f0f7 143$(BLD)/dtoastr.$(O) : \
52331d2c
JB
144 $(GNU_LIB)/dtoastr.c \
145 $(FTOASTR_C)
f915f0f7 146
388cdec0 147$(BLD)/dtotimespec.$(O) : \
52331d2c
JB
148 $(GNU_LIB)/dtotimespec.c \
149 $(GNU_LIB)/intprops.h \
150 $(GNU_LIB)/timespec.h \
151 $(CONFIG_H)
388cdec0 152
391ceac5 153$(BLD)/execinfo.$(O) : \
f0602979
JB
154 $(GNU_LIB)/execinfo.c \
155 $(GNU_LIB)/execinfo.h \
156 $(CONFIG_H)
391ceac5 157
3a7089c1
EZ
158$(BLD)/fpending.$(O) : \
159 $(GNU_LIB)/fpending.c \
160 $(GNU_LIB)/fpending.h \
161 $(CONFIG_H)
162
f915f0f7 163$(BLD)/getopt.$(O) : \
52331d2c
JB
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)
f915f0f7
EZ
170
171$(BLD)/getopt1.$(O) : \
52331d2c
JB
172 $(GNU_LIB)/getopt1.c \
173 $(GNU_LIB)/getopt.h \
174 $(CONFIG_H) \
175 $(GETOPT_INT_H)
f915f0f7 176
388cdec0 177$(BLD)/gettime.$(O) : \
52331d2c
JB
178 $(GNU_LIB)/gettime.c \
179 $(GNU_LIB)/timespec.h \
180 $(NT_INC)/sys/time.h \
181 $(CONFIG_H)
388cdec0 182
70b0d280 183$(BLD)/strftime.$(O) : \
52331d2c
JB
184 $(GNU_LIB)/strftime.c \
185 $(GNU_LIB)/strftime.h \
186 $(NT_INC)/stdbool.h \
187 $(CONFIG_H)
70b0d280
EZ
188
189$(BLD)/time_r.$(O) : \
52331d2c
JB
190 $(GNU_LIB)/time_r.c \
191 $(CONFIG_H)
70b0d280 192
388cdec0 193$(BLD)/timespec-add.$(O) : \
52331d2c
JB
194 $(GNU_LIB)/timespec-add.c \
195 $(GNU_LIB)/intprops.h \
196 $(GNU_LIB)/timespec.h \
197 $(CONFIG_H)
388cdec0
EZ
198
199$(BLD)/timespec-sub.$(O) : \
52331d2c
JB
200 $(GNU_LIB)/timespec-sub.c \
201 $(GNU_LIB)/intprops.h \
202 $(GNU_LIB)/timespec.h \
203 $(CONFIG_H)
388cdec0 204
32159fc3 205$(BLD)/md5.$(O) : \
52331d2c
JB
206 $(GNU_LIB)/md5.c \
207 $(NT_INC)/stdalign.h \
208 $(NT_INC)/stdint.h \
209 $(CONFIG_H) \
210 $(MD5_H)
25c51af3 211
8c0905ac
EZ
212$(BLD)/memrchr.$(O) : \
213 $(GNU_LIB)/memrchr.c \
214 $(CONFIG_H)
215
13c3daa4 216$(BLD)/sha1.$(O) : \
52331d2c
JB
217 $(GNU_LIB)/sha1.c \
218 $(NT_INC)/stdalign.h \
219 $(NT_INC)/stdint.h \
220 $(CONFIG_H) \
221 $(SHA1_H)
13c3daa4 222
3ce9d0d4 223$(BLD)/sha256.$(O) : \
52331d2c
JB
224 $(GNU_LIB)/sha256.c \
225 $(NT_INC)/stdalign.h \
226 $(NT_INC)/stdint.h \
227 $(CONFIG_H) \
228 $(SHA256_H)
3ce9d0d4
LL
229
230$(BLD)/sha512.$(O) : \
52331d2c
JB
231 $(GNU_LIB)/sha512.c \
232 $(NT_INC)/stdalign.h \
233 $(NT_INC)/stdint.h \
234 $(CONFIG_H) \
235 $(SHA512_H)
3ce9d0d4 236
fddc1855 237$(BLD)/stat-time.$(O) : \
57239922
JB
238 $(GNU_LIB)/stat-time.c \
239 $(CONFIG_H) \
240 $(STAT_TIME_H)
fddc1855
EZ
241
242$(BLD)/timespec.$(O) : \
57239922 243 $(GNU_LIB)/timespec.c \
fddc1855
EZ
244 $(GNU_LIB)/timespec.h \
245 $(CONFIG_H)
246
247$(BLD)/u64.$(O) : \
57239922
JB
248 $(GNU_LIB)/u64.c \
249 $(CONFIG_H) \
250 $(U64_H)
fddc1855 251
25c51af3 252$(BLD)/filemode.$(O) : \
52331d2c
JB
253 $(GNU_LIB)/filemode.c \
254 $(CONFIG_H) \
255 $(FILEMODE_H)
32159fc3 256
63999a7d
EZ
257$(BLD)/sig2str.$(O) : \
258 $(GNU_LIB)/sig2str.c \
259 $(CONFIG_H) \
0eeb69fe 260 $(SIG2STR_H)
63999a7d
EZ
261
262
f915f0f7
EZ
263# The following dependencies are for supporting parallel builds, where
264# we must make sure $(BLD) exists before any compilation starts.
265#
cc06e7e7 266$(GNULIBOBJS): stamp_BLD
f915f0f7
EZ
267
268#
269# Headers we would preprocess if we could.
270#
271getopt.h: getopt_.h
272 $(CP) $(ALL_DEPS) $@
273
274#
275# Maintenance
276#
277clean:
278 - $(DEL) $(COMPILER_TEMP_FILES)
279 - $(DEL) getopt.h
280 - $(DEL_TREE) $(OBJDIR)
281 - $(DEL) stamp_BLD
282
283distclean: cleanall
284 - $(DEL) TAGS
285 - $(DEL) Makefile
286
287maintainer-clean: distclean
288 - $(DEL) getopt_.h
289
290cleanall: 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.
297doit:
298
299getopt_.h: getopt.in.h $(ARG_NONNULL_H)
300 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
301
302getopt_.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
308getopt_.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
321HAVE_GETOPT_H = HAVE_GETOPT_H
322INCLUDE_NEXT = include_next
f915f0f7
EZ
323PRAGMA_COLUMNS =
324NEXT_GETOPT_H = <getopt.h>
24e0f6b1 325ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
f915f0f7
EZ
326
327getopt_h:
328 - $(DEL) getopt_.h-t getopt_.h
6a3e57bb
PE
329 sed -e "s!@GUARD_PREFIX@!GL!g" \
330 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
f915f0f7
EZ
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
391ceac5
EZ
343
344execinfo.h: execinfo.in.h
345 $(CP) execinfo.in.h $@