]> code.delx.au - gnu-emacs/blob - lib/makefile.w32-in
* fileio.c (Fverify_visited_file_modtime): Avoid time overflow
[gnu-emacs] / lib / makefile.w32-in
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2011 Free Software Foundation, Inc.
3
4 # This file is part of GNU Emacs.
5
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.
10
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.
15
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/>.
18
19 ALL = gnulib
20
21 .PHONY: $(ALL)
22
23 LOCAL_FLAGS = -DHAVE_CONFIG_H=1 -I. -I../nt/inc -I../src
24 LIBS =
25
26 GNULIBOBJS = $(BLD)/dtoastr.$(O) \
27 $(BLD)/getopt.$(O) \
28 $(BLD)/getopt1.$(O) \
29 $(BLD)/strftime.$(O) \
30 $(BLD)/time_r.$(O) \
31 $(BLD)/md5.$(O) \
32 $(BLD)/sha1.$(O) \
33 $(BLD)/filemode.$(O)
34
35 #
36 # Build the library
37 #
38 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
39 - $(DEL) $@
40 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
41
42 gnulib: stamp_BLD $(BLD)/libgnu.$(A)
43
44 #
45 # Build everything
46 #
47 all: stamp_BLD $(ALL)
48
49 ### TAGS ###
50
51 TAGS:
52 ../lib-src/$(BLD)/etags.exe *.c *.h
53
54 ### DEPENDENCIES ###
55
56 EMACS_ROOT = ..
57 SRC = .
58
59 $(BLD)/dtoastr.$(O) : \
60 $(SRC)/dtoastr.c \
61 $(SRC)/ftoastr.c \
62 $(SRC)/ftoastr.h \
63 $(SRC)/intprops.h \
64 $(EMACS_ROOT)/nt/inc/sys/stat.h \
65 $(EMACS_ROOT)/src/s/ms-w32.h \
66 $(EMACS_ROOT)/src/m/intel386.h \
67 $(EMACS_ROOT)/src/config.h
68
69 $(BLD)/getopt.$(O) : \
70 $(SRC)/getopt.c \
71 $(SRC)/getopt.h \
72 $(SRC)/getopt_int.h \
73 $(SRC)/gettext.h \
74 $(EMACS_ROOT)/nt/inc/unistd.h \
75 $(EMACS_ROOT)/nt/inc/sys/stat.h \
76 $(EMACS_ROOT)/src/s/ms-w32.h \
77 $(EMACS_ROOT)/src/m/intel386.h \
78 $(EMACS_ROOT)/src/config.h
79
80 $(BLD)/getopt1.$(O) : \
81 $(SRC)/getopt1.c \
82 $(SRC)/getopt.h \
83 $(SRC)/getopt_int.h \
84 $(EMACS_ROOT)/nt/inc/sys/stat.h \
85 $(EMACS_ROOT)/src/s/ms-w32.h \
86 $(EMACS_ROOT)/src/m/intel386.h \
87 $(EMACS_ROOT)/src/config.h
88
89 $(BLD)/strftime.$(O) : \
90 $(SRC)/strftime.c \
91 $(SRC)/strftime.h \
92 $(EMACS_ROOT)/nt/inc/stdbool.h \
93 $(EMACS_ROOT)/nt/inc/sys/stat.h \
94 $(EMACS_ROOT)/src/s/ms-w32.h \
95 $(EMACS_ROOT)/src/m/intel386.h \
96 $(EMACS_ROOT)/src/config.h
97
98 $(BLD)/time_r.$(O) : \
99 $(SRC)/time_r.c \
100 $(EMACS_ROOT)/nt/inc/sys/stat.h \
101 $(EMACS_ROOT)/src/s/ms-w32.h \
102 $(EMACS_ROOT)/src/m/intel386.h \
103 $(EMACS_ROOT)/src/config.h
104
105 $(BLD)/md5.$(O) : \
106 $(SRC)/md5.c \
107 $(SRC)/md5.h \
108 $(EMACS_ROOT)/nt/inc/stdint.h \
109 $(EMACS_ROOT)/nt/inc/sys/stat.h \
110 $(EMACS_ROOT)/src/s/ms-w32.h \
111 $(EMACS_ROOT)/src/m/intel386.h \
112 $(EMACS_ROOT)/src/config.h
113
114 $(BLD)/sha1.$(O) : \
115 $(SRC)/sha1.c \
116 $(SRC)/sha1.h \
117 $(EMACS_ROOT)/nt/inc/stdint.h \
118 $(EMACS_ROOT)/nt/inc/sys/stat.h \
119 $(EMACS_ROOT)/src/s/ms-w32.h \
120 $(EMACS_ROOT)/src/m/intel386.h \
121 $(EMACS_ROOT)/src/config.h
122
123 $(BLD)/filemode.$(O) : \
124 $(SRC)/filemode.c \
125 $(SRC)/filemode.h \
126 $(EMACS_ROOT)/nt/inc/sys/stat.h \
127 $(EMACS_ROOT)/src/s/ms-w32.h \
128 $(EMACS_ROOT)/src/m/intel386.h \
129 $(EMACS_ROOT)/src/config.h
130
131 # The following dependencies are for supporting parallel builds, where
132 # we must make sure $(BLD) exists before any compilation starts.
133 #
134 $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
135 $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
136 $(BLD)/filemode.$(O): stamp_BLD
137
138 #
139 # Headers we would preprocess if we could.
140 #
141 getopt.h: getopt_.h
142 $(CP) $(ALL_DEPS) $@
143
144 #
145 # Maintenance
146 #
147 clean:
148 - $(DEL) $(COMPILER_TEMP_FILES)
149 - $(DEL) getopt.h
150 - $(DEL_TREE) $(OBJDIR)
151 - $(DEL) stamp_BLD
152
153 distclean: cleanall
154 - $(DEL) TAGS
155 - $(DEL) Makefile
156
157 maintainer-clean: distclean
158 - $(DEL) getopt_.h
159
160 cleanall: clean
161 - $(DEL_TREE) obj
162 - $(DEL_TREE) obj-spd
163 - $(DEL_TREE) oo
164 - $(DEL_TREE) oo-spd
165
166 # A dummy target to force other targets to be evaluated.
167 doit:
168
169 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
170 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
171
172 getopt_.h-CMD: doit
173 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
174 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
175 @echo You will need GNU Sed to be installed.
176 exit -1
177
178 getopt_.h-SH: doit
179 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
180 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
181 @echo You will need GNU Sed to be installed.
182 exit -1
183
184 # Generating getopt_.h from getopt.in.h.
185 #
186 # To avoid requiring all end users to install Sed, we have below
187 # a maintainer-only target that produces getopt_.h from getopt.in.h.
188 # For easier maintenance, all the strings that replace the @FOO@
189 # placeholder are defined as Make macros below.
190
191 HAVE_GETOPT_H = HAVE_GETOPT_H
192 INCLUDE_NEXT = include_next
193 PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header
194 PRAGMA_COLUMNS =
195 NEXT_GETOPT_H = <getopt.h>
196 ARG_NONNULL_H = ../arg-nonnull.h
197
198 getopt_h:
199 - $(DEL) getopt_.h-t getopt_.h
200 sed -e "s!@GUARD_PREFIX@!GL!g" \
201 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
202 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
203 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
204 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
205 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
206 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
207 -e "/^\# include_next/i # ifndef __GNUC__" \
208 -e "/^\# include_next/i # include <next_getopt.h>" \
209 -e "/^\# include_next/i # else" \
210 -e "/^\# include_next/a # endif" \
211 < getopt.in.h > getopt_.h-t
212 $(CP) getopt_.h-t getopt_.h
213 - $(DEL) getopt_.h-t