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)/dtoastr.$(O) \
27 $(BLD)/dtotimespec.$(O) \
31 $(BLD)/strftime.$(O) \
33 $(BLD)/timespec-add.$(O) \
34 $(BLD)/timespec-sub.$(O) \
44 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
46 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
48 gnulib: $(BLD)/libgnu.$(A)
60 ../lib-src/$(BLD)/etags.exe *.c *.h
67 $(BLD)/dtoastr.$(O) : \
72 $(EMACS_ROOT)/nt/inc/sys/stat.h \
73 $(EMACS_ROOT)/src/s/ms-w32.h \
74 $(EMACS_ROOT)/src/config.h
76 $(BLD)/dtotimespec.$(O) : \
77 $(SRC)/dtotimespec.c \
80 $(EMACS_ROOT)/nt/inc/sys/stat.h \
81 $(EMACS_ROOT)/src/s/ms-w32.h \
82 $(EMACS_ROOT)/src/config.h
84 $(BLD)/getopt.$(O) : \
89 $(EMACS_ROOT)/nt/inc/unistd.h \
90 $(EMACS_ROOT)/nt/inc/sys/stat.h \
91 $(EMACS_ROOT)/src/s/ms-w32.h \
92 $(EMACS_ROOT)/src/config.h
94 $(BLD)/getopt1.$(O) : \
98 $(EMACS_ROOT)/nt/inc/sys/stat.h \
99 $(EMACS_ROOT)/src/s/ms-w32.h \
100 $(EMACS_ROOT)/src/config.h
102 $(BLD)/gettime.$(O) : \
105 $(EMACS_ROOT)/nt/inc/sys/time.h \
106 $(EMACS_ROOT)/nt/inc/sys/stat.h \
107 $(EMACS_ROOT)/src/s/ms-w32.h \
108 $(EMACS_ROOT)/src/config.h
110 $(BLD)/strftime.$(O) : \
113 $(EMACS_ROOT)/nt/inc/stdbool.h \
114 $(EMACS_ROOT)/nt/inc/sys/stat.h \
115 $(EMACS_ROOT)/src/s/ms-w32.h \
116 $(EMACS_ROOT)/src/config.h
118 $(BLD)/time_r.$(O) : \
120 $(EMACS_ROOT)/nt/inc/sys/stat.h \
121 $(EMACS_ROOT)/src/s/ms-w32.h \
122 $(EMACS_ROOT)/src/config.h
124 $(BLD)/timespec-add.$(O) : \
125 $(SRC)/timespec-add.c \
128 $(EMACS_ROOT)/nt/inc/sys/stat.h \
129 $(EMACS_ROOT)/src/s/ms-w32.h \
130 $(EMACS_ROOT)/src/config.h
132 $(BLD)/timespec-sub.$(O) : \
133 $(SRC)/timespec-sub.c \
136 $(EMACS_ROOT)/nt/inc/sys/stat.h \
137 $(EMACS_ROOT)/src/s/ms-w32.h \
138 $(EMACS_ROOT)/src/config.h
143 $(EMACS_ROOT)/nt/inc/stdint.h \
144 $(EMACS_ROOT)/nt/inc/stdalign.h \
145 $(EMACS_ROOT)/nt/inc/sys/stat.h \
146 $(EMACS_ROOT)/src/s/ms-w32.h \
147 $(EMACS_ROOT)/src/config.h
152 $(EMACS_ROOT)/nt/inc/stdint.h \
153 $(EMACS_ROOT)/nt/inc/stdalign.h \
154 $(EMACS_ROOT)/nt/inc/sys/stat.h \
155 $(EMACS_ROOT)/src/s/ms-w32.h \
156 $(EMACS_ROOT)/src/config.h
158 $(BLD)/sha256.$(O) : \
161 $(EMACS_ROOT)/nt/inc/stdint.h \
162 $(EMACS_ROOT)/nt/inc/stdalign.h \
163 $(EMACS_ROOT)/nt/inc/sys/stat.h \
164 $(EMACS_ROOT)/src/s/ms-w32.h \
165 $(EMACS_ROOT)/src/config.h
167 $(BLD)/sha512.$(O) : \
170 $(EMACS_ROOT)/nt/inc/stdint.h \
171 $(EMACS_ROOT)/nt/inc/stdalign.h \
172 $(EMACS_ROOT)/nt/inc/sys/stat.h \
173 $(EMACS_ROOT)/src/s/ms-w32.h \
174 $(EMACS_ROOT)/src/config.h
176 $(BLD)/filemode.$(O) : \
179 $(EMACS_ROOT)/nt/inc/sys/stat.h \
180 $(EMACS_ROOT)/src/s/ms-w32.h \
181 $(EMACS_ROOT)/src/config.h
183 # The following dependencies are for supporting parallel builds, where
184 # we must make sure $(BLD) exists before any compilation starts.
186 $(GNULIBOBJS): stamp_BLD
189 # Headers we would preprocess if we could.
198 - $(DEL) $(COMPILER_TEMP_FILES)
200 - $(DEL_TREE) $(OBJDIR)
207 maintainer-clean: distclean
212 - $(DEL_TREE) obj-spd
216 # A dummy target to force other targets to be evaluated.
219 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
220 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
223 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
224 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
225 @echo You will need GNU Sed to be installed.
229 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
230 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
231 @echo You will need GNU Sed to be installed.
234 # Generating getopt_.h from getopt.in.h.
236 # To avoid requiring all end users to install Sed, we have below
237 # a maintainer-only target that produces getopt_.h from getopt.in.h.
238 # For easier maintenance, all the strings that replace the @FOO@
239 # placeholder are defined as Make macros below.
241 HAVE_GETOPT_H = HAVE_GETOPT_H
242 INCLUDE_NEXT = include_next
244 NEXT_GETOPT_H = <getopt.h>
245 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
248 - $(DEL) getopt_.h-t getopt_.h
249 sed -e "s!@GUARD_PREFIX@!GL!g" \
250 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
251 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
252 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
253 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
254 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
255 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
256 -e "/^\# include_next/i # ifndef __GNUC__" \
257 -e "/^\# include_next/i # include <next_getopt.h>" \
258 -e "/^\# include_next/i # else" \
259 -e "/^\# include_next/a # endif" \
260 < getopt.in.h > getopt_.h-t
261 $(CP) getopt_.h-t getopt_.h