1 # -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
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.
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.
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/>.
23 LOCAL_FLAGS = -I. -I../nt/inc -I../src
26 GNULIBOBJS = $(BLD)/c-ctype.$(O) \
27 $(BLD)/c-strcasecmp.$(O) \
28 $(BLD)/c-strncasecmp.$(O) \
29 $(BLD)/close-stream.$(O) \
31 $(BLD)/dtotimespec.$(O) \
32 $(BLD)/execinfo.$(O) \
33 $(BLD)/fpending.$(O) \
37 $(BLD)/strftime.$(O) \
39 $(BLD)/timespec-add.$(O) \
40 $(BLD)/timespec-sub.$(O) \
45 $(BLD)/stat-time.$(O) \
46 $(BLD)/timespec.$(O) \
53 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
55 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
57 gnulib: $(BLD)/libgnu.$(A)
69 ../lib-src/$(BLD)/etags.exe *.c *.h
75 SRC = $(EMACS_ROOT)/src
76 NT_INC = $(EMACS_ROOT)/nt/inc
78 C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
80 MS_W32_H = $(NT_INC)/ms-w32.h \
82 CONF_POST_H = $(SRC)/conf_post.h \
84 CONFIG_H = $(SRC)/config.h \
86 FILEMODE_H = $(GNU_LIB)/filemode.h \
88 FTOASTR_H = $(GNU_LIB)/ftoastr.h \
90 FTOASTR_C = $(GNU_LIB)/ftoastr.c \
93 GETOPT_INT_H = $(GNU_LIB)/getopt_int.h \
95 MD5_H = $(GNU_LIB)/md5.h \
97 SHA1_H = $(GNU_LIB)/sha1.h \
99 SHA256_H = $(GNU_LIB)/sha256.h \
101 U64_H = $(GNU_LIB)/u64.h \
103 SHA512_H = $(GNU_LIB)/sha512.h \
105 STAT_TIME_H = $(GNU_LIB)/stat-time.h \
108 $(BLD)/c-ctype.$(O) : \
109 $(GNU_LIB)/c-ctype.c \
113 $(BLD)/c-strcasecmp.$(O) : \
114 $(GNU_LIB)/c-strcasecmp.c \
115 $(GNU_LIB)/c-strcase.h \
119 $(BLD)/c-strncasecmp.$(O) : \
120 $(GNU_LIB)/c-strncasecmp.c \
121 $(GNU_LIB)/c-strcase.h \
125 $(BLD)/close-stream.$(O) : \
126 $(GNU_LIB)/close-stream.c \
127 $(GNU_LIB)/close-stream.h \
128 $(GNU_LIB)/fpending.h \
129 $(NT_INC)/stdbool.h \
132 $(BLD)/dtoastr.$(O) : \
133 $(GNU_LIB)/dtoastr.c \
136 $(BLD)/dtotimespec.$(O) : \
137 $(GNU_LIB)/dtotimespec.c \
138 $(GNU_LIB)/intprops.h \
139 $(GNU_LIB)/timespec.h \
142 $(BLD)/execinfo.$(O) : \
143 $(GNU_LIB)/execinfo.c \
144 $(GNU_LIB)/execinfo.h \
147 $(BLD)/fpending.$(O) : \
148 $(GNU_LIB)/fpending.c \
149 $(GNU_LIB)/fpending.h \
152 $(BLD)/getopt.$(O) : \
153 $(GNU_LIB)/getopt.c \
154 $(GNU_LIB)/getopt.h \
155 $(GNU_LIB)/gettext.h \
160 $(BLD)/getopt1.$(O) : \
161 $(GNU_LIB)/getopt1.c \
162 $(GNU_LIB)/getopt.h \
166 $(BLD)/gettime.$(O) : \
167 $(GNU_LIB)/gettime.c \
168 $(GNU_LIB)/timespec.h \
169 $(NT_INC)/sys/time.h \
172 $(BLD)/strftime.$(O) : \
173 $(GNU_LIB)/strftime.c \
174 $(GNU_LIB)/strftime.h \
175 $(NT_INC)/stdbool.h \
178 $(BLD)/time_r.$(O) : \
179 $(GNU_LIB)/time_r.c \
182 $(BLD)/timespec-add.$(O) : \
183 $(GNU_LIB)/timespec-add.c \
184 $(GNU_LIB)/intprops.h \
185 $(GNU_LIB)/timespec.h \
188 $(BLD)/timespec-sub.$(O) : \
189 $(GNU_LIB)/timespec-sub.c \
190 $(GNU_LIB)/intprops.h \
191 $(GNU_LIB)/timespec.h \
196 $(NT_INC)/stdalign.h \
203 $(NT_INC)/stdalign.h \
208 $(BLD)/sha256.$(O) : \
209 $(GNU_LIB)/sha256.c \
210 $(NT_INC)/stdalign.h \
215 $(BLD)/sha512.$(O) : \
216 $(GNU_LIB)/sha512.c \
217 $(NT_INC)/stdalign.h \
222 $(BLD)/stat-time.$(O) : \
223 $(GNU_LIB)/stat-time.c \
227 $(BLD)/timespec.$(O) : \
228 $(GNU_LIB)/timespec.c \
229 $(GNU_LIB)/timespec.h \
237 $(BLD)/filemode.$(O) : \
238 $(GNU_LIB)/filemode.c \
242 # The following dependencies are for supporting parallel builds, where
243 # we must make sure $(BLD) exists before any compilation starts.
245 $(GNULIBOBJS): stamp_BLD
248 # Headers we would preprocess if we could.
257 - $(DEL) $(COMPILER_TEMP_FILES)
259 - $(DEL_TREE) $(OBJDIR)
266 maintainer-clean: distclean
271 - $(DEL_TREE) obj-spd
275 # A dummy target to force other targets to be evaluated.
278 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
279 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
282 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
283 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
284 @echo You will need GNU Sed to be installed.
288 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
289 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
290 @echo You will need GNU Sed to be installed.
293 # Generating getopt_.h from getopt.in.h.
295 # To avoid requiring all end users to install Sed, we have below
296 # a maintainer-only target that produces getopt_.h from getopt.in.h.
297 # For easier maintenance, all the strings that replace the @FOO@
298 # placeholder are defined as Make macros below.
300 HAVE_GETOPT_H = HAVE_GETOPT_H
301 INCLUDE_NEXT = include_next
303 NEXT_GETOPT_H = <getopt.h>
304 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
307 - $(DEL) getopt_.h-t getopt_.h
308 sed -e "s!@GUARD_PREFIX@!GL!g" \
309 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
310 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
311 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
312 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
313 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
314 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
315 -e "/^\# include_next/i # ifndef __GNUC__" \
316 -e "/^\# include_next/i # include <next_getopt.h>" \
317 -e "/^\# include_next/i # else" \
318 -e "/^\# include_next/a # endif" \
319 < getopt.in.h > getopt_.h-t
320 $(CP) getopt_.h-t getopt_.h
323 execinfo.h: execinfo.in.h
324 $(CP) execinfo.in.h $@