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