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) \
30 $(BLD)/dtotimespec.$(O) \
34 $(BLD)/strftime.$(O) \
36 $(BLD)/timespec-add.$(O) \
37 $(BLD)/timespec-sub.$(O) \
42 $(BLD)/stat-time.$(O) \
43 $(BLD)/timespec.$(O) \
50 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
52 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
54 gnulib: $(BLD)/libgnu.$(A)
66 ../lib-src/$(BLD)/etags.exe *.c *.h
72 SRC = $(EMACS_ROOT)/src
73 NT_INC = $(EMACS_ROOT)/nt/inc
75 C_CTYPE_H = $(GNU_LIB)/c-ctype.h \
77 MS_W32_H = $(NT_INC)/ms-w32.h \
79 CONF_POST_H = $(SRC)/conf_post.h \
81 CONFIG_H = $(SRC)/config.h \
83 FILEMODE_H = $(GNU_LIB)/filemode.h \
85 FTOASTR_H = $(GNU_LIB)/ftoastr.h \
87 FTOASTR_C = $(GNU_LIB)/ftoastr.c \
90 GETOPT_INT_H = $(GNU_LIB)/getopt_int.h \
92 MD5_H = $(GNU_LIB)/md5.h \
94 SHA1_H = $(GNU_LIB)/sha1.h \
96 SHA256_H = $(GNU_LIB)/sha256.h \
98 U64_H = $(GNU_LIB)/u64.h \
100 SHA512_H = $(GNU_LIB)/sha512.h \
102 STAT_TIME_H = $(GNU_LIB)/stat-time.h \
105 $(BLD)/c-ctype.$(O) : \
106 $(GNU_LIB)/c-ctype.c \
110 $(BLD)/c-strcasecmp.$(O) : \
111 $(GNU_LIB)/c-strcasecmp.c \
112 $(GNU_LIB)/c-strcase.h \
116 $(BLD)/c-strncasecmp.$(O) : \
117 $(GNU_LIB)/c-strncasecmp.c \
118 $(GNU_LIB)/c-strcase.h \
122 $(BLD)/dtoastr.$(O) : \
123 $(GNU_LIB)/dtoastr.c \
126 $(BLD)/dtotimespec.$(O) : \
127 $(GNU_LIB)/dtotimespec.c \
128 $(GNU_LIB)/intprops.h \
129 $(GNU_LIB)/timespec.h \
132 $(BLD)/getopt.$(O) : \
133 $(GNU_LIB)/getopt.c \
134 $(GNU_LIB)/getopt.h \
135 $(GNU_LIB)/gettext.h \
140 $(BLD)/getopt1.$(O) : \
141 $(GNU_LIB)/getopt1.c \
142 $(GNU_LIB)/getopt.h \
146 $(BLD)/gettime.$(O) : \
147 $(GNU_LIB)/gettime.c \
148 $(GNU_LIB)/timespec.h \
149 $(NT_INC)/sys/time.h \
152 $(BLD)/strftime.$(O) : \
153 $(GNU_LIB)/strftime.c \
154 $(GNU_LIB)/strftime.h \
155 $(NT_INC)/stdbool.h \
158 $(BLD)/time_r.$(O) : \
159 $(GNU_LIB)/time_r.c \
162 $(BLD)/timespec-add.$(O) : \
163 $(GNU_LIB)/timespec-add.c \
164 $(GNU_LIB)/intprops.h \
165 $(GNU_LIB)/timespec.h \
168 $(BLD)/timespec-sub.$(O) : \
169 $(GNU_LIB)/timespec-sub.c \
170 $(GNU_LIB)/intprops.h \
171 $(GNU_LIB)/timespec.h \
176 $(NT_INC)/stdalign.h \
183 $(NT_INC)/stdalign.h \
188 $(BLD)/sha256.$(O) : \
189 $(GNU_LIB)/sha256.c \
190 $(NT_INC)/stdalign.h \
195 $(BLD)/sha512.$(O) : \
196 $(GNU_LIB)/sha512.c \
197 $(NT_INC)/stdalign.h \
202 $(BLD)/stat-time.$(O) : \
203 $(GNU_LIB)/stat-time.c \
207 $(BLD)/timespec.$(O) : \
208 $(GNU_LIB)/timespec.c \
209 $(GNU_LIB)/timespec.h \
217 $(BLD)/filemode.$(O) : \
218 $(GNU_LIB)/filemode.c \
222 # The following dependencies are for supporting parallel builds, where
223 # we must make sure $(BLD) exists before any compilation starts.
225 $(GNULIBOBJS): stamp_BLD
228 # Headers we would preprocess if we could.
237 - $(DEL) $(COMPILER_TEMP_FILES)
239 - $(DEL_TREE) $(OBJDIR)
246 maintainer-clean: distclean
251 - $(DEL_TREE) obj-spd
255 # A dummy target to force other targets to be evaluated.
258 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
259 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
262 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
263 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
264 @echo You will need GNU Sed to be installed.
268 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
269 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
270 @echo You will need GNU Sed to be installed.
273 # Generating getopt_.h from getopt.in.h.
275 # To avoid requiring all end users to install Sed, we have below
276 # a maintainer-only target that produces getopt_.h from getopt.in.h.
277 # For easier maintenance, all the strings that replace the @FOO@
278 # placeholder are defined as Make macros below.
280 HAVE_GETOPT_H = HAVE_GETOPT_H
281 INCLUDE_NEXT = include_next
283 NEXT_GETOPT_H = <getopt.h>
284 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
287 - $(DEL) getopt_.h-t getopt_.h
288 sed -e "s!@GUARD_PREFIX@!GL!g" \
289 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
290 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
291 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
292 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
293 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
294 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
295 -e "/^\# include_next/i # ifndef __GNUC__" \
296 -e "/^\# include_next/i # include <next_getopt.h>" \
297 -e "/^\# include_next/i # else" \
298 -e "/^\# include_next/a # endif" \
299 < getopt.in.h > getopt_.h-t
300 $(CP) getopt_.h-t getopt_.h