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) \
29 $(BLD)/strftime.$(O) \
40 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
42 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
44 gnulib: $(BLD)/libgnu.$(A)
56 ../lib-src/$(BLD)/etags.exe *.c *.h
63 $(BLD)/dtoastr.$(O) : \
68 $(EMACS_ROOT)/nt/inc/sys/stat.h \
69 $(EMACS_ROOT)/src/s/ms-w32.h \
70 $(EMACS_ROOT)/src/config.h
72 $(BLD)/getopt.$(O) : \
77 $(EMACS_ROOT)/nt/inc/unistd.h \
78 $(EMACS_ROOT)/nt/inc/sys/stat.h \
79 $(EMACS_ROOT)/src/s/ms-w32.h \
80 $(EMACS_ROOT)/src/config.h
82 $(BLD)/getopt1.$(O) : \
86 $(EMACS_ROOT)/nt/inc/sys/stat.h \
87 $(EMACS_ROOT)/src/s/ms-w32.h \
88 $(EMACS_ROOT)/src/config.h
90 $(BLD)/strftime.$(O) : \
93 $(EMACS_ROOT)/nt/inc/stdbool.h \
94 $(EMACS_ROOT)/nt/inc/sys/stat.h \
95 $(EMACS_ROOT)/src/s/ms-w32.h \
96 $(EMACS_ROOT)/src/config.h
98 $(BLD)/time_r.$(O) : \
100 $(EMACS_ROOT)/nt/inc/sys/stat.h \
101 $(EMACS_ROOT)/src/s/ms-w32.h \
102 $(EMACS_ROOT)/src/config.h
107 $(EMACS_ROOT)/nt/inc/stdint.h \
108 $(EMACS_ROOT)/nt/inc/stdalign.h \
109 $(EMACS_ROOT)/nt/inc/sys/stat.h \
110 $(EMACS_ROOT)/src/s/ms-w32.h \
111 $(EMACS_ROOT)/src/config.h
116 $(EMACS_ROOT)/nt/inc/stdint.h \
117 $(EMACS_ROOT)/nt/inc/stdalign.h \
118 $(EMACS_ROOT)/nt/inc/sys/stat.h \
119 $(EMACS_ROOT)/src/s/ms-w32.h \
120 $(EMACS_ROOT)/src/config.h
122 $(BLD)/sha256.$(O) : \
125 $(EMACS_ROOT)/nt/inc/stdint.h \
126 $(EMACS_ROOT)/nt/inc/stdalign.h \
127 $(EMACS_ROOT)/nt/inc/sys/stat.h \
128 $(EMACS_ROOT)/src/s/ms-w32.h \
129 $(EMACS_ROOT)/src/config.h
131 $(BLD)/sha512.$(O) : \
134 $(EMACS_ROOT)/nt/inc/stdint.h \
135 $(EMACS_ROOT)/nt/inc/stdalign.h \
136 $(EMACS_ROOT)/nt/inc/sys/stat.h \
137 $(EMACS_ROOT)/src/s/ms-w32.h \
138 $(EMACS_ROOT)/src/config.h
140 $(BLD)/filemode.$(O) : \
143 $(EMACS_ROOT)/nt/inc/sys/stat.h \
144 $(EMACS_ROOT)/src/s/ms-w32.h \
145 $(EMACS_ROOT)/src/config.h
147 # The following dependencies are for supporting parallel builds, where
148 # we must make sure $(BLD) exists before any compilation starts.
150 $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
151 $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
152 $(BLD)/sha1.$(O) $(BLD)/sha256.$(O) $(BLD)/sha512.$(O): stamp_BLD
153 $(BLD)/filemode.$(O): stamp_BLD
156 # Headers we would preprocess if we could.
165 - $(DEL) $(COMPILER_TEMP_FILES)
167 - $(DEL_TREE) $(OBJDIR)
174 maintainer-clean: distclean
179 - $(DEL_TREE) obj-spd
183 # A dummy target to force other targets to be evaluated.
186 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
187 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
190 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
191 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
192 @echo You will need GNU Sed to be installed.
196 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
197 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
198 @echo You will need GNU Sed to be installed.
201 # Generating getopt_.h from getopt.in.h.
203 # To avoid requiring all end users to install Sed, we have below
204 # a maintainer-only target that produces getopt_.h from getopt.in.h.
205 # For easier maintenance, all the strings that replace the @FOO@
206 # placeholder are defined as Make macros below.
208 HAVE_GETOPT_H = HAVE_GETOPT_H
209 INCLUDE_NEXT = include_next
211 NEXT_GETOPT_H = <getopt.h>
212 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
215 - $(DEL) getopt_.h-t getopt_.h
216 sed -e "s!@GUARD_PREFIX@!GL!g" \
217 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
218 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
219 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
220 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
221 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
222 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
223 -e "/^\# include_next/i # ifndef __GNUC__" \
224 -e "/^\# include_next/i # include <next_getopt.h>" \
225 -e "/^\# include_next/i # else" \
226 -e "/^\# include_next/a # endif" \
227 < getopt.in.h > getopt_.h-t
228 $(CP) getopt_.h-t getopt_.h