Remove src/m/*.
[bpt/emacs.git] / 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)/sha256.$(O) \
34 $(BLD)/sha512.$(O) \
35 $(BLD)/filemode.$(O)
36
37 #
38 # Build the library
39 #
40 $(BLD)/libgnu.$(A): $(GNULIBOBJS)
41 - $(DEL) $@
42 $(AR) $(AR_OUT)$@ $(ALL_DEPS)
43
44 gnulib: $(BLD)/libgnu.$(A)
45
46 #
47 # Build everything
48 #
49 all: $(ALL)
50
51 ### TAGS ###
52
53 FRC:
54
55 TAGS: FRC
56 ../lib-src/$(BLD)/etags.exe *.c *.h
57
58 ### DEPENDENCIES ###
59
60 EMACS_ROOT = ..
61 SRC = .
62
63 $(BLD)/dtoastr.$(O) : \
64 $(SRC)/dtoastr.c \
65 $(SRC)/ftoastr.c \
66 $(SRC)/ftoastr.h \
67 $(SRC)/intprops.h \
68 $(EMACS_ROOT)/nt/inc/sys/stat.h \
69 $(EMACS_ROOT)/src/s/ms-w32.h \
70 $(EMACS_ROOT)/src/config.h
71
72 $(BLD)/getopt.$(O) : \
73 $(SRC)/getopt.c \
74 $(SRC)/getopt.h \
75 $(SRC)/getopt_int.h \
76 $(SRC)/gettext.h \
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
81
82 $(BLD)/getopt1.$(O) : \
83 $(SRC)/getopt1.c \
84 $(SRC)/getopt.h \
85 $(SRC)/getopt_int.h \
86 $(EMACS_ROOT)/nt/inc/sys/stat.h \
87 $(EMACS_ROOT)/src/s/ms-w32.h \
88 $(EMACS_ROOT)/src/config.h
89
90 $(BLD)/strftime.$(O) : \
91 $(SRC)/strftime.c \
92 $(SRC)/strftime.h \
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
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/config.h
103
104 $(BLD)/md5.$(O) : \
105 $(SRC)/md5.c \
106 $(SRC)/md5.h \
107 $(EMACS_ROOT)/nt/inc/stdint.h \
108 $(EMACS_ROOT)/nt/inc/sys/stat.h \
109 $(EMACS_ROOT)/src/s/ms-w32.h \
110 $(EMACS_ROOT)/src/config.h
111
112 $(BLD)/sha1.$(O) : \
113 $(SRC)/sha1.c \
114 $(SRC)/sha1.h \
115 $(EMACS_ROOT)/nt/inc/stdint.h \
116 $(EMACS_ROOT)/nt/inc/sys/stat.h \
117 $(EMACS_ROOT)/src/s/ms-w32.h \
118 $(EMACS_ROOT)/src/config.h
119
120 $(BLD)/sha256.$(O) : \
121 $(SRC)/sha256.c \
122 $(SRC)/sha256.h \
123 $(EMACS_ROOT)/nt/inc/stdint.h \
124 $(EMACS_ROOT)/nt/inc/sys/stat.h \
125 $(EMACS_ROOT)/src/s/ms-w32.h \
126 $(EMACS_ROOT)/src/config.h
127
128 $(BLD)/sha512.$(O) : \
129 $(SRC)/sha512.c \
130 $(SRC)/sha512.h \
131 $(EMACS_ROOT)/nt/inc/stdint.h \
132 $(EMACS_ROOT)/nt/inc/sys/stat.h \
133 $(EMACS_ROOT)/src/s/ms-w32.h \
134 $(EMACS_ROOT)/src/config.h
135
136 $(BLD)/filemode.$(O) : \
137 $(SRC)/filemode.c \
138 $(SRC)/filemode.h \
139 $(EMACS_ROOT)/nt/inc/sys/stat.h \
140 $(EMACS_ROOT)/src/s/ms-w32.h \
141 $(EMACS_ROOT)/src/config.h
142
143 # The following dependencies are for supporting parallel builds, where
144 # we must make sure $(BLD) exists before any compilation starts.
145 #
146 $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
147 $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
148 $(BLD)/sha1.$(O) $(BLD)/sha256.$(O) $(BLD)/sha512.$(O): stamp_BLD
149 $(BLD)/filemode.$(O): stamp_BLD
150
151 #
152 # Headers we would preprocess if we could.
153 #
154 getopt.h: getopt_.h
155 $(CP) $(ALL_DEPS) $@
156
157 #
158 # Maintenance
159 #
160 clean:
161 - $(DEL) $(COMPILER_TEMP_FILES)
162 - $(DEL) getopt.h
163 - $(DEL_TREE) $(OBJDIR)
164 - $(DEL) stamp_BLD
165
166 distclean: cleanall
167 - $(DEL) TAGS
168 - $(DEL) Makefile
169
170 maintainer-clean: distclean
171 - $(DEL) getopt_.h
172
173 cleanall: clean
174 - $(DEL_TREE) obj
175 - $(DEL_TREE) obj-spd
176 - $(DEL_TREE) oo
177 - $(DEL_TREE) oo-spd
178
179 # A dummy target to force other targets to be evaluated.
180 doit:
181
182 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
183 $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
184
185 getopt_.h-CMD: doit
186 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
187 @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
188 @echo You will need GNU Sed to be installed.
189 exit -1
190
191 getopt_.h-SH: doit
192 @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
193 @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
194 @echo You will need GNU Sed to be installed.
195 exit -1
196
197 # Generating getopt_.h from getopt.in.h.
198 #
199 # To avoid requiring all end users to install Sed, we have below
200 # a maintainer-only target that produces getopt_.h from getopt.in.h.
201 # For easier maintenance, all the strings that replace the @FOO@
202 # placeholder are defined as Make macros below.
203
204 HAVE_GETOPT_H = HAVE_GETOPT_H
205 INCLUDE_NEXT = include_next
206 PRAGMA_COLUMNS =
207 NEXT_GETOPT_H = <getopt.h>
208 ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
209
210 getopt_h:
211 - $(DEL) getopt_.h-t getopt_.h
212 sed -e "s!@GUARD_PREFIX@!GL!g" \
213 -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
214 -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
215 -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
216 -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
217 -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
218 -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
219 -e "/^\# include_next/i # ifndef __GNUC__" \
220 -e "/^\# include_next/i # include <next_getopt.h>" \
221 -e "/^\# include_next/i # else" \
222 -e "/^\# include_next/a # endif" \
223 < getopt.in.h > getopt_.h-t
224 $(CP) getopt_.h-t getopt_.h
225 - $(DEL) getopt_.h-t