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