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