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 = -DHAVE_CONFIG_H=1 -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/time.h \
81 $(EMACS_ROOT)/nt/inc/sys/stat.h \
82 $(EMACS_ROOT)/src/s/ms-w32.h \
83 $(EMACS_ROOT)/src/config.h
85 $(BLD)/getopt.$(O) : \
90 $(EMACS_ROOT)/nt/inc/unistd.h \
91 $(EMACS_ROOT)/nt/inc/sys/stat.h \
92 $(EMACS_ROOT)/src/s/ms-w32.h \
93 $(EMACS_ROOT)/src/config.h
95 $(BLD)/getopt1.$(O) : \
99 $(EMACS_ROOT)/nt/inc/sys/stat.h \
100 $(EMACS_ROOT)/src/s/ms-w32.h \
101 $(EMACS_ROOT)/src/config.h
103 $(BLD)/gettime.$(O) : \
106 $(EMACS_ROOT)/nt/inc/sys/time.h \
107 $(EMACS_ROOT)/nt/inc/sys/stat.h \
108 $(EMACS_ROOT)/src/s/ms-w32.h \
109 $(EMACS_ROOT)/src/config.h
111 $(BLD)/strftime.$(O) : \
114 $(EMACS_ROOT)/nt/inc/stdbool.h \
115 $(EMACS_ROOT)/nt/inc/sys/stat.h \
116 $(EMACS_ROOT)/src/s/ms-w32.h \
117 $(EMACS_ROOT)/src/config.h
119 $(BLD)/time_r.$(O) : \
121 $(EMACS_ROOT)/nt/inc/sys/stat.h \
122 $(EMACS_ROOT)/src/s/ms-w32.h \
123 $(EMACS_ROOT)/src/config.h
125 $(BLD)/timespec-add.$(O) : \
126 $(SRC)/timespec-add.c \
129 $(EMACS_ROOT)/nt/inc/sys/time.h \
130 $(EMACS_ROOT)/nt/inc/sys/stat.h \
131 $(EMACS_ROOT)/src/s/ms-w32.h \
132 $(EMACS_ROOT)/src/config.h
134 $(BLD)/timespec-sub.$(O) : \
135 $(SRC)/timespec-sub.c \
138 $(EMACS_ROOT)/nt/inc/sys/time.h \
139 $(EMACS_ROOT)/nt/inc/sys/stat.h \
140 $(EMACS_ROOT)/src/s/ms-w32.h \
141 $(EMACS_ROOT)/src/config.h
146 $(EMACS_ROOT)/nt/inc/stdint.h \
147 $(EMACS_ROOT)/nt/inc/stdalign.h \
148 $(EMACS_ROOT)/nt/inc/sys/stat.h \
149 $(EMACS_ROOT)/src/s/ms-w32.h \
150 $(EMACS_ROOT)/src/config.h
155 $(EMACS_ROOT)/nt/inc/stdint.h \
156 $(EMACS_ROOT)/nt/inc/stdalign.h \
157 $(EMACS_ROOT)/nt/inc/sys/stat.h \
158 $(EMACS_ROOT)/src/s/ms-w32.h \
159 $(EMACS_ROOT)/src/config.h
161 $(BLD)/sha256.$(O) : \
164 $(EMACS_ROOT)/nt/inc/stdint.h \
165 $(EMACS_ROOT)/nt/inc/stdalign.h \
166 $(EMACS_ROOT)/nt/inc/sys/stat.h \
167 $(EMACS_ROOT)/src/s/ms-w32.h \
168 $(EMACS_ROOT)/src/config.h
170 $(BLD)/sha512.$(O) : \
173 $(EMACS_ROOT)/nt/inc/stdint.h \
174 $(EMACS_ROOT)/nt/inc/stdalign.h \
175 $(EMACS_ROOT)/nt/inc/sys/stat.h \
176 $(EMACS_ROOT)/src/s/ms-w32.h \
177 $(EMACS_ROOT)/src/config.h
179 $(BLD)/filemode.$(O) : \
182 $(EMACS_ROOT)/nt/inc/sys/stat.h \
183 $(EMACS_ROOT)/src/s/ms-w32.h \
184 $(EMACS_ROOT)/src/config.h
186 # The following dependencies are for supporting parallel builds, where
187 # we must make sure $(BLD) exists before any compilation starts.
189 $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
190 $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
191 $(BLD)/sha1.$(O) $(BLD)/sha256.$(O) $(BLD)/sha512.$(O): stamp_BLD
192 $(BLD)/filemode.$(O): stamp_BLD
195 # Headers we would preprocess if we could.
204 - $(DEL) $(COMPILER_TEMP_FILES)
206 - $(DEL_TREE) $(OBJDIR)
213 maintainer-clean: distclean
218 - $(DEL_TREE) obj-spd
222 # A dummy target to force other targets to be evaluated.
225 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
226 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
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.
235 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
236 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
237 @echo You will need GNU Sed to be installed.
240 # Generating getopt_.h from getopt.in.h.
242 # To avoid requiring all end users to install Sed, we have below
243 # a maintainer-only target that produces getopt_.h from getopt.in.h.
244 # For easier maintenance, all the strings that replace the @FOO@
245 # placeholder are defined as Make macros below.
247 HAVE_GETOPT_H = HAVE_GETOPT_H
248 INCLUDE_NEXT = include_next
250 NEXT_GETOPT_H = <getopt.h>
251 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
254 - $(DEL) getopt_.h-t getopt_.h
255 sed -e "s!@GUARD_PREFIX@!GL!g" \
256 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
257 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
258 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
259 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
260 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
261 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
262 -e "/^\# include_next/i # ifndef __GNUC__" \
263 -e "/^\# include_next/i # include <next_getopt.h>" \
264 -e "/^\# include_next/i # else" \
265 -e "/^\# include_next/a # endif" \
266 < getopt.in.h > getopt_.h-t
267 $(CP) getopt_.h-t getopt_.h