1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2011 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) \
47 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
49 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
51 gnulib: $(BLD)/libgnu.$(A)
63 ../lib-src/$(BLD)/etags.exe *.c *.h
70 $(BLD)/c-ctype.$(O) : \
73 $(EMACS_ROOT)/src/s/ms-w32.h \
74 $(EMACS_ROOT)/src/config.h
76 $(BLD)/c-strcasecmp.$(O) : \
77 $(SRC)/c-strcasecmp.c \
80 $(EMACS_ROOT)/src/s/ms-w32.h \
81 $(EMACS_ROOT)/src/config.h
83 $(BLD)/c-strncasecmp.$(O) : \
84 $(SRC)/c-strncasecmp.c \
87 $(EMACS_ROOT)/src/s/ms-w32.h \
88 $(EMACS_ROOT)/src/config.h
90 $(BLD)/dtoastr.$(O) : \
95 $(EMACS_ROOT)/nt/inc/sys/stat.h \
96 $(EMACS_ROOT)/src/s/ms-w32.h \
97 $(EMACS_ROOT)/src/config.h
99 $(BLD)/dtotimespec.$(O) : \
100 $(SRC)/dtotimespec.c \
103 $(EMACS_ROOT)/nt/inc/sys/stat.h \
104 $(EMACS_ROOT)/src/s/ms-w32.h \
105 $(EMACS_ROOT)/src/config.h
107 $(BLD)/getopt.$(O) : \
110 $(SRC)/getopt_int.h \
112 $(EMACS_ROOT)/nt/inc/unistd.h \
113 $(EMACS_ROOT)/nt/inc/sys/stat.h \
114 $(EMACS_ROOT)/src/s/ms-w32.h \
115 $(EMACS_ROOT)/src/config.h
117 $(BLD)/getopt1.$(O) : \
120 $(SRC)/getopt_int.h \
121 $(EMACS_ROOT)/nt/inc/sys/stat.h \
122 $(EMACS_ROOT)/src/s/ms-w32.h \
123 $(EMACS_ROOT)/src/config.h
125 $(BLD)/gettime.$(O) : \
128 $(EMACS_ROOT)/nt/inc/sys/time.h \
129 $(EMACS_ROOT)/nt/inc/sys/stat.h \
130 $(EMACS_ROOT)/src/s/ms-w32.h \
131 $(EMACS_ROOT)/src/config.h
133 $(BLD)/strftime.$(O) : \
136 $(EMACS_ROOT)/nt/inc/stdbool.h \
137 $(EMACS_ROOT)/nt/inc/sys/stat.h \
138 $(EMACS_ROOT)/src/s/ms-w32.h \
139 $(EMACS_ROOT)/src/config.h
141 $(BLD)/time_r.$(O) : \
143 $(EMACS_ROOT)/nt/inc/sys/stat.h \
144 $(EMACS_ROOT)/src/s/ms-w32.h \
145 $(EMACS_ROOT)/src/config.h
147 $(BLD)/timespec-add.$(O) : \
148 $(SRC)/timespec-add.c \
151 $(EMACS_ROOT)/nt/inc/sys/stat.h \
152 $(EMACS_ROOT)/src/s/ms-w32.h \
153 $(EMACS_ROOT)/src/config.h
155 $(BLD)/timespec-sub.$(O) : \
156 $(SRC)/timespec-sub.c \
159 $(EMACS_ROOT)/nt/inc/sys/stat.h \
160 $(EMACS_ROOT)/src/s/ms-w32.h \
161 $(EMACS_ROOT)/src/config.h
166 $(EMACS_ROOT)/nt/inc/stdint.h \
167 $(EMACS_ROOT)/nt/inc/stdalign.h \
168 $(EMACS_ROOT)/nt/inc/sys/stat.h \
169 $(EMACS_ROOT)/src/s/ms-w32.h \
170 $(EMACS_ROOT)/src/config.h
175 $(EMACS_ROOT)/nt/inc/stdint.h \
176 $(EMACS_ROOT)/nt/inc/stdalign.h \
177 $(EMACS_ROOT)/nt/inc/sys/stat.h \
178 $(EMACS_ROOT)/src/s/ms-w32.h \
179 $(EMACS_ROOT)/src/config.h
181 $(BLD)/sha256.$(O) : \
184 $(EMACS_ROOT)/nt/inc/stdint.h \
185 $(EMACS_ROOT)/nt/inc/stdalign.h \
186 $(EMACS_ROOT)/nt/inc/sys/stat.h \
187 $(EMACS_ROOT)/src/s/ms-w32.h \
188 $(EMACS_ROOT)/src/config.h
190 $(BLD)/sha512.$(O) : \
193 $(EMACS_ROOT)/nt/inc/stdint.h \
194 $(EMACS_ROOT)/nt/inc/stdalign.h \
195 $(EMACS_ROOT)/nt/inc/sys/stat.h \
196 $(EMACS_ROOT)/src/s/ms-w32.h \
197 $(EMACS_ROOT)/src/config.h
199 $(BLD)/filemode.$(O) : \
202 $(EMACS_ROOT)/nt/inc/sys/stat.h \
203 $(EMACS_ROOT)/src/s/ms-w32.h \
204 $(EMACS_ROOT)/src/config.h
206 # The following dependencies are for supporting parallel builds, where
207 # we must make sure $(BLD) exists before any compilation starts.
209 $(GNULIBOBJS): stamp_BLD
212 # Headers we would preprocess if we could.
221 - $(DEL) $(COMPILER_TEMP_FILES)
223 - $(DEL_TREE) $(OBJDIR)
230 maintainer-clean: distclean
235 - $(DEL_TREE) obj-spd
239 # A dummy target to force other targets to be evaluated.
242 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
243 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
246 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
247 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
248 @echo You will need GNU Sed to be installed.
252 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
253 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
254 @echo You will need GNU Sed to be installed.
257 # Generating getopt_.h from getopt.in.h.
259 # To avoid requiring all end users to install Sed, we have below
260 # a maintainer-only target that produces getopt_.h from getopt.in.h.
261 # For easier maintenance, all the strings that replace the @FOO@
262 # placeholder are defined as Make macros below.
264 HAVE_GETOPT_H = HAVE_GETOPT_H
265 INCLUDE_NEXT = include_next
267 NEXT_GETOPT_H = <getopt.h>
268 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
271 - $(DEL) getopt_.h-t getopt_.h
272 sed -e "s!@GUARD_PREFIX@!GL!g" \
273 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
274 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
275 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
276 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
277 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
278 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
279 -e "/^\# include_next/i # ifndef __GNUC__" \
280 -e "/^\# include_next/i # include <next_getopt.h>" \
281 -e "/^\# include_next/i # else" \
282 -e "/^\# include_next/a # endif" \
283 < getopt.in.h > getopt_.h-t
284 $(CP) getopt_.h-t getopt_.h