Rename configure.in to configure.ac.
[emacs.git] / lib / makefile.w32-in
blobf2853f10cb9a8d9a11182d4420f5e7220fc2758e
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/>.
19 ALL = gnulib
21 .PHONY: $(ALL)
23 LOCAL_FLAGS     = -I. -I../nt/inc -I../src
24 LIBS            =
26 GNULIBOBJS = $(BLD)/c-ctype.$(O) \
27              $(BLD)/c-strcasecmp.$(O) \
28              $(BLD)/c-strncasecmp.$(O) \
29              $(BLD)/dtoastr.$(O) \
30              $(BLD)/dtotimespec.$(O)  \
31              $(BLD)/getopt.$(O)  \
32              $(BLD)/getopt1.$(O) \
33              $(BLD)/gettime.$(O) \
34              $(BLD)/strftime.$(O) \
35              $(BLD)/time_r.$(O) \
36              $(BLD)/timespec-add.$(O) \
37              $(BLD)/timespec-sub.$(O) \
38              $(BLD)/md5.$(O) \
39              $(BLD)/sha1.$(O) \
40              $(BLD)/sha256.$(O) \
41              $(BLD)/sha512.$(O) \
42              $(BLD)/filemode.$(O)
45 # Build the library
47 $(BLD)/libgnu.$(A):     $(GNULIBOBJS)
48         - $(DEL) $@
49         $(AR) $(AR_OUT)$@ $(ALL_DEPS)
51 gnulib:         $(BLD)/libgnu.$(A)
54 # Build everything
56 all:            $(ALL)
58 ### TAGS ###
60 FRC:
62 TAGS: FRC
63          ../lib-src/$(BLD)/etags.exe *.c *.h
65 ### DEPENDENCIES ###
67 EMACS_ROOT      = ..
68 SRC             = .
70 $(BLD)/c-ctype.$(O) : \
71         $(SRC)/c-ctype.c \
72         $(SRC)/c-ctype.h \
73         $(EMACS_ROOT)/src/s/ms-w32.h \
74         $(EMACS_ROOT)/src/config.h
76 $(BLD)/c-strcasecmp.$(O) : \
77         $(SRC)/c-strcasecmp.c \
78         $(SRC)/c-strcase.h \
79         $(SRC)/c-ctype.h \
80         $(EMACS_ROOT)/src/s/ms-w32.h \
81         $(EMACS_ROOT)/src/config.h
83 $(BLD)/c-strncasecmp.$(O) : \
84         $(SRC)/c-strncasecmp.c \
85         $(SRC)/c-strcase.h \
86         $(SRC)/c-ctype.h \
87         $(EMACS_ROOT)/src/s/ms-w32.h \
88         $(EMACS_ROOT)/src/config.h
90 $(BLD)/dtoastr.$(O) : \
91         $(SRC)/dtoastr.c \
92         $(SRC)/ftoastr.c \
93         $(SRC)/ftoastr.h \
94         $(SRC)/intprops.h \
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 \
101         $(SRC)/intprops.h \
102         $(SRC)/timespec.h \
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) : \
108         $(SRC)/getopt.c \
109         $(SRC)/getopt.h \
110         $(SRC)/getopt_int.h \
111         $(SRC)/gettext.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) : \
118         $(SRC)/getopt1.c \
119         $(SRC)/getopt.h \
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) : \
126         $(SRC)/gettime.c \
127         $(SRC)/timespec.h \
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) : \
134         $(SRC)/strftime.c \
135         $(SRC)/strftime.h \
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) : \
142         $(SRC)/time_r.c \
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 \
149         $(SRC)/intprops.h \
150         $(SRC)/timespec.h \
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 \
157         $(SRC)/intprops.h \
158         $(SRC)/timespec.h \
159         $(EMACS_ROOT)/nt/inc/sys/stat.h \
160         $(EMACS_ROOT)/src/s/ms-w32.h \
161         $(EMACS_ROOT)/src/config.h
163 $(BLD)/md5.$(O) : \
164         $(SRC)/md5.c \
165         $(SRC)/md5.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
172 $(BLD)/sha1.$(O) : \
173         $(SRC)/sha1.c \
174         $(SRC)/sha1.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) : \
182         $(SRC)/sha256.c \
183         $(SRC)/sha256.h \
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) : \
191         $(SRC)/sha512.c \
192         $(SRC)/sha512.h \
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) : \
200         $(SRC)/filemode.c \
201         $(SRC)/filemode.h \
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.
214 getopt.h:       getopt_.h
215         $(CP) $(ALL_DEPS) $@
218 # Maintenance
220 clean:
221         - $(DEL) $(COMPILER_TEMP_FILES)
222         - $(DEL) getopt.h
223         - $(DEL_TREE) $(OBJDIR)
224         - $(DEL) stamp_BLD
226 distclean:      cleanall
227         - $(DEL) TAGS
228         - $(DEL) Makefile
230 maintainer-clean: distclean
231         - $(DEL) getopt_.h
233 cleanall:       clean
234         - $(DEL_TREE) obj
235         - $(DEL_TREE) obj-spd
236         - $(DEL_TREE) oo
237         - $(DEL_TREE) oo-spd
239 # A dummy target to force other targets to be evaluated.
240 doit:
242 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
243         $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
245 getopt_.h-CMD: doit
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.
249         exit -1
251 getopt_.h-SH: doit
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.
255         exit -1
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
266 PRAGMA_COLUMNS =
267 NEXT_GETOPT_H = <getopt.h>
268 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
270 getopt_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
285         - $(DEL) getopt_.h-t